1 -- Created on: 1994-11-16
2 -- Created by: Christian CAILLET
3 -- Copyright (c) 1994-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
23 class GeomBuilder from IGESConvGeom
25 ---Purpose : This class provides some useful basic tools to build IGESGeom
26 -- curves, especially :
27 -- define a curve in a plane in 3D space (ex. Circular or Conic
28 -- arc, or Copious Data defined in 2D)
29 -- make a CopiousData from a list of points/vectors
31 uses XY from gp, XYZ from gp, Trsf, Ax1, Ax2, Ax3,
32 HSequenceOfXYZ, HArray1OfXY, HArray1OfXYZ,
33 TransformationMatrix, CopiousData
39 Create returns GeomBuilder;
40 ---Purpose : Creates a GeomBuilder at initial state.
42 Clear (me : in out) is static;
43 ---Purpose : Clears list of Points/Vectors and data about Transformation
45 AddXY (me : in out; val : XY from gp) is static;
46 ---Purpose : Adds a XY (Z=0) to the list of points
48 AddXYZ (me : in out; val : XYZ from gp) is static;
49 ---Purpose : Adds a XYZ to the list of points
51 AddVec (me : in out; val : XYZ from gp) is static;
52 ---Purpose : Adds a Vector part to the list of points. It will be used
53 -- for CopiousData, datatype=3, only.
54 -- AddXY and AddXYZ consider a null vector part (0,0,0)
55 -- AddVec adds to the last added XY or XYZ
57 NbPoints (me) returns Integer is static;
58 ---Purpose : Returns the count of already recorded points
60 Point (me; num : Integer) returns XYZ is static;
61 ---Purpose : Returns a point given its rank (if added as XY, Z will be 0)
63 MakeCopiousData (me; datatype : Integer; polyline : Boolean = Standard_False)
64 returns mutable CopiousData
65 ---Purpose : Makes a CopiousData with the list of recorded Points/Vectors
66 -- according to <datatype>, which must be 1,2 or 3
67 -- If <polyline> is given True, the CopiousData is coded as a
68 -- Polyline, but <datatype> must not be 3
69 -- <datatype> = 1 : Common Z is computed as average of all Z
70 -- <datatype> = 1 or 2 : Vectors are ignored
72 -- Error if : <datatype> is not 1,2 or 3; or NbPoints is 0
74 MakeXY (me) returns mutable HArray1OfXY is static;
75 ---Purpose : Returns the list of points as a HArray1OfXY. Z are ignored.
77 MakeXYZ (me) returns mutable HArray1OfXYZ is static;
78 ---Purpose : Returns the list of points as a HArray1OfXYZ
81 Position (me) returns Trsf from gp is static;
82 ---Purpose : Returns the Position in which the method EvalXYZ will
83 -- evaluate a XYZ. It can be regarded as defining a local system.
84 -- It is initially set to Identity
86 SetPosition (me : in out; pos : Trsf from gp) is static;
87 ---Purpose : Sets final position from an already defined Trsf
89 SetPosition (me : in out; pos : Ax3 from gp) is static;
90 ---Purpose : Sets final position from an Ax3
92 SetPosition (me : in out; pos : Ax2 from gp) is static;
93 ---Purpose : Sets final position from an Ax2
95 SetPosition (me : in out; pos : Ax1 from gp) is static;
96 ---Purpose : Sets final position from an Ax1
97 -- (this means that origin point and Z-axis are defined, the
98 -- other axes are defined arbitrarily)
100 IsIdentity (me) returns Boolean is static;
101 ---Purpose : Returns True if the Position is Identity
103 IsTranslation (me) returns Boolean is static;
104 ---Purpose : Returns True if the Position is a Translation only
105 -- Remark : Identity and ZOnly will answer True
107 IsZOnly (me) returns Boolean is static;
108 ---Purpose : Returns True if the Position corresponds to a Z-Displacement,
109 -- i.e. is a Translation only, and only on Z
110 -- Remark : Identity will answer True
112 EvalXYZ (me; val : XYZ from gp; X,Y,Z : out Real) is static;
113 ---Purpose : Evaluates a XYZ value in the Position already defined.
114 -- Returns the transformed coordinates.
115 -- For a 2D definition, X,Y will then be used to define a XY and
116 -- Z will be regarded as a Z Displacement (can be ignored)
118 MakeTransformation (me; unit : Real = 1)
119 returns mutable TransformationMatrix is static;
120 ---Purpose : Returns the IGES Transformation which corresponds to the
121 -- Position. Even if it is an Identity : IsIdentity should be
123 -- <unit> is the unit value in which the model is created :
124 -- it is used to convert translation part
128 theXYZ : HSequenceOfXYZ;
129 theVec : HSequenceOfXYZ;
130 thepos : Trsf from gp;