Warnings on vc14 were eliminated
[occt.git] / src / IGESDimen / IGESDimen_GeneralNote.hxx
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
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _IGESDimen_GeneralNote_HeaderFile
18 #define _IGESDimen_GeneralNote_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <TColStd_HArray1OfInteger.hxx>
24 #include <TColStd_HArray1OfReal.hxx>
25 #include <IGESGraph_HArray1OfTextFontDef.hxx>
26 #include <TColgp_HArray1OfXYZ.hxx>
27 #include <Interface_HArray1OfHAsciiString.hxx>
28 #include <IGESData_IGESEntity.hxx>
29 #include <Standard_Integer.hxx>
30 #include <Standard_Real.hxx>
31 #include <Standard_Boolean.hxx>
32 class Standard_DimensionMismatch;
33 class Standard_OutOfRange;
34 class IGESGraph_TextFontDef;
35 class gp_Pnt;
36 class TCollection_HAsciiString;
37
38
39 class IGESDimen_GeneralNote;
40 DEFINE_STANDARD_HANDLE(IGESDimen_GeneralNote, IGESData_IGESEntity)
41
42 //! defines GeneralNote, Type <212> Form <0-8, 100-200, 105>
43 //! in package IGESDimen
44 //! Used for formatting boxed text in different ways
45 class IGESDimen_GeneralNote : public IGESData_IGESEntity
46 {
47
48 public:
49
50   
51   Standard_EXPORT IGESDimen_GeneralNote();
52   
53   //! This method is used to set the fields of the class
54   //! GeneralNote
55   //! - nNbChars      : number of chars strings
56   //! - widths        : Box widths
57   //! - heights       : Box heights
58   //! - fontCodes     : Font codes, default = 1
59   //! - fonts         : Text Font Definition Entities
60   //! - slants        : Slant angles in radians
61   //! - rotations     : Rotation angles in radians
62   //! - mirrorFlags   : Mirror flags
63   //! - rotFlags      : Rotation internal text flags
64   //! - start         : Text start points
65   //! - texts         : Text strings
66   //! raises exception if there is mismatch between the various
67   //! Array Lengths.
68   Standard_EXPORT void Init (const Handle(TColStd_HArray1OfInteger)& nbChars, const Handle(TColStd_HArray1OfReal)& widths, const Handle(TColStd_HArray1OfReal)& heights, const Handle(TColStd_HArray1OfInteger)& fontCodes, const Handle(IGESGraph_HArray1OfTextFontDef)& fonts, const Handle(TColStd_HArray1OfReal)& slants, const Handle(TColStd_HArray1OfReal)& rotations, const Handle(TColStd_HArray1OfInteger)& mirrorFlags, const Handle(TColStd_HArray1OfInteger)& rotFlags, const Handle(TColgp_HArray1OfXYZ)& start, const Handle(Interface_HArray1OfHAsciiString)& texts);
69   
70   //! Changes FormNumber (indicates Graphical Representation)
71   //! Error if not in ranges [0-8] or [100-102] or 105
72   Standard_EXPORT void SetFormNumber (const Standard_Integer form);
73   
74   //! returns number of text strings in General Note
75   Standard_EXPORT Standard_Integer NbStrings() const;
76   
77   //! returns number of characters of string or zero
78   //! raises exception if Index <= 0 or Index > NbStrings()
79   Standard_EXPORT Standard_Integer NbCharacters (const Standard_Integer Index) const;
80   
81   //! returns Box width of string
82   //! raises exception if Index <= 0 or Index > NbStrings()
83   Standard_EXPORT Standard_Real BoxWidth (const Standard_Integer Index) const;
84   
85   //! returns Box height of string
86   //! raises exception if Index <= 0 or Index > NbStrings()
87   Standard_EXPORT Standard_Real BoxHeight (const Standard_Integer Index) const;
88   
89   //! returns False if Value, True if Entity
90   //! raises exception if Index <= 0 or Index > NbStrings()
91   Standard_EXPORT Standard_Boolean IsFontEntity (const Standard_Integer Index) const;
92   
93   //! returns Font code (default = 1) of string
94   //! returns 0 if IsFontEntity () is True
95   //! raises exception if Index <= 0 or Index > NbStrings()
96   Standard_EXPORT Standard_Integer FontCode (const Standard_Integer Index) const;
97   
98   //! returns Text Font Definition Entity of string
99   //! returns a Null Handle if IsFontEntity () returns False
100   //! raises exception if Index <= 0 or Index > NbStrings()
101   Standard_EXPORT Handle(IGESGraph_TextFontDef) FontEntity (const Standard_Integer Index) const;
102   
103   //! returns Slant angle of string in radians
104   //! default value = PI/2
105   //! raises exception if Index <= 0 or Index > NbStrings()
106   Standard_EXPORT Standard_Real SlantAngle (const Standard_Integer Index) const;
107   
108   //! returns Rotation angle of string in radians
109   //! raises exception if Index <= 0 or Index > NbStrings()
110   Standard_EXPORT Standard_Real RotationAngle (const Standard_Integer Index) const;
111   
112   //! returns Mirror Flag of string
113   //! 0 = no mirroring
114   //! 1 = mirror axis is perpendicular to the text base line
115   //! 2 = mirror axis is text base line
116   //! raises exception if Index <= 0 or Index > NbStrings()
117   Standard_EXPORT Standard_Integer MirrorFlag (const Standard_Integer Index) const;
118   
119   //! returns Rotate internal text Flag of string
120   //! 0 = text horizontal
121   //! 1 = text vertical
122   //! raises exception if Index <= 0 or Index > NbStrings()
123   Standard_EXPORT Standard_Integer RotateFlag (const Standard_Integer Index) const;
124   
125   //! returns text start point of Index'th string
126   //! raises exception if Index <= 0 or Index > NbStrings()
127   Standard_EXPORT gp_Pnt StartPoint (const Standard_Integer Index) const;
128   
129   //! returns text start point of Index'th string after Transformation
130   //! raises exception if Index <= 0 or Index > NbStrings()
131   Standard_EXPORT gp_Pnt TransformedStartPoint (const Standard_Integer Index) const;
132   
133   //! returns distance from Start Point plane of string
134   //! raises exception if Index <= 0 or Index > NbStrings()
135   Standard_EXPORT Standard_Real ZDepthStartPoint (const Standard_Integer Index) const;
136   
137   //! returns text string
138   //! raises exception if Index <= 0 or Index > NbStrings()
139   Standard_EXPORT Handle(TCollection_HAsciiString) Text (const Standard_Integer Index) const;
140
141
142
143
144   DEFINE_STANDARD_RTTIEXT(IGESDimen_GeneralNote,IGESData_IGESEntity)
145
146 protected:
147
148
149
150
151 private:
152
153
154   Handle(TColStd_HArray1OfInteger) theNbChars;
155   Handle(TColStd_HArray1OfReal) theBoxWidths;
156   Handle(TColStd_HArray1OfReal) theBoxHeights;
157   Handle(TColStd_HArray1OfInteger) theFontCodes;
158   Handle(IGESGraph_HArray1OfTextFontDef) theFontEntities;
159   Handle(TColStd_HArray1OfReal) theSlantAngles;
160   Handle(TColStd_HArray1OfReal) theRotationAngles;
161   Handle(TColStd_HArray1OfInteger) theMirrorFlags;
162   Handle(TColStd_HArray1OfInteger) theRotateFlags;
163   Handle(TColgp_HArray1OfXYZ) theStartPoints;
164   Handle(Interface_HArray1OfHAsciiString) theTexts;
165
166
167 };
168
169
170
171
172
173
174
175 #endif // _IGESDimen_GeneralNote_HeaderFile