summaryrefslogtreecommitdiff
path: root/src/IGESDimen/IGESDimen_NewGeneralNote.cxx
blob: e7db5170512e08c037949d1823b1cac9c916af50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
//--------------------------------------------------------------------
//
//  File Name : IGESDimen_NewGeneralNote.cxx
//  Date      :
//  Author    : CKY / Contract Toubro-Larsen
//  Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------

#include <IGESDimen_NewGeneralNote.ixx>
#include <gp_GTrsf.hxx>


    IGESDimen_NewGeneralNote::IGESDimen_NewGeneralNote ()    {  }


    void  IGESDimen_NewGeneralNote::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)
{
  Standard_Integer num = nbChars->Length();

  if ( nbChars->Lower()         != 1 ||
      (charDisplays->Lower()    != 1 || charDisplays->Length()    != num) ||
      (charWidths->Lower()      != 1 || charWidths->Length()      != num) ||
      (charHeights->Lower()     != 1 || charHeights->Length()     != num) ||
      (interCharSpc->Lower()    != 1 || interCharSpc->Length()    != num) ||
      (interLineSpc->Lower()    != 1 || interLineSpc->Length()    != num) ||
      (fontStyles->Lower()      != 1 || fontStyles->Length()      != num) ||
      (charAngles->Lower()      != 1 || charAngles->Length()      != num) ||
      (controlCodeStrings->Lower() != 1 || controlCodeStrings->Length() != num)||
      (boxWidths->Lower()       != 1 || boxWidths->Length()       != num) ||
      (boxHeights->Lower()      != 1 || boxHeights->Length()      != num) ||
      (charSetCodes->Lower()    != 1 || charSetCodes->Length()    != num) ||
      (charSetEntities->Lower() != 1 || charSetEntities->Length() != num) ||
      (slAngles->Lower()        != 1 || slAngles->Length()        != num) ||
      (rotAngles->Lower()       != 1 || rotAngles->Length()       != num) ||
      (mirrorFlags->Lower()     != 1 || mirrorFlags->Length()     != num) ||
      (rotateFlags->Lower()     != 1 || rotateFlags->Length()     != num) ||
      (startPoints->Lower()     != 1 || startPoints->Length()     != num) ||
      (texts->Lower()           != 1 || texts->Length() != num))
    Standard_DimensionMismatch::Raise("IGESDimen_GeneralNote : Init");

  theWidth                = width;
  theHeight               = height;
  theJustifyCode          = justifyCode;
  theAreaLoc              = areaLoc;
  theAreaRotationAngle    = areaRotationAngle;
  theBaseLinePos          = baseLinePos;
  theNormalInterlineSpace = normalInterlineSpace;
  theCharDisplays         = charDisplays;
  theCharWidths           = charWidths;
  theCharHeights          = charHeights;
  theInterCharSpaces      = interCharSpc;
  theInterlineSpaces      = interLineSpc;
  theFontStyles           = fontStyles;
  theCharAngles           = charAngles;
  theControlCodeStrings   = controlCodeStrings;
  theNbChars              = nbChars;
  theBoxWidths            = boxWidths;
  theBoxHeights           = boxHeights;
  theCharSetCodes         = charSetCodes;
  theCharSetEntities      = charSetEntities;
  theSlantAngles          = slAngles;
  theRotationAngles       = rotAngles;
  theMirrorFlags          = mirrorFlags;
  theRotateFlags          = rotateFlags;
  theStartPoints          = startPoints;
  theTexts                = texts;
  InitTypeAndForm(213,0);
}

    Standard_Real  IGESDimen_NewGeneralNote::TextWidth () const 
{
  return theWidth;
}

    Standard_Real  IGESDimen_NewGeneralNote::TextHeight () const 
{
  return theHeight;
}

    Standard_Integer  IGESDimen_NewGeneralNote::JustifyCode () const 
{
  return theJustifyCode;
}

    gp_Pnt  IGESDimen_NewGeneralNote::AreaLocation () const 
{
  gp_Pnt loc(theAreaLoc);
  return loc;
}

    gp_Pnt  IGESDimen_NewGeneralNote::TransformedAreaLocation () const 
{
  gp_XYZ tempXYZ = theAreaLoc;
  if (HasTransf()) Location().Transforms(tempXYZ);
  return gp_Pnt(tempXYZ);
}

    Standard_Real  IGESDimen_NewGeneralNote::ZDepthAreaLocation () const 
{
  return (theAreaLoc.Z());
}

    Standard_Real  IGESDimen_NewGeneralNote::AreaRotationAngle () const 
{
  return theAreaRotationAngle;
}

    gp_Pnt  IGESDimen_NewGeneralNote::BaseLinePosition () const 
{
  gp_Pnt pos(theBaseLinePos);
  return pos;
}

    gp_Pnt  IGESDimen_NewGeneralNote::TransformedBaseLinePosition () const 
{
  gp_XYZ tempXYZ = theBaseLinePos;
  if (HasTransf()) Location().Transforms(tempXYZ);
  return gp_Pnt(tempXYZ);
}

    Standard_Real  IGESDimen_NewGeneralNote::ZDepthBaseLinePosition () const 
{
  return (theBaseLinePos.Z());
}

    Standard_Real  IGESDimen_NewGeneralNote::NormalInterlineSpace () const 
{
  return theNormalInterlineSpace;
}

    Standard_Integer  IGESDimen_NewGeneralNote::NbStrings () const 
{
  return theCharDisplays->Length();
}

    Standard_Integer  IGESDimen_NewGeneralNote::CharacterDisplay
  (const Standard_Integer Index) const 
{
  return theCharDisplays->Value(Index);
}

    Standard_Boolean  IGESDimen_NewGeneralNote::IsVariable
  (const Standard_Integer Index) const 
{
  return (theCharDisplays->Value(Index) == 1); 
}

    Standard_Real  IGESDimen_NewGeneralNote::CharacterWidth
  (const Standard_Integer Index) const 
{
  return theCharWidths->Value(Index);
}

    Standard_Real  IGESDimen_NewGeneralNote::CharacterHeight
  (const Standard_Integer Index) const 
{
  return theCharHeights->Value(Index);
}

    Standard_Real  IGESDimen_NewGeneralNote::InterCharacterSpace
  (const Standard_Integer Index) const 
{
  return theInterCharSpaces->Value(Index);
}

    Standard_Real  IGESDimen_NewGeneralNote::InterlineSpace
  (const Standard_Integer Index) const 
{
  return theInterlineSpaces->Value(Index);
}

    Standard_Integer  IGESDimen_NewGeneralNote::FontStyle
  (const Standard_Integer Index) const 
{
  return theFontStyles->Value(Index);
}

    Standard_Real  IGESDimen_NewGeneralNote::CharacterAngle
  (const Standard_Integer Index) const 
{
  return theCharAngles->Value(Index);
}

    Handle(TCollection_HAsciiString)  IGESDimen_NewGeneralNote::ControlCodeString
  (const Standard_Integer Index) const 
{
  return theControlCodeStrings->Value(Index);
}

    Standard_Integer  IGESDimen_NewGeneralNote::NbCharacters
  (const Standard_Integer Index) const 
{
  return theNbChars->Value(Index);
}

    Standard_Real  IGESDimen_NewGeneralNote::BoxWidth
  (const Standard_Integer Index) const 
{
  return theBoxWidths->Value(Index);
}

    Standard_Real  IGESDimen_NewGeneralNote::BoxHeight
  (const Standard_Integer Index) const 
{
  return theBoxHeights->Value(Index);
}

    Standard_Boolean  IGESDimen_NewGeneralNote::IsCharSetEntity
  (const Standard_Integer Index) const 
{
  return (! (theCharSetEntities->Value(Index)).IsNull());
}

    Standard_Integer  IGESDimen_NewGeneralNote::CharSetCode
  (const Standard_Integer Index) const 
{
  return theCharSetCodes->Value(Index);
}

    Handle(IGESData_IGESEntity)  IGESDimen_NewGeneralNote::CharSetEntity
  (const Standard_Integer Index) const 
{
  return theCharSetEntities->Value(Index);
}

    Standard_Real  IGESDimen_NewGeneralNote::SlantAngle
  (const Standard_Integer Index) const 
{
  return theSlantAngles->Value(Index);
}

    Standard_Real  IGESDimen_NewGeneralNote::RotationAngle
  (const Standard_Integer Index) const 
{
  return theRotationAngles->Value(Index);
}

    Standard_Integer  IGESDimen_NewGeneralNote::MirrorFlag
  (const Standard_Integer Index) const 
{
  return theMirrorFlags->Value(Index);
}

    Standard_Boolean  IGESDimen_NewGeneralNote::IsMirrored
  (const Standard_Integer Index) const 
{
  return (! theMirrorFlags->Value(Index) == 0);
}

    Standard_Integer  IGESDimen_NewGeneralNote::RotateFlag
  (const Standard_Integer Index) const 
{
  return theRotateFlags->Value(Index);
}

    gp_Pnt  IGESDimen_NewGeneralNote::StartPoint
  (const Standard_Integer Index) const 
{
  return gp_Pnt(theStartPoints->Value(Index));
}

    gp_Pnt  IGESDimen_NewGeneralNote::TransformedStartPoint
  (const Standard_Integer Index) const 
{
  gp_XYZ tempXYZ = theStartPoints->Value(Index);
  if (HasTransf()) Location().Transforms(tempXYZ);
  return gp_Pnt(tempXYZ);
}

    Standard_Real  IGESDimen_NewGeneralNote::ZDepthStartPoint
  (const Standard_Integer Index) const 
{
  return (theStartPoints->Value(Index).Z());
}

    Handle(TCollection_HAsciiString)  IGESDimen_NewGeneralNote::Text
  (const Standard_Integer Index) const 
{
  return theTexts->Value(Index);
}