summaryrefslogtreecommitdiff
path: root/inc/IGESConvGeom_GeomBuilder.hxx
blob: bf29579303d809f4de318a9c90919f24eadcbfce (plain)
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
165
166
167
168
169
// This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to 
// this header file considered to be the "object code" form of the original source.

#ifndef _IGESConvGeom_GeomBuilder_HeaderFile
#define _IGESConvGeom_GeomBuilder_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif

#ifndef _Handle_TColgp_HSequenceOfXYZ_HeaderFile
#include <Handle_TColgp_HSequenceOfXYZ.hxx>
#endif
#ifndef _gp_Trsf_HeaderFile
#include <gp_Trsf.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Handle_IGESGeom_CopiousData_HeaderFile
#include <Handle_IGESGeom_CopiousData.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Handle_TColgp_HArray1OfXY_HeaderFile
#include <Handle_TColgp_HArray1OfXY.hxx>
#endif
#ifndef _Handle_TColgp_HArray1OfXYZ_HeaderFile
#include <Handle_TColgp_HArray1OfXYZ.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _Handle_IGESGeom_TransformationMatrix_HeaderFile
#include <Handle_IGESGeom_TransformationMatrix.hxx>
#endif
class TColgp_HSequenceOfXYZ;
class Standard_DomainError;
class gp_XY;
class gp_XYZ;
class IGESGeom_CopiousData;
class TColgp_HArray1OfXY;
class TColgp_HArray1OfXYZ;
class gp_Trsf;
class gp_Ax3;
class gp_Ax2;
class gp_Ax1;
class IGESGeom_TransformationMatrix;


//! This class provides some useful basic tools to build IGESGeom <br>
//!           curves, especially : <br>
//!           define a curve in a plane in 3D space (ex. Circular or Conic <br>
//!             arc, or Copious Data defined in 2D) <br>
//!           make a CopiousData from a list of points/vectors <br>
class IGESConvGeom_GeomBuilder  {
public:

  void* operator new(size_t,void* anAddress) 
  {
    return anAddress;
  }
  void* operator new(size_t size) 
  {
    return Standard::Allocate(size); 
  }
  void  operator delete(void *anAddress) 
  {
    if (anAddress) Standard::Free((Standard_Address&)anAddress); 
  }

  //! Creates a GeomBuilder at initial state. <br>
  Standard_EXPORT   IGESConvGeom_GeomBuilder();
  //! Clears list of Points/Vectors and data about Transformation <br>
  Standard_EXPORT     void Clear() ;
  //! Adds a XY (Z=0) to the list of points <br>
  Standard_EXPORT     void AddXY(const gp_XY& val) ;
  //! Adds a XYZ to the list of points <br>
  Standard_EXPORT     void AddXYZ(const gp_XYZ& val) ;
  //! Adds a Vector part to the list of points. It will be used <br>
//!           for CopiousData, datatype=3, only. <br>
//!           AddXY and AddXYZ consider a null vector part (0,0,0) <br>
//!           AddVec adds to the last added XY or XYZ <br>
  Standard_EXPORT     void AddVec(const gp_XYZ& val) ;
  //! Returns the count of already recorded points <br>
  Standard_EXPORT     Standard_Integer NbPoints() const;
  //! Returns a point given its rank (if added as XY, Z will be 0) <br>
  Standard_EXPORT     gp_XYZ Point(const Standard_Integer num) const;
  //! Makes a CopiousData with the list of recorded Points/Vectors <br>
//!           according to <datatype>, which must be 1,2 or 3 <br>
//!           If <polyline> is given True, the CopiousData is coded as a <br>
//!           Polyline, but <datatype> must not be 3 <br>
//!           <datatype> = 1 : Common Z is computed as average of all Z <br>
//!           <datatype> = 1 or 2 : Vectors are ignored <br>
  Standard_EXPORT     Handle_IGESGeom_CopiousData MakeCopiousData(const Standard_Integer datatype,const Standard_Boolean polyline = Standard_False) const;
  //! Returns the list of points as a HArray1OfXY. Z are ignored. <br>
  Standard_EXPORT     Handle_TColgp_HArray1OfXY MakeXY() const;
  //! Returns the list of points as a HArray1OfXYZ <br>
  Standard_EXPORT     Handle_TColgp_HArray1OfXYZ MakeXYZ() const;
  //! Returns the Position in which the method EvalXYZ will <br>
//!           evaluate a XYZ. It can be regarded as defining a local system. <br>
//!           It is initially set to Identity <br>
  Standard_EXPORT     gp_Trsf Position() const;
  //! Sets final position from an already defined Trsf <br>
  Standard_EXPORT     void SetPosition(const gp_Trsf& pos) ;
  //! Sets final position from an Ax3 <br>
  Standard_EXPORT     void SetPosition(const gp_Ax3& pos) ;
  //! Sets final position from an Ax2 <br>
  Standard_EXPORT     void SetPosition(const gp_Ax2& pos) ;
  //! Sets final position from an Ax1 <br>
//!           (this means that origin point and Z-axis are defined, the <br>
//!           other axes are defined arbitrarily) <br>
  Standard_EXPORT     void SetPosition(const gp_Ax1& pos) ;
  //! Returns True if the Position is Identity <br>
  Standard_EXPORT     Standard_Boolean IsIdentity() const;
  //! Returns True if the Position is a Translation only <br>
//!           Remark : Identity and ZOnly will answer True <br>
  Standard_EXPORT     Standard_Boolean IsTranslation() const;
  //! Returns True if the Position corresponds to a Z-Displacement, <br>
//!           i.e. is a Translation only, and only on Z <br>
//!           Remark : Identity will answer True <br>
  Standard_EXPORT     Standard_Boolean IsZOnly() const;
  //! Evaluates a XYZ value in the Position already defined. <br>
//!           Returns the transformed coordinates. <br>
//!           For a 2D definition, X,Y will then be used to define a XY and <br>
//!           Z will be regarded as a Z Displacement (can be ignored) <br>
  Standard_EXPORT     void EvalXYZ(const gp_XYZ& val,Standard_Real& X,Standard_Real& Y,Standard_Real& Z) const;
  //! Returns the IGES Transformation which corresponds to the <br>
//!           Position. Even if it is an Identity : IsIdentity should be <br>
//!           tested first. <br>
//!           <unit> is the unit value in which the model is created : <br>
//!             it is used to convert translation part <br>
  Standard_EXPORT     Handle_IGESGeom_TransformationMatrix MakeTransformation(const Standard_Real unit = 1) const;





protected:





private:



Handle_TColgp_HSequenceOfXYZ theXYZ;
Handle_TColgp_HSequenceOfXYZ theVec;
gp_Trsf thepos;


};





// other Inline functions and methods (like "C++: function call" methods)


#endif