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