1 // Created on: 2011-10-20
2 // Created by: Sergey ZERCHANINOV
3 // Copyright (c) 2011-2012 OPEN CASCADE SAS
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.
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.
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.
21 #include <OpenGl_GraphicDriver.hxx>
23 #include <TCollection_AsciiString.hxx>
24 #include <OpenGl_Group.hxx>
25 #include <OpenGl_Text.hxx>
27 void OpenGl_GraphicDriver::Text
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
40 TCollection_ExtendedString TheText(AText);
41 OpenGl_GraphicDriver::Text(ACGroup,TheText,APoint,AHeight,AAngle,ATp,AHta,AVta,EvalMinMax);
44 void OpenGl_GraphicDriver::Text
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
53 TCollection_ExtendedString TheText(AText);
54 OpenGl_GraphicDriver::Text(ACGroup,TheText,APoint,AHeight,EvalMinMax);
57 void OpenGl_GraphicDriver::Text
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
72 Standard_Real theHeight = AHeight;
74 theHeight = DefaultTextHeight();
76 OpenGl_Text *atext = new OpenGl_Text( AText, APoint, theHeight, AHta, AVta );
77 ((OpenGl_Group *)ACGroup.ptrGroup)->AddElement( TelText, atext );
81 void OpenGl_GraphicDriver::Text
83 const Graphic3d_CGroup& ACGroup,
84 const TCollection_ExtendedString& AText,
85 const Graphic3d_Vertex& APoint,
86 const Standard_Real AHeight,
87 const Standard_Boolean
92 Standard_Real theHeight = AHeight;
94 theHeight = DefaultTextHeight();
96 OpenGl_Text *atext = new OpenGl_Text( AText, APoint, theHeight, Graphic3d_HTA_LEFT, Graphic3d_VTA_BOTTOM );
97 ((OpenGl_Group *)ACGroup.ptrGroup)->AddElement( TelText, atext );