0022819: Redesign of OpenGl driver
[occt.git] / src / OpenGl / OpenGl_GraphicDriver_710.cxx
1 // File:      OpenGl_GraphicDriver_710.cxx
2 // Created:   20 October 2011
3 // Author:    Sergey ZERCHANINOV
4 // Copyright: OPEN CASCADE 2011
5
6 #include <OpenGl_GraphicDriver.hxx>
7
8 #include <TCollection_AsciiString.hxx>
9 #include <OpenGl_Group.hxx>
10 #include <OpenGl_Text.hxx>
11
12 void OpenGl_GraphicDriver::Text 
13 (
14  const Graphic3d_CGroup& ACGroup,
15  const Standard_CString AText,
16  const Graphic3d_Vertex& APoint,
17  const Standard_Real AHeight,
18  const Quantity_PlaneAngle AAngle,
19  const Graphic3d_TextPath ATp,
20  const Graphic3d_HorizontalTextAlignment AHta,
21  const Graphic3d_VerticalTextAlignment AVta,
22  const Standard_Boolean EvalMinMax
23  ) 
24 {
25   TCollection_ExtendedString TheText(AText);
26   OpenGl_GraphicDriver::Text(ACGroup,TheText,APoint,AHeight,AAngle,ATp,AHta,AVta,EvalMinMax);
27 }
28
29 void OpenGl_GraphicDriver::Text 
30 (
31  const Graphic3d_CGroup& ACGroup,
32  const Standard_CString AText, 
33  const Graphic3d_Vertex& APoint, 
34  const Standard_Real AHeight, 
35  const Standard_Boolean EvalMinMax
36  ) 
37 {
38   TCollection_ExtendedString TheText(AText);
39   OpenGl_GraphicDriver::Text(ACGroup,TheText,APoint,AHeight,EvalMinMax);
40 }
41
42 void OpenGl_GraphicDriver::Text 
43 (
44  const Graphic3d_CGroup& ACGroup,
45  const TCollection_ExtendedString& AText, 
46  const Graphic3d_Vertex& APoint, 
47  const Standard_Real AHeight, 
48  const Quantity_PlaneAngle AAngle, 
49  const Graphic3d_TextPath ATp, 
50  const Graphic3d_HorizontalTextAlignment AHta, 
51  const Graphic3d_VerticalTextAlignment AVta, 
52  const Standard_Boolean 
53  ) 
54 {
55   if (ACGroup.ptrGroup)
56   {
57     Standard_Real theHeight = AHeight;
58     if (theHeight < 0.)
59       theHeight = DefaultTextHeight();
60
61     OpenGl_Text *atext = new OpenGl_Text( AText, APoint, theHeight, AHta, AVta );
62     ((OpenGl_Group *)ACGroup.ptrGroup)->AddElement( TelText, atext );
63   }
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 Standard_Boolean 
73  )
74 {
75   if (ACGroup.ptrGroup)
76   {
77     Standard_Real theHeight = AHeight;
78     if (theHeight < 0.)
79       theHeight = DefaultTextHeight();
80
81     OpenGl_Text *atext = new OpenGl_Text( AText, APoint, theHeight, Graphic3d_HTA_LEFT, Graphic3d_VTA_BOTTOM );
82     ((OpenGl_Group *)ACGroup.ptrGroup)->AddElement( TelText, atext );
83   }
84 }