1 // Created on: 1993-01-13
2 // Created by: CKY / Contract Toubro-Larsen ( Deepak PRABHU )
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _IGESDimen_NewGeneralNote_HeaderFile
18 #define _IGESDimen_NewGeneralNote_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Standard_Real.hxx>
24 #include <Standard_Integer.hxx>
26 #include <TColStd_HArray1OfInteger.hxx>
27 #include <TColStd_HArray1OfReal.hxx>
28 #include <Interface_HArray1OfHAsciiString.hxx>
29 #include <IGESData_HArray1OfIGESEntity.hxx>
30 #include <TColgp_HArray1OfXYZ.hxx>
31 #include <IGESData_IGESEntity.hxx>
32 #include <Standard_Boolean.hxx>
33 class Standard_DimensionMismatch;
34 class Standard_OutOfRange;
37 class TCollection_HAsciiString;
38 class IGESData_IGESEntity;
41 class IGESDimen_NewGeneralNote;
42 DEFINE_STANDARD_HANDLE(IGESDimen_NewGeneralNote, IGESData_IGESEntity)
44 //! defines NewGeneralNote, Type <213> Form <0>
45 //! in package IGESDimen
46 //! Further attributes for formatting text strings
47 class IGESDimen_NewGeneralNote : public IGESData_IGESEntity
53 Standard_EXPORT IGESDimen_NewGeneralNote();
55 //! This method is used to set the fields of the class
57 //! - width : Width of text containment area
58 //! - height : Height of text containment area
59 //! - justifyCode : Justification code
60 //! - areaLoc : Text containment area location
61 //! - areaRotationAngle : Text containment area rotation
62 //! - baseLinePos : Base line position
63 //! - normalInterlineSpace : Normal interline spacing
64 //! - charDisplays : Character display type
65 //! - charWidths : Character width
66 //! - charHeights : Character height
67 //! - interCharSpc : Intercharacter spacing
68 //! - interLineSpc : Interline spacing
69 //! - fontStyles : Font style
70 //! - charAngles : Character angle
71 //! - controlCodeStrings : Control Code string
72 //! - nbChars : Number of characters in string
73 //! - boxWidths : Box width
74 //! - boxHeights : Box height
75 //! - charSetCodes : Character Set Interpretation
76 //! - charSetEntities : Character Set Font
77 //! - slAngles : Slant angle of text in radians
78 //! - rotAngles : Rotation angle of text in radians
79 //! - mirrorFlags : Type of mirroring
80 //! - rotateFlags : Rotate internal text flag
81 //! - startPoints : Text start point
82 //! - texts : Text strings
83 //! raises exception if there is mismatch between the various
85 Standard_EXPORT void Init (const Standard_Real width, const Standard_Real height, const Standard_Integer justifyCode, const gp_XYZ& areaLoc, const Standard_Real areaRotationAngle, const gp_XYZ& baseLinePos, const Standard_Real normalInterlineSpace, const Handle(TColStd_HArray1OfInteger)& charDisplays, const Handle(TColStd_HArray1OfReal)& charWidths, const Handle(TColStd_HArray1OfReal)& charHeights, const Handle(TColStd_HArray1OfReal)& interCharSpc, const Handle(TColStd_HArray1OfReal)& interLineSpc, const Handle(TColStd_HArray1OfInteger)& fontStyles, const Handle(TColStd_HArray1OfReal)& charAngles, const Handle(Interface_HArray1OfHAsciiString)& controlCodeStrings, const Handle(TColStd_HArray1OfInteger)& nbChars, const Handle(TColStd_HArray1OfReal)& boxWidths, const Handle(TColStd_HArray1OfReal)& boxHeights, const Handle(TColStd_HArray1OfInteger)& charSetCodes, const Handle(IGESData_HArray1OfIGESEntity)& charSetEntities, const Handle(TColStd_HArray1OfReal)& slAngles, const Handle(TColStd_HArray1OfReal)& rotAngles, const Handle(TColStd_HArray1OfInteger)& mirrorFlags, const Handle(TColStd_HArray1OfInteger)& rotateFlags, const Handle(TColgp_HArray1OfXYZ)& startPoints, const Handle(Interface_HArray1OfHAsciiString)& texts);
87 //! returns width of text containment area of all strings in the note
88 Standard_EXPORT Standard_Real TextWidth() const;
90 //! returns height of text containment area of all strings in the note
91 Standard_EXPORT Standard_Real TextHeight() const;
93 //! returns Justification code of all strings within the note
94 //! 0 = no justification
95 //! 1 = right justified
96 //! 2 = center justified
97 //! 3 = left justified
98 Standard_EXPORT Standard_Integer JustifyCode() const;
100 //! returns Text containment area Location point
101 Standard_EXPORT gp_Pnt AreaLocation() const;
103 //! returns Text containment area Location point after Transformation
104 Standard_EXPORT gp_Pnt TransformedAreaLocation() const;
106 //! returns distance from the containment area plane
107 Standard_EXPORT Standard_Real ZDepthAreaLocation() const;
109 //! returns rotation angle of text containment area in radians
110 Standard_EXPORT Standard_Real AreaRotationAngle() const;
112 //! returns position of first base line
113 Standard_EXPORT gp_Pnt BaseLinePosition() const;
115 //! returns position of first base line after Transformation
116 Standard_EXPORT gp_Pnt TransformedBaseLinePosition() const;
118 //! returns distance from the Base line position plane
119 Standard_EXPORT Standard_Real ZDepthBaseLinePosition() const;
121 //! returns Normal Interline Spacing
122 Standard_EXPORT Standard_Real NormalInterlineSpace() const;
124 //! returns number of text HAsciiStrings
125 Standard_EXPORT Standard_Integer NbStrings() const;
127 //! returns Fixed/Variable width character display of string
130 //! raises exception if Index <= 0 or Index > NbStrings()
131 Standard_EXPORT Standard_Integer CharacterDisplay (const Standard_Integer Index) const;
133 //! returns False if Character display width is Fixed
134 //! optional method, if required
135 //! raises exception if Index <= 0 or Index > NbStrings()
136 Standard_EXPORT Standard_Boolean IsVariable (const Standard_Integer Index) const;
138 //! returns Character Width of string
139 //! raises exception if Index <= 0 or Index > NbStrings()
140 Standard_EXPORT Standard_Real CharacterWidth (const Standard_Integer Index) const;
142 //! returns Character Height of string
143 //! raises exception if Index <= 0 or Index > NbStrings()
144 Standard_EXPORT Standard_Real CharacterHeight (const Standard_Integer Index) const;
146 //! returns Inter-character spacing of string
147 //! raises exception if Index <= 0 or Index > NbStrings()
148 Standard_EXPORT Standard_Real InterCharacterSpace (const Standard_Integer Index) const;
150 //! returns Interline spacing of string
151 //! raises exception if Index <= 0 or Index > NbStrings()
152 Standard_EXPORT Standard_Real InterlineSpace (const Standard_Integer Index) const;
154 //! returns FontStyle of string
155 //! raises exception if Index <= 0 or Index > NbStrings()
156 Standard_EXPORT Standard_Integer FontStyle (const Standard_Integer Index) const;
158 //! returns CharacterAngle of string
159 //! Angle returned will be between 0 and 2PI
160 //! raises exception if Index <= 0 or Index > NbStrings()
161 Standard_EXPORT Standard_Real CharacterAngle (const Standard_Integer Index) const;
163 //! returns ControlCodeString of string
164 //! raises exception if Index <= 0 or Index > NbStrings()
165 Standard_EXPORT Handle(TCollection_HAsciiString) ControlCodeString (const Standard_Integer Index) const;
167 //! returns number of characters in string or zero
168 //! raises exception if Index <= 0 or Index > NbStrings()
169 Standard_EXPORT Standard_Integer NbCharacters (const Standard_Integer Index) const;
171 //! returns Box width of string
172 //! raises exception if Index <= 0 or Index > NbStrings()
173 Standard_EXPORT Standard_Real BoxWidth (const Standard_Integer Index) const;
175 //! returns Box height of string
176 //! raises exception if Index <= 0 or Index > NbStrings()
177 Standard_EXPORT Standard_Real BoxHeight (const Standard_Integer Index) const;
179 //! returns False if Value, True if Pointer (Entity)
180 //! raises exception if Index <= 0 or Index > NbStrings()
181 Standard_EXPORT Standard_Boolean IsCharSetEntity (const Standard_Integer Index) const;
183 //! returns Character Set Interpretation (default = 1) of string
184 //! returns 0 if IsCharSetEntity () is True
185 //! 1 = Standard ASCII
186 //! 1001 = Symbol Font1
187 //! 1002 = Symbol Font2
188 //! 1003 = Symbol Font3
189 //! raises exception if Index <= 0 or Index > NbStrings()
190 Standard_EXPORT Standard_Integer CharSetCode (const Standard_Integer Index) const;
192 //! returns Character Set Interpretation of string
193 //! returns a Null Handle if IsCharSetEntity () is False
194 //! raises exception if Index <= 0 or Index > NbStrings()
195 Standard_EXPORT Handle(IGESData_IGESEntity) CharSetEntity (const Standard_Integer Index) const;
197 //! returns Slant angle of string in radians
198 //! default value = PI/2
199 //! raises exception if Index <= 0 or Index > NbStrings()
200 Standard_EXPORT Standard_Real SlantAngle (const Standard_Integer Index) const;
202 //! returns Rotation angle of string in radians
203 //! raises exception if Index <= 0 or Index > NbStrings()
204 Standard_EXPORT Standard_Real RotationAngle (const Standard_Integer Index) const;
206 //! returns Mirror Flag of string
208 //! 1 = mirror axis is perpendicular to the text base line
209 //! 2 = mirror axis is text base line
210 //! raises exception if Index <= 0 or Index > NbStrings()
211 Standard_EXPORT Standard_Integer MirrorFlag (const Standard_Integer Index) const;
213 //! returns False if MirrorFlag = 0. ie. no mirroring
214 //! else returns True
215 //! raises exception if Index <= 0 or Index > NbStrings()
216 Standard_EXPORT Standard_Boolean IsMirrored (const Standard_Integer Index) const;
218 //! returns Rotate internal text Flag of string
219 //! 0 = text horizontal
220 //! 1 = text vertical
221 //! raises exception if Index <= 0 or Index > NbStrings()
222 Standard_EXPORT Standard_Integer RotateFlag (const Standard_Integer Index) const;
224 //! returns text start point of string
225 //! raises exception if Index <= 0 or Index > NbStrings()
226 Standard_EXPORT gp_Pnt StartPoint (const Standard_Integer Index) const;
228 //! returns text start point of string after Transformation
229 //! raises exception if Index <= 0 or Index > NbStrings()
230 Standard_EXPORT gp_Pnt TransformedStartPoint (const Standard_Integer Index) const;
232 //! returns distance from the start point plane
233 //! raises exception if Index <= 0 or Index > NbStrings()
234 Standard_EXPORT Standard_Real ZDepthStartPoint (const Standard_Integer Index) const;
236 //! returns text string
237 //! raises exception if Index <= 0 or Index > NbStrings()
238 Standard_EXPORT Handle(TCollection_HAsciiString) Text (const Standard_Integer Index) const;
243 DEFINE_STANDARD_RTTIEXT(IGESDimen_NewGeneralNote,IGESData_IGESEntity)
253 Standard_Real theWidth;
254 Standard_Real theHeight;
255 Standard_Integer theJustifyCode;
257 Standard_Real theAreaRotationAngle;
258 gp_XYZ theBaseLinePos;
259 Standard_Real theNormalInterlineSpace;
260 Handle(TColStd_HArray1OfInteger) theCharDisplays;
261 Handle(TColStd_HArray1OfReal) theCharWidths;
262 Handle(TColStd_HArray1OfReal) theCharHeights;
263 Handle(TColStd_HArray1OfReal) theInterCharSpaces;
264 Handle(TColStd_HArray1OfReal) theInterlineSpaces;
265 Handle(TColStd_HArray1OfInteger) theFontStyles;
266 Handle(TColStd_HArray1OfReal) theCharAngles;
267 Handle(Interface_HArray1OfHAsciiString) theControlCodeStrings;
268 Handle(TColStd_HArray1OfInteger) theNbChars;
269 Handle(TColStd_HArray1OfReal) theBoxWidths;
270 Handle(TColStd_HArray1OfReal) theBoxHeights;
271 Handle(TColStd_HArray1OfInteger) theCharSetCodes;
272 Handle(IGESData_HArray1OfIGESEntity) theCharSetEntities;
273 Handle(TColStd_HArray1OfReal) theSlantAngles;
274 Handle(TColStd_HArray1OfReal) theRotationAngles;
275 Handle(TColStd_HArray1OfInteger) theMirrorFlags;
276 Handle(TColStd_HArray1OfInteger) theRotateFlags;
277 Handle(TColgp_HArray1OfXYZ) theStartPoints;
278 Handle(Interface_HArray1OfHAsciiString) theTexts;
289 #endif // _IGESDimen_NewGeneralNote_HeaderFile