0012121: Optimization of existing selection classes
[occt.git] / src / OpenGl / OpenGl_GraphicDriver_2.cxx
1
2
3 // File   OpenGl_GraphicDriver_2.cxx
4 // Created  Mardi 28 janvier 1997
5 // Author CAL
6
7 //-Copyright  MatraDatavision 1997
8
9 //-Version  
10
11 //-Design Declaration des variables specifiques aux Drivers
12
13 //-Warning  Un driver encapsule les Pex et OpenGl drivers
14
15 //-References 
16
17 //-Language C++ 2.0
18
19 //-Declarations
20
21 // for the class
22 #include <OpenGl_GraphicDriver.jxx>
23
24 #include <Aspect_DriverDefinitionError.hxx>
25
26 #include <OpenGl_tgl_funcs.hxx>
27
28 //-Aliases
29
30 //-Global data definitions
31
32 //-Methods, in order
33
34 Standard_Integer OpenGl_GraphicDriver::InquireLightLimit () {
35
36   if (MyTraceLevel) {
37     PrintFunction ("call_togl_inquirelight");
38   }
39   Standard_Integer Result = call_togl_inquirelight ();
40   if (MyTraceLevel) {
41     PrintIResult ("call_togl_inquirelight", Result);
42   }
43   return Result;
44
45 }
46
47 void OpenGl_GraphicDriver::InquireMat (const Graphic3d_CView& ACView, TColStd_Array2OfReal& AMatO, TColStd_Array2OfReal& AMatM) {
48
49   Graphic3d_CView MyCView = ACView;
50
51   Standard_Integer i, j;
52
53   CALL_DEF_MATRIX4X4 ori_matrix;
54   CALL_DEF_MATRIX4X4 map_matrix;
55
56   if (MyTraceLevel) {
57     PrintFunction ("call_togl_inquiremat");
58     PrintCView (MyCView, 1);
59   }
60   if (call_togl_inquiremat (&MyCView, ori_matrix, map_matrix) == 0)
61     for (i=0; i<=3; i++)
62       for (j=0; j<=3; j++) {
63         AMatO (i, j)  = Standard_Real (ori_matrix[i][j]);
64         AMatM (i, j)  = Standard_Real (map_matrix[i][j]);
65       }
66   else
67     for (i=0; i<=3; i++)
68       for (j=0; j<=3; j++) {
69         if (i == j) {
70           AMatM (i, j)  = 1.0;
71           AMatO (i, j)  = 1.0;
72         }
73         else {
74           AMatM (i, j)  = 0.0;
75           AMatO (i, j)  = 0.0;
76         }
77       }
78
79       if (MyTraceLevel) {
80         PrintMatrix ("Orientation", AMatO);
81         PrintMatrix ("Mapping", AMatM);
82       }
83
84 }
85
86 Standard_Integer OpenGl_GraphicDriver::InquirePlaneLimit () {
87
88   if (MyTraceLevel) {
89     PrintFunction ("call_togl_inquireplane");
90   }
91   Standard_Integer Result = call_togl_inquireplane ();
92   if (MyTraceLevel) {
93     PrintIResult ("call_togl_inquireplane", Result);
94   }
95   return Result;
96
97 }
98
99 Standard_Integer OpenGl_GraphicDriver::InquireViewLimit () {
100
101   if (MyTraceLevel) {
102     PrintFunction ("call_togl_inquireview");
103   }
104   Standard_Integer Result = call_togl_inquireview ();
105   if (MyTraceLevel) {
106     PrintIResult ("call_togl_inquireview", Result);
107   }
108   return Result;
109
110 }
111
112
113
114 Standard_Boolean OpenGl_GraphicDriver::InquireTextureAvailable () {
115
116   if (MyTraceLevel) {
117     PrintFunction ("call_togl_inquiretexture");
118   }
119   Standard_Integer Result = call_togl_inquiretexture ();
120   if (MyTraceLevel) {
121     PrintIResult ("call_togl_inquiretexture", Result);
122   }
123   return Result;
124
125 }