0023418: Crash on the object displaying when running DRAW on remote station. OpenGL...
[occt.git] / src / OpenGl / OpenGl_GraphicDriver_710.cxx
CommitLineData
b311480e 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
7fd59977 20
2166f0fa 21#include <OpenGl_GraphicDriver.hxx>
7fd59977 22
7fd59977 23#include <TCollection_AsciiString.hxx>
2166f0fa
SK
24#include <OpenGl_Group.hxx>
25#include <OpenGl_Text.hxx>
7fd59977 26
27void 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,
13a22457 37 const Standard_Boolean EvalMinMax
7fd59977 38 )
39{
13a22457
S
40 TCollection_ExtendedString TheText(AText);
41 OpenGl_GraphicDriver::Text(ACGroup,TheText,APoint,AHeight,AAngle,ATp,AHta,AVta,EvalMinMax);
7fd59977 42}
43
44void OpenGl_GraphicDriver::Text
45(
46 const Graphic3d_CGroup& ACGroup,
47 const Standard_CString AText,
48 const Graphic3d_Vertex& APoint,
49 const Standard_Real AHeight,
13a22457 50 const Standard_Boolean EvalMinMax
7fd59977 51 )
52{
13a22457
S
53 TCollection_ExtendedString TheText(AText);
54 OpenGl_GraphicDriver::Text(ACGroup,TheText,APoint,AHeight,EvalMinMax);
7fd59977 55}
56
57void 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{
2166f0fa
SK
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 );
7fd59977 78 }
7fd59977 79}
80
81void 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
13a22457
S
88 )
89{
2166f0fa
SK
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 );
13a22457 98 }
13a22457 99}