summaryrefslogtreecommitdiff
path: root/inc/IntTools_Context.hxx
blob: 7868e10e01aae2443b4542ce9f29eca804810bb7 (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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
// 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 _IntTools_Context_HeaderFile
#define _IntTools_Context_HeaderFile

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

#ifndef _TopTools_IndexedDataMapOfShapeAddress_HeaderFile
#include <TopTools_IndexedDataMapOfShapeAddress.hxx>
#endif
#ifndef _IntTools_IndexedDataMapOfTransientAddress_HeaderFile
#include <IntTools_IndexedDataMapOfTransientAddress.hxx>
#endif
#ifndef _Handle_Geom_Curve_HeaderFile
#include <Handle_Geom_Curve.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _TopAbs_State_HeaderFile
#include <TopAbs_State.hxx>
#endif
class IntTools_FClass2d;
class TopoDS_Face;
class GeomAPI_ProjectPointOnSurf;
class GeomAPI_ProjectPointOnCurve;
class TopoDS_Edge;
class Geom_Curve;
class IntTools_SurfaceRangeLocalizeData;
class BRepClass3d_SolidClassifier;
class TopoDS_Solid;
class TopoDS_Vertex;
class gp_Pnt2d;
class gp_Pnt;
class IntTools_Curve;



//! The class is to provide direct access <br>
//! to the frequently using objects like <br>
//! IntTools_FClass2d, <br>
//! GeomAPI_ProjectPointOnSurf,  etc. <br>
//! The instance of the class allows to avoid repeated <br>
//! computations by mapping internal objects in the <br>
//!  instance. <br>
class IntTools_Context  {
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); 
  }

  
//! Empty constructor <br>
  Standard_EXPORT   IntTools_Context();
Standard_EXPORT virtual ~IntTools_Context();
  
//! Returns a reference to point classifier <br>
//! for given face <br>
  Standard_EXPORT     IntTools_FClass2d& FClass2d(const TopoDS_Face& aF) ;
  
//! Returns a reference to point projector <br>
//! for given face <br>
  Standard_EXPORT     GeomAPI_ProjectPointOnSurf& ProjPS(const TopoDS_Face& aF) ;
  
//! Returns a reference to point projector <br>
//! for given edge <br>
  Standard_EXPORT     GeomAPI_ProjectPointOnCurve& ProjPC(const TopoDS_Edge& aE) ;
  
//! Returns a reference to point projector <br>
//! for given curve <br>
  Standard_EXPORT     GeomAPI_ProjectPointOnCurve& ProjPT(const Handle(Geom_Curve)& aC) ;
  
//! Returns a reference to surface localization data <br>
//! for given face <br>
  Standard_EXPORT     IntTools_SurfaceRangeLocalizeData& SurfaceData(const TopoDS_Face& aF) ;
  
//! Returns a reference to solid classifier <br>
//! for given solid <br>
  Standard_EXPORT     BRepClass3d_SolidClassifier& SolidClassifier(const TopoDS_Solid& aSolid) ;
  
//! Computes parameter of the vertex aV on <br>
//! the edge aE. <br>
//! Returns zero if the distance between vertex <br>
//! and edge is less than sum of tolerances, <br>
//! otherwise and for following conditions returns <br>
//! negative value <br>
//! 1. the edge is degenerated (-1) <br>
//! 2. the edge does not contain 3d curve and pcurves (-2) <br>
//! 3. projection algorithm failed (-3) <br>
  Standard_EXPORT     Standard_Integer ComputeVE(const TopoDS_Vertex& aV,const TopoDS_Edge& aE,Standard_Real& aT) ;
  
//! Computes parameter aT of the vertex aV on <br>
//! the edge aE. <br>
//! Returns zero if the distance between vertex <br>
//! and edge is less than sum of tolerances, <br>
//! otherwise and for following conditions returns <br>
//! negative value <br>
//! 1. the edge is degenerated (-1) <br>
//! 2. the edge does not contain 3d curve and pcurves (-2) <br>
//! 3. projection algorithm failed (-3) <br>
//! <br>
//! Output parameters <br>
//! <br>
//! bToUpdateVertex - the flag that indicates whether the <br>
//!  	 vertex tolerance should be modified or not <br>
//! aDist - the	value of the distance between the vertex <br>
//!      and the edge <br>
  Standard_EXPORT     Standard_Integer ComputeVE(const TopoDS_Vertex& aV,const TopoDS_Edge& aE,Standard_Real& aT,Standard_Boolean& bToUpdateVertex,Standard_Real& aDist) ;
  
