CommitLineData
7fd59977 1-- File: IGESConvGeom_GeomBuilder.cdl
2-- Created: Wed Nov 16 14:16:50 1994
3-- Author: Christian CAILLET
4-- <cky@stylox>
6
7
8class GeomBuilder from IGESConvGeom
9
10 ---Purpose : This class provides some useful basic tools to build IGESGeom
11 -- curves, especially :
12 -- define a curve in a plane in 3D space (ex. Circular or Conic
13 -- arc, or Copious Data defined in 2D)
14 -- make a CopiousData from a list of points/vectors
15
16uses XY from gp, XYZ from gp, Trsf, Ax1, Ax2, Ax3,
17 HSequenceOfXYZ, HArray1OfXY, HArray1OfXYZ,
18 TransformationMatrix, CopiousData
19
20raises DomainError
21
22is
23
24 Create returns GeomBuilder;
25 ---Purpose : Creates a GeomBuilder at initial state.
26
27 Clear (me : in out) is static;
28 ---Purpose : Clears list of Points/Vectors and data about Transformation
29
30 AddXY (me : in out; val : XY from gp) is static;
31 ---Purpose : Adds a XY (Z=0) to the list of points
32
33 AddXYZ (me : in out; val : XYZ from gp) is static;
34 ---Purpose : Adds a XYZ to the list of points
35
36 AddVec (me : in out; val : XYZ from gp) is static;
37 ---Purpose : Adds a Vector part to the list of points. It will be used
38 -- for CopiousData, datatype=3, only.
41
42 NbPoints (me) returns Integer is static;
43 ---Purpose : Returns the count of already recorded points
44
45 Point (me; num : Integer) returns XYZ is static;
46 ---Purpose : Returns a point given its rank (if added as XY, Z will be 0)
47
48 MakeCopiousData (me; datatype : Integer; polyline : Boolean = Standard_False)
49 returns mutable CopiousData
50 ---Purpose : Makes a CopiousData with the list of recorded Points/Vectors
51 -- according to <datatype>, which must be 1,2 or 3
52 -- If <polyline> is given True, the CopiousData is coded as a
53 -- Polyline, but <datatype> must not be 3
54 -- <datatype> = 1 : Common Z is computed as average of all Z
55 -- <datatype> = 1 or 2 : Vectors are ignored
56 raises DomainError;
57 -- Error if : <datatype> is not 1,2 or 3; or NbPoints is 0
58
59 MakeXY (me) returns mutable HArray1OfXY is static;
60 ---Purpose : Returns the list of points as a HArray1OfXY. Z are ignored.
61
62 MakeXYZ (me) returns mutable HArray1OfXYZ is static;
63 ---Purpose : Returns the list of points as a HArray1OfXYZ
64
65
66 Position (me) returns Trsf from gp is static;
67 ---Purpose : Returns the Position in which the method EvalXYZ will
68 -- evaluate a XYZ. It can be regarded as defining a local system.
69 -- It is initially set to Identity
70
71 SetPosition (me : in out; pos : Trsf from gp) is static;
72 ---Purpose : Sets final position from an already defined Trsf
73
74 SetPosition (me : in out; pos : Ax3 from gp) is static;
75 ---Purpose : Sets final position from an Ax3
76
77 SetPosition (me : in out; pos : Ax2 from gp) is static;
78 ---Purpose : Sets final position from an Ax2
79
80 SetPosition (me : in out; pos : Ax1 from gp) is static;
81 ---Purpose : Sets final position from an Ax1
82 -- (this means that origin point and Z-axis are defined, the
83 -- other axes are defined arbitrarily)
84
85 IsIdentity (me) returns Boolean is static;
86 ---Purpose : Returns True if the Position is Identity
87
88 IsTranslation (me) returns Boolean is static;
89 ---Purpose : Returns True if the Position is a Translation only
90 -- Remark : Identity and ZOnly will answer True
91
92 IsZOnly (me) returns Boolean is static;
93 ---Purpose : Returns True if the Position corresponds to a Z-Displacement,
94 -- i.e. is a Translation only, and only on Z
95 -- Remark : Identity will answer True
96
97 EvalXYZ (me; val : XYZ from gp; X,Y,Z : out Real) is static;
98 ---Purpose : Evaluates a XYZ value in the Position already defined.
99 -- Returns the transformed coordinates.
100 -- For a 2D definition, X,Y will then be used to define a XY and
101 -- Z will be regarded as a Z Displacement (can be ignored)
102
103 MakeTransformation (me; unit : Real = 1)
104 returns mutable TransformationMatrix is static;
105 ---Purpose : Returns the IGES Transformation which corresponds to the
106 -- Position. Even if it is an Identity : IsIdentity should be
107 -- tested first.
108 -- <unit> is the unit value in which the model is created :
109 -- it is used to convert translation part
110
111fields
112
113 theXYZ : HSequenceOfXYZ;
114 theVec : HSequenceOfXYZ;
115 thepos : Trsf from gp;
116
117end GeomBuilder;