0012121: Optimization of existing selection classes
[occt.git] / src / OpenGl / OpenGl_GraphicDriver_710.cxx
1
2 #define NOVIRTUAL
3
4 // File   OpenGl_GraphicDriver_710.cxx
5 // Created  Mardi 28 janvier 1997
6 // Author CAL
7
8 //-Copyright  MatraDatavision 1997
9
10 //-Version  
11
12 //-Design Declaration des variables specifiques aux Drivers
13
14 //-Warning  Un driver encapsule les Pex et OpenGl drivers
15
16 //-References 
17
18 //-Language C++ 2.0
19
20 //-Declarations
21
22 // for the class
23 #include <OpenGl_GraphicDriver.jxx>
24 #include <TCollection_AsciiString.hxx>
25
26 #include <Aspect_DriverDefinitionError.hxx>
27
28 #include <OpenGl_tgl_funcs.hxx>
29
30 //-Aliases
31
32 //-Global data definitions
33
34 //-Methods, in order
35
36 void OpenGl_GraphicDriver::Text 
37 (
38  const Graphic3d_CGroup& ACGroup,
39  const Standard_CString AText,
40  const Graphic3d_Vertex& APoint,
41  const Standard_Real AHeight,
42  const Quantity_PlaneAngle AAngle,
43  const Graphic3d_TextPath ATp,
44  const Graphic3d_HorizontalTextAlignment AHta,
45  const Graphic3d_VerticalTextAlignment AVta,
46  const Standard_Boolean EvalMinMax
47  ) 
48 {
49   TCollection_ExtendedString TheText(AText);
50   OpenGl_GraphicDriver::Text(ACGroup,TheText,APoint,AHeight,AAngle,ATp,AHta,AVta,EvalMinMax);
51 }
52
53 void OpenGl_GraphicDriver::Text 
54 (
55  const Graphic3d_CGroup& ACGroup,
56  const Standard_CString AText, 
57  const Graphic3d_Vertex& APoint, 
58  const Standard_Real AHeight, 
59  const Standard_Boolean EvalMinMax
60  ) 
61 {
62   TCollection_ExtendedString TheText(AText);
63   OpenGl_GraphicDriver::Text(ACGroup,TheText,APoint,AHeight,EvalMinMax);
64 }
65
66 void OpenGl_GraphicDriver::Text 
67 (
68  const Graphic3d_CGroup& ACGroup,
69  const TCollection_ExtendedString& AText, 
70  const Graphic3d_Vertex& APoint, 
71  const Standard_Real AHeight, 
72  const Quantity_PlaneAngle AAngle, 
73  const Graphic3d_TextPath ATp, 
74  const Graphic3d_HorizontalTextAlignment AHta, 
75  const Graphic3d_VerticalTextAlignment AVta, 
76  const Standard_Boolean 
77  ) 
78 {
79   Graphic3d_CGroup MyCGroup = ACGroup;
80
81   CALL_DEF_TEXT atext;
82
83   Standard_Real X, Y, Z;
84   APoint.Coord (X, Y, Z);
85   atext.Position.x  = float (X);
86   atext.Position.y  = float (Y);
87   atext.Position.z  = float (Z);
88   atext.Height    = float (AHeight);
89   if (atext.Height < 0)
90     atext.Height = DefaultTextHeight();
91   atext.Angle   = float (AAngle);
92   atext.Path    = int (ATp);
93   atext.HAlign    = int (AHta);
94   atext.VAlign    = int (AVta);
95   atext.string    = (unsigned short *)AText.ToExtString ();
96
97   if (MyTraceLevel) {
98     PrintFunction ("call_togl_text");
99     PrintCGroup (MyCGroup, 1);
100   }
101   call_togl_text (&MyCGroup, &atext);
102 }
103
104 void OpenGl_GraphicDriver::Text 
105 (
106  const Graphic3d_CGroup& ACGroup,
107  const TCollection_ExtendedString& AText, 
108  const Graphic3d_Vertex& APoint, 
109  const Standard_Real AHeight, 
110  const Standard_Boolean 
111  )
112 {
113   Graphic3d_CGroup MyCGroup = ACGroup;
114
115   CALL_DEF_TEXT atext;
116
117   Standard_Real X, Y, Z;
118   APoint.Coord (X, Y, Z);
119   atext.Position.x  = float (X);
120   atext.Position.y  = float (Y);
121   atext.Position.z  = float (Z);
122   atext.Height    = float (AHeight);
123   if (atext.Height < 0)
124     atext.Height = DefaultTextHeight();
125   atext.Angle   = float (M_PI / 2.);
126   atext.Path    = int (Graphic3d_TP_RIGHT);
127   atext.HAlign    = int (Graphic3d_HTA_LEFT);
128   atext.VAlign    = int (Graphic3d_VTA_BOTTOM);
129   atext.string    = (unsigned short *)AText.ToExtString ();
130
131   if (MyTraceLevel) {
132     PrintFunction ("call_togl_text");
133     PrintCGroup (MyCGroup, 1);
134   }
135   call_togl_text (&MyCGroup, &atext);
136 }