summaryrefslogtreecommitdiff
path: root/inc/TopOpeBRepTool_ShapeClassifier.hxx
blob: b8d8ec363a134eb331de86609dbccce88d5f4897 (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
// 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 _TopOpeBRepTool_ShapeClassifier_HeaderFile
#define _TopOpeBRepTool_ShapeClassifier_HeaderFile

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

#ifndef _TopoDS_Shape_HeaderFile
#include <TopoDS_Shape.hxx>
#endif
#ifndef _TopOpeBRepTool_Plos_HeaderFile
#include <TopOpeBRepTool_Plos.hxx>
#endif
#ifndef _TopTools_IndexedMapOfShape_HeaderFile
#include <TopTools_IndexedMapOfShape.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _TopAbs_State_HeaderFile
#include <TopAbs_State.hxx>
#endif
#ifndef _TopoDS_Edge_HeaderFile
#include <TopoDS_Edge.hxx>
#endif
#ifndef _TopoDS_Face_HeaderFile
#include <TopoDS_Face.hxx>
#endif
#ifndef _gp_Pnt_HeaderFile
#include <gp_Pnt.hxx>
#endif
#ifndef _gp_Pnt2d_HeaderFile
#include <gp_Pnt2d.hxx>
#endif
#ifndef _TopOpeBRepTool_SolidClassifier_HeaderFile
#include <TopOpeBRepTool_SolidClassifier.hxx>
#endif
class TopoDS_Shape;
class TopTools_ListOfShape;
class TopOpeBRepTool_SolidClassifier;
class gp_Pnt2d;
class gp_Pnt;



class TopOpeBRepTool_ShapeClassifier  {
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); 
  }

  
  Standard_EXPORT   TopOpeBRepTool_ShapeClassifier();
  
//! SRef is the reference shape. <br>
//! StateShapeShape(S) calls will classify S with SRef. <br>
  Standard_EXPORT   TopOpeBRepTool_ShapeClassifier(const TopoDS_Shape& SRef);
  //! reset all internal data (SolidClassifier included) <br>
  Standard_EXPORT     void ClearAll() ;
  //! reset all internal data (except SolidClassified) <br>
  Standard_EXPORT     void ClearCurrent() ;
  
//! Set SRef as reference shape <br>
//! the next StateShapeReference(S,AvoidS) calls will classify S with SRef. <br>
  Standard_EXPORT     void SetReference(const TopoDS_Shape& SRef) ;
  
//!  classify shape S compared with shape SRef. <br>
//!  samedomain = 0 : S1,S2 are not same domain <br>
//!  samedomain = 1 : S1,S2 are same domain <br>
  Standard_EXPORT     TopAbs_State StateShapeShape(const TopoDS_Shape& S,const TopoDS_Shape& SRef,const Standard_Integer samedomain = 0) ;
  
  Standard_EXPORT     Standard_Integer SameDomain() const;
  
//! set mode for next StateShapeShape call <br>
//! 	  samedomain = true --> S,Sref are same domain --> point <br>
//! 	  on restriction (ON S) is used to classify S. <br>
//! 	  samedomain = false --> S,Sref are not domain --> point <br>
//! 	  not on restriction of S (IN S) is used to classify S. <br>
//! 	  samedomain value is used only in next StateShapeShape call <br>
  Standard_EXPORT     void SameDomain(const Standard_Integer samedomain) ;
  
//! classify shape S compared with shape SRef. <br>
//! AvoidS is not used in classification; AvoidS may be IsNull(). <br>
//! (usefull to avoid ON or UNKNOWN state in special cases) <br>
  Standard_EXPORT     TopAbs_State StateShapeShape(const TopoDS_Shape& S,const TopoDS_Shape& AvoidS,const TopoDS_Shape& SRef) ;
  
//! classify shape S compared with shape SRef. <br>
//! LAvoidS is list of S subshapes to avoid in classification <br>
//! AvoidS is not used in classification; AvoidS may be IsNull(). <br>
//! (usefull to avoid ON or UNKNOWN state in special cases) <br>
  Standard_EXPORT     TopAbs_State StateShapeShape(const TopoDS_Shape& S,const TopTools_ListOfShape& LAvoidS,const TopoDS_Shape& SRef) ;
  
//! classify shape S compared with reference shape. <br>
//! AvoidS is not used in classification; AvoidS may be IsNull(). <br>
//! (usefull to avoid ON or UNKNOWN state in special cases) <br>
  Standard_EXPORT     TopAbs_State StateShapeReference(const TopoDS_Shape& S,const TopoDS_Shape& AvoidS) ;
  
//! classify shape S compared with reference shape. <br>
//! LAvoidS is list of S subshapes to avoid in classification <br>
//! (usefull to avoid ON or UNKNOWN state in special cases) <br>
  Standard_EXPORT     TopAbs_State StateShapeReference(const TopoDS_Shape& S,const TopTools_ListOfShape& LAvoidS) ;
  
  Standard_EXPORT     TopOpeBRepTool_SolidClassifier& ChangeSolidClassifier() ;
  //! classify point P2D with myRef <br>
  Standard_EXPORT     void StateP2DReference(const gp_Pnt2d& P2D) ;
  //! classify point P3D with myRef <br>
  Standard_EXPORT     void StateP3DReference(const gp_Pnt& P3D) ;
  //! return field myState <br>
  Standard_EXPORT     TopAbs_State State() const;
  
  Standard_EXPORT    const gp_Pnt2d& P2D() const;
  
  Standard_EXPORT    const gp_Pnt& P3D() const;





protected:





private:

  
  Standard_EXPORT     void MapRef() ;
  
  Standard_EXPORT     void FindEdge() ;
  
  Standard_EXPORT     void FindEdge(const TopoDS_Shape& S) ;
  
  Standard_EXPORT     void FindFace(const TopoDS_Shape& S) ;
  
  Standard_EXPORT     void Perform() ;
  //! classify myEdge with myRef <br>
  Standard_EXPORT     void StateEdgeReference() ;
  
  Standard_EXPORT     Standard_Boolean HasAvLS() const;


TopoDS_Shape myS;
TopoDS_Shape myRef;
TopoDS_Shape myAvS;
TopOpeBRepTool_Plos myPAvLS;
TopTools_IndexedMapOfShape myMapAvS;
TopTools_IndexedMapOfShape mymre;
Standard_Integer mymren;
Standard_Boolean mymredone;
TopAbs_State myState;
TopoDS_Edge myEdge;
TopoDS_Face myFace;
Standard_Boolean myP3Ddef;
gp_Pnt myP3D;
Standard_Boolean myP2Ddef;
gp_Pnt2d myP2D;
TopOpeBRepTool_SolidClassifier mySolidClassifier;
Standard_Integer mySameDomain;


};





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


#endif