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
|
//--------------------------------------------------------------------
//
// File Name : IGESDimen_GeneralNote.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDimen_GeneralNote.ixx>
#include <Standard_OutOfRange.hxx>
#include <gp_GTrsf.hxx>
IGESDimen_GeneralNote::IGESDimen_GeneralNote () { }
void IGESDimen_GeneralNote::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)
{
Standard_Integer num = nbChars->Length();
if ( nbChars->Lower() != 1 ||
(widths->Lower() != 1 || widths->Length() != num) ||
(heights->Lower() != 1 || heights->Length() != num) ||
(fontCodes->Lower() != 1 || fontCodes->Length() != num) ||
(fonts->Lower() != 1 || fonts->Length() != num) ||
(slants->Lower() != 1 || slants->Length() != num) ||
(rotations->Lower() != 1 || rotations->Length() != num) ||
(mirrorFlags->Lower() != 1 || mirrorFlags->Length() != num) ||
(rotFlags->Lower() != 1 || rotFlags->Length() != num) ||
(start->Lower() != 1 || start->Length() != num) ||
(texts->Lower() != 1 || texts->Length() != num) )
Standard_DimensionMismatch::Raise("IGESDimen_GeneralNote : Init");
theNbChars = nbChars;
theBoxWidths = widths;
theBoxHeights = heights;
theFontCodes = fontCodes;
theFontEntities = fonts;
theSlantAngles = slants;
theRotationAngles = rotations;
theMirrorFlags = mirrorFlags;
theRotateFlags = rotFlags;
theStartPoints = start;
theTexts = texts;
InitTypeAndForm(212,FormNumber());
// FormNumber for Graphical Representation
}
void IGESDimen_GeneralNote::SetFormNumber (const Standard_Integer form)
{
if ((form < 0 || form > 8) && (form < 100 || form > 102) && form != 105)
Standard_OutOfRange::Raise("IGESDimen_GeneralNote : SetFormNumber");
InitTypeAndForm(212,form);
}
Standard_Integer IGESDimen_GeneralNote::NbStrings () const
{
return theNbChars->Length();
}
Standard_Integer IGESDimen_GeneralNote::NbCharacters
(const Standard_Integer Index) const
{
return theNbChars->Value(Index);
}
Standard_Real IGESDimen_GeneralNote::BoxWidth
(const Standard_Integer Index) const
{
return theBoxWidths->Value(Index);
}
Standard_Real IGESDimen_GeneralNote::BoxHeight
(const Standard_Integer Index) const
{
return theBoxHeights->Value(Index);
}
Standard_Boolean IGESDimen_GeneralNote::IsFontEntity
(const Standard_Integer Index) const
{
return (! (theFontEntities->Value(Index)).IsNull());
}
Standard_Integer IGESDimen_GeneralNote::FontCode
(const Standard_Integer Index) const
{
return theFontCodes->Value(Index);
}
Handle(IGESGraph_TextFontDef) IGESDimen_GeneralNote::FontEntity
(const Standard_Integer Index) const
{
return theFontEntities->Value(Index);
}
Standard_Real IGESDimen_GeneralNote::SlantAngle
(const Standard_Integer Index) const
{
return theSlantAngles->Value(Index);
}
Standard_Real IGESDimen_GeneralNote::RotationAngle
(const Standard_Integer Index) const
{
return theRotationAngles->Value(Index);
}
Standard_Integer IGESDimen_GeneralNote::MirrorFlag
(const Standard_Integer Index) const
{
return theMirrorFlags->Value(Index);
}
Standard_Integer IGESDimen_GeneralNote::RotateFlag
(const Standard_Integer Index) const
{
return theRotateFlags->Value(Index);
}
gp_Pnt IGESDimen_GeneralNote::StartPoint
(const Standard_Integer Index) const
{
gp_Pnt point(theStartPoints->Value(Index));
return point;
}
gp_Pnt IGESDimen_GeneralNote::TransformedStartPoint
(const Standard_Integer Index) const
{
gp_XYZ point = (theStartPoints->Value(Index));
if (HasTransf()) Location().Transforms(point);
return gp_Pnt(point);
}
Standard_Real IGESDimen_GeneralNote::ZDepthStartPoint
(const Standard_Integer Index) const
{
return ((theStartPoints->Value(Index)).Z());
}
Handle(TCollection_HAsciiString) IGESDimen_GeneralNote::Text
(const Standard_Integer Index) const
{
return theTexts->Value(Index);
}
|