0024751: Performance improvements in the Edge/Edge intersection algorithm
[occt.git] / src / Graphic3d / Graphic3d_Group_10.cxx
CommitLineData
b311480e 1// Created by: NW,JPB,CAL
2// Copyright (c) 1995-1999 Matra Datavision
973c2be1 3// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
b311480e 6//
d5f74e42 7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
b311480e 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
7fd59977 15
16//-Version
17
18//-Design Declaration des variables specifiques aux groupes
19// de primitives
20
21//-Warning Un groupe est defini dans une structure
22// Il s'agit de la plus petite entite editable
23
24//-References
25
26//-Language C++ 2.0
27
28//-Declarations
29
30// for the class
31#include <Graphic3d_Group.jxx>
32#include <Graphic3d_Group.pxx>
33
34#include <TCollection_AsciiString.hxx>
35
36//-Methods, in order
37
38void Graphic3d_Group::Text (
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
13a22457
S
47 )
48{
49 if (IsDeleted ()) return;
50
51 MyIsEmpty = Standard_False;
52
53 // Min-Max Update
54 if (EvalMinMax) {
b8ddfc2f 55 Standard_ShortReal X, Y, Z;
13a22457 56 APoint.Coord (X, Y, Z);
b8ddfc2f 57 if (X < MyBounds.XMin) MyBounds.XMin = X;
58 if (Y < MyBounds.YMin) MyBounds.YMin = Y;
59 if (Z < MyBounds.ZMin) MyBounds.ZMin = Z;
60 if (X > MyBounds.XMax) MyBounds.XMax = X;
61 if (Y > MyBounds.YMax) MyBounds.YMax = Y;
62 if (Z > MyBounds.ZMax) MyBounds.ZMax = Z;
13a22457
S
63 }
64
65 MyGraphicDriver->Text(MyCGroup, AText, APoint, AHeight, AAngle, ATp, AHta, AVta, EvalMinMax);
66
67 Update ();
7fd59977 68}
69
70void Graphic3d_Group::Text (
71 const Standard_CString AText,
72 const Graphic3d_Vertex& APoint,
73 const Standard_Real AHeight,
74 const Standard_Boolean EvalMinMax
13a22457
S
75 )
76{
77 if (IsDeleted ()) return;
78
79 MyIsEmpty = Standard_False;
80
81 // Min-Max Update
82 if (EvalMinMax) {
b8ddfc2f 83 Standard_ShortReal X, Y, Z;
13a22457 84 APoint.Coord (X, Y, Z);
b8ddfc2f 85 if (X < MyBounds.XMin) MyBounds.XMin = X;
86 if (Y < MyBounds.YMin) MyBounds.YMin = Y;
87 if (Z < MyBounds.ZMin) MyBounds.ZMin = Z;
88 if (X > MyBounds.XMax) MyBounds.XMax = X;
89 if (Y > MyBounds.YMax) MyBounds.YMax = Y;
90 if (Z > MyBounds.ZMax) MyBounds.ZMax = Z;
13a22457
S
91 }
92
93 MyGraphicDriver->Text (MyCGroup, AText, APoint, AHeight, EvalMinMax);
94
95 Update ();
7fd59977 96}
97
98void Graphic3d_Group::Text (
99 const TCollection_ExtendedString& AText,
100 const Graphic3d_Vertex& APoint,
101 const Standard_Real AHeight,
102 const Quantity_PlaneAngle AAngle,
103 const Graphic3d_TextPath ATp,
104 const Graphic3d_HorizontalTextAlignment AHta,
105 const Graphic3d_VerticalTextAlignment AVta,
106 const Standard_Boolean EvalMinMax
13a22457
S
107 )
108{
109 if (IsDeleted ()) return;
110
111 MyIsEmpty = Standard_False;
112
113 // Min-Max Update
114 if (EvalMinMax) {
b8ddfc2f 115 Standard_ShortReal X, Y, Z;
13a22457 116 APoint.Coord (X, Y, Z);
b8ddfc2f 117 if (X < MyBounds.XMin) MyBounds.XMin = X;
118 if (Y < MyBounds.YMin) MyBounds.YMin = Y;
119 if (Z < MyBounds.ZMin) MyBounds.ZMin = Z;
120 if (X > MyBounds.XMax) MyBounds.XMax = X;
121 if (Y > MyBounds.YMax) MyBounds.YMax = Y;
122 if (Z > MyBounds.ZMax) MyBounds.ZMax = Z;
13a22457
S
123 }
124
125 MyGraphicDriver->Text(MyCGroup, AText, APoint, AHeight, AAngle, ATp, AHta, AVta, EvalMinMax);
126
127 Update ();
7fd59977 128}
129
130void Graphic3d_Group::Text (
131 const TCollection_ExtendedString& AText,
132 const Graphic3d_Vertex& APoint,
133 const Standard_Real AHeight,
134 const Standard_Boolean EvalMinMax
13a22457
S
135 )
136{
137 if (IsDeleted ()) return;
138
139 MyIsEmpty = Standard_False;
140
141 // Min-Max Update
142 if (EvalMinMax) {
b8ddfc2f 143 Standard_ShortReal X, Y, Z;
13a22457 144 APoint.Coord (X, Y, Z);
b8ddfc2f 145 if (X < MyBounds.XMin) MyBounds.XMin = X;
146 if (Y < MyBounds.YMin) MyBounds.YMin = Y;
147 if (Z < MyBounds.ZMin) MyBounds.ZMin = Z;
148 if (X > MyBounds.XMax) MyBounds.XMax = X;
149 if (Y > MyBounds.YMax) MyBounds.YMax = Y;
150 if (Z > MyBounds.ZMax) MyBounds.ZMax = Z;
13a22457
S
151 }
152
153 MyGraphicDriver->Text (MyCGroup, AText, APoint, AHeight, EvalMinMax);
154
155 Update ();
7fd59977 156}