//! Computes UV parameters of the vertex aV on face aF <br>
//! Returns zero if the distance between vertex and face is <br>
//! less than or equal the sum of tolerances and the projection <br>
//! point lays inside boundaries of the face. <br>
//! For following conditions returns negative value <br>
//! 1. projection algorithm failed (-1) <br>
//! 2. distance is more than sum of tolerances (-2) <br>
//! 3. projection point out or on the boundaries of face (-3) <br>
//! <br>
  Standard_EXPORT     Standard_Integer ComputeVS(const TopoDS_Vertex& aV,const TopoDS_Face& aF,Standard_Real& U,Standard_Real& V) ;
  
//! Returns the state of the point aP2D <br>
//! relative to face aF <br>
  Standard_EXPORT     TopAbs_State StatePointFace(const TopoDS_Face& aF,const gp_Pnt2d& aP2D) ;
  
//! Returns true if the point aP2D is <br>
//! inside the boundaries of the face aF, <br>
//! otherwise returns false <br>
  Standard_EXPORT     Standard_Boolean IsPointInFace(const TopoDS_Face& aF,const gp_Pnt2d& aP2D) ;
  
//! Returns true if the point aP2D is <br>
//! inside or on the boundaries of aF <br>
  Standard_EXPORT     Standard_Boolean IsPointInOnFace(const TopoDS_Face& aF,const gp_Pnt2d& aP2D) ;
  
//! Returns true if the distance between point aP3D <br>
//! and face aF is less or equal to tolerance aTol <br>
//! and projection point is inside or on the boundaries <br>
//! of the face aF <br>
  Standard_EXPORT     Standard_Boolean IsValidPointForFace(const gp_Pnt& aP3D,const TopoDS_Face& aF,const Standard_Real aTol) ;
  
//! Returns true if IsValidPointForFace returns true <br>
//! for both face aF1 and aF2 <br>
  Standard_EXPORT     Standard_Boolean IsValidPointForFaces(const gp_Pnt& aP3D,const TopoDS_Face& aF1,const TopoDS_Face& aF2,const Standard_Real aTol) ;
  
//! Returns true if IsValidPointForFace returns true <br>
//! for some 3d point that lay on the curve aIC bounded by <br>
//! parameters aT1 and aT2 <br>
  Standard_EXPORT     Standard_Boolean IsValidBlockForFace(const Standard_Real aT1,const Standard_Real aT2,const IntTools_Curve& aIC,const TopoDS_Face& aF,const Standard_Real aTol) ;
  
//! Returns true if IsValidBlockForFace returns true <br>
//! for both faces aF1 and aF2 <br>
  Standard_EXPORT     Standard_Boolean IsValidBlockForFaces(const Standard_Real aT1,const Standard_Real aT2,const IntTools_Curve& aIC,const TopoDS_Face& aF1,const TopoDS_Face& aF2,const Standard_Real aTol) ;
  
//! Computes parameter of the vertex aV on <br>
//! the curve aIC. <br>
//! Returns true if the distance between vertex and <br>
//! curve is less than sum of tolerance of aV and aTolC, <br>
//! otherwise or if projection algorithm failed <br>
//! returns false (in this case aT isn't significant) <br>
//! <br>
  Standard_EXPORT     Standard_Boolean IsVertexOnLine(const TopoDS_Vertex& aV,const IntTools_Curve& aIC,const Standard_Real aTolC,Standard_Real& aT) ;
  
//! Computes parameter of the vertex aV on <br>
//! the curve aIC. <br>
//! Returns true if the distance between vertex and <br>
//! curve is less than sum of tolerance of aV and aTolC, <br>
//! otherwise or if projection algorithm failed <br>
//! returns false (in this case aT isn't significant) <br>
//! <br>
  Standard_EXPORT     Standard_Boolean IsVertexOnLine(const TopoDS_Vertex& aV,const Standard_Real aTolV,const IntTools_Curve& aIC,const Standard_Real aTolC,Standard_Real& aT) ;
  
//! Computes parameter of the point aP on <br>
//! the edge aE. <br>
//! Returns false if projection algorithm failed <br>
//! other wiese returns true. <br>
  Standard_EXPORT     Standard_Boolean ProjectPointOnEdge(const gp_Pnt& aP,const TopoDS_Edge& aE,Standard_Real& aT) ;





protected:





private:



TopTools_IndexedDataMapOfShapeAddress myFClass2dMap;
TopTools_IndexedDataMapOfShapeAddress myProjPSMap;
TopTools_IndexedDataMapOfShapeAddress myProjPCMap;
IntTools_IndexedDataMapOfTransientAddress myProjPTMap;
TopTools_IndexedDataMapOfShapeAddress mySClassMap;
TopTools_IndexedDataMapOfShapeAddress myProjSDataMap;


};





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


#endif