0023418: Crash on the object displaying when running DRAW on remote station. OpenGL...
[occt.git] / src / OpenGl / OpenGl_GraphicDriver_710.cxx
1 // Created on: 2011-10-20
2 // Created by: Sergey ZERCHANINOV
3 // Copyright (c) 2011-2012 OPEN CASCADE SAS
4 //
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
9 //
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12 //
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
19
20
21 #include <OpenGl_GraphicDriver.hxx>
22
23 #include <TCollection_AsciiString.hxx>
24 #include <OpenGl_Group.hxx>
25 #include <OpenGl_Text.hxx>
26
27 void OpenGl_GraphicDriver::Text 
28 (
29  const Graphic3d_CGroup& ACGroup,
30  const Standard_CString AText,
31  const Graphic3d_Vertex& APoint,
32  const Standard_Real AHeight,
33  const Quantity_PlaneAngle AAngle,
34  const Graphic3d_TextPath ATp,
35  const Graphic3d_HorizontalTextAlignment AHta,
36  const Graphic3d_VerticalTextAlignment AVta,
37  const Standard_Boolean EvalMinMax
38  ) 
39 {
40   TCollection_ExtendedString TheText(AText);
41   OpenGl_GraphicDriver::Text(ACGroup,TheText,APoint,AHeight,AAngle,ATp,AHta,AVta,EvalMinMax);
42 }
43
44 void OpenGl_GraphicDriver::Text 
45 (
46  const Graphic3d_CGroup& ACGroup,
47  const Standard_CString AText, 
48  const Graphic3d_Vertex& APoint, 
49  const Standard_Real AHeight, 
50  const Standard_Boolean EvalMinMax
51  ) 
52 {
53   TCollection_ExtendedString TheText(AText);
54   OpenGl_GraphicDriver::Text(ACGroup,TheText,APoint,AHeight,EvalMinMax);
55 }
56
57 void OpenGl_GraphicDriver::Text 
58 (
59  const Graphic3d_CGroup& ACGroup,
60  const TCollection_ExtendedString& AText, 
61  const Graphic3d_Vertex& APoint, 
62  const Standard_Real AHeight, 
63  const Quantity_PlaneAngle AAngle, 
64  const Graphic3d_TextPath ATp, 
65  const Graphic3d_HorizontalTextAlignment AHta, 
66  const Graphic3d_VerticalTextAlignment AVta, 
67  const Standard_Boolean 
68  ) 
69 {
70   if (ACGroup.ptrGroup)
71   {
72     Standard_Real theHeight = AHeight;
73     if (theHeight < 0.)
74       theHeight = DefaultTextHeight();
75
76     OpenGl_Text *atext = new OpenGl_Text( AText, APoint, theHeight, AHta, AVta );
77     ((OpenGl_Group *)ACGroup.ptrGroup)->AddElement( TelText, atext );
78   }
79 }
80
81 void OpenGl_GraphicDriver::Text 
82 (
83  const Graphic3d_CGroup& ACGroup,
84  const TCollection_ExtendedString& AText, 
85  const Graphic3d_Vertex& APoint, 
86  const Standard_Real AHeight, 
87  const Standard_Boolean 
88  )
89 {
90   if (ACGroup.ptrGroup)
91   {
92     Standard_Real theHeight = AHeight;
93     if (theHeight < 0.)
94       theHeight = DefaultTextHeight();
95
96     OpenGl_Text *atext = new OpenGl_Text( AText, APoint, theHeight, Graphic3d_HTA_LEFT, Graphic3d_VTA_BOTTOM );
97     ((OpenGl_Group *)ACGroup.ptrGroup)->AddElement( TelText, atext );
98   }
99 }