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
|
//--------------------------------------------------------------------
//
// File Name : IGESSolid_ConeFrustum.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESSolid_ToolConeFrustum.ixx>
#include <IGESData_ParamCursor.hxx>
#include <gp_XYZ.hxx>
#include <gp_Pnt.hxx>
#include <gp_Dir.hxx>
#include <IGESData_Dump.hxx>
IGESSolid_ToolConeFrustum::IGESSolid_ToolConeFrustum () { }
void IGESSolid_ToolConeFrustum::ReadOwnParams
(const Handle(IGESSolid_ConeFrustum)& ent,
const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const
{
Standard_Real tempHeight, tempR1, tempR2, tempreal;
gp_XYZ tempCenter, tempAxis;
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
PR.ReadReal(PR.Current(), "Height", tempHeight); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadReal(PR.Current(), "Larger face radius", tempR1); //szv#4:S4163:12Mar99 `st=` not needed
if (PR.DefinedElseSkip())
PR.ReadReal(PR.Current(), "Smaller face radius", tempR2); //szv#4:S4163:12Mar99 `st=` not needed
else
tempR2 = 0.0;
if (PR.DefinedElseSkip())
{
//st = PR.ReadReal(PR.Current(), "Face center (X)", tempreal); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadReal(PR.Current(), "Face center (X)", tempreal))
tempCenter.SetX(tempreal);
}
else tempCenter.SetX(0.0);
if (PR.DefinedElseSkip())
{
//st = PR.ReadReal(PR.Current(), "Face center (Y)", tempreal); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadReal(PR.Current(), "Face center (Y)", tempreal))
tempCenter.SetY(tempreal);
}
else tempCenter.SetY(0.0);
if (PR.DefinedElseSkip())
{
//st = PR.ReadReal(PR.Current(), "Face center (Z)", tempreal); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadReal(PR.Current(), "Face center (Z)", tempreal))
tempCenter.SetZ(tempreal);
}
else tempCenter.SetZ(0.0);
if (PR.DefinedElseSkip())
{
//st = PR.ReadReal(PR.Current(), "Axis direction (I)", tempreal); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadReal(PR.Current(), "Axis direction (I)", tempreal))
tempAxis.SetX(tempreal);
}
else tempAxis.SetX(0.0);
if (PR.DefinedElseSkip())
{
//st = PR.ReadReal(PR.Current(), "Axis direction (J)", tempreal); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadReal(PR.Current(), "Axis direction (J)", tempreal))
tempAxis.SetY(tempreal);
}
else tempAxis.SetY(0.0);
if (PR.DefinedElseSkip())
{
//st = PR.ReadReal(PR.Current(), "Axis direction (K)", tempreal); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadReal(PR.Current(), "Axis direction (K)", tempreal))
tempAxis.SetZ(tempreal);
}
else tempAxis.SetZ(1.0);
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init
(tempHeight, tempR1, tempR2, tempCenter, tempAxis);
Standard_Real eps = 1.E-05;
if (!tempAxis.IsEqual(ent->Axis().XYZ(),eps)) PR.AddWarning
("Axis poorly unitary, normalized");
}
void IGESSolid_ToolConeFrustum::WriteOwnParams
(const Handle(IGESSolid_ConeFrustum)& ent, IGESData_IGESWriter& IW) const
{
IW.Send(ent->Height());
IW.Send(ent->LargerRadius());
IW.Send(ent->SmallerRadius());
IW.Send(ent->FaceCenter().X());
IW.Send(ent->FaceCenter().Y());
IW.Send(ent->FaceCenter().Z());
IW.Send(ent->Axis().X());
IW.Send(ent->Axis().Y());
IW.Send(ent->Axis().Z());
}
void IGESSolid_ToolConeFrustum::OwnShared
(const Handle(IGESSolid_ConeFrustum)& /* ent */, Interface_EntityIterator& /* iter */) const
{
}
void IGESSolid_ToolConeFrustum::OwnCopy
(const Handle(IGESSolid_ConeFrustum)& another,
const Handle(IGESSolid_ConeFrustum)& ent, Interface_CopyTool& /* TC */) const
{
ent->Init
(another->Height(), another->LargerRadius(), another->SmallerRadius(),
another->FaceCenter().XYZ(), another->Axis().XYZ());
}
IGESData_DirChecker IGESSolid_ToolConeFrustum::DirChecker
(const Handle(IGESSolid_ConeFrustum)& /* ent */ ) const
{
IGESData_DirChecker DC(156, 0);
DC.Structure (IGESData_DefVoid);
DC.LineFont (IGESData_DefAny);
DC.Color (IGESData_DefAny);
DC.UseFlagRequired (0);
DC.HierarchyStatusIgnored ();
return DC;
}
void IGESSolid_ToolConeFrustum::OwnCheck
(const Handle(IGESSolid_ConeFrustum)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
if (ent->Height() <= 0.0)
ach->AddFail("Height : Value Not Positive");
if (ent->LargerRadius() <= 0.0)
ach->AddFail("Larger face radius : Value Not Positive");
if (ent->SmallerRadius() < 0.0)
ach->AddFail("Smaller face radius : Value Not Positive");
if (ent->SmallerRadius() > ent->LargerRadius())
ach->AddFail("Smaller face radius : is greater than Larger face radius");
}
void IGESSolid_ToolConeFrustum::OwnDump
(const Handle(IGESSolid_ConeFrustum)& ent, const IGESData_IGESDumper& /* dumper */,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
S << "IGESSolid_ConeFrustum" << endl;
S << "Height : " << ent->Height() << " ";
S << "Larger face Radius : " << ent->LargerRadius() << " ";
S << "Smaller face Radius : " << ent->SmallerRadius() << endl;
S << "Face Center : ";
IGESData_DumpXYZL(S,level, ent->FaceCenter(), ent->Location());
S << endl << "Axis : ";
IGESData_DumpXYZL(S,level, ent->Axis(), ent->VectorLocation());
S << endl;
}
|