summaryrefslogtreecommitdiff
path: root/inc/TopOpeBRep_FaceEdgeIntersector.hxx
blob: 6ae30bdec09b60452cf716f53e831fd3dbfde5de (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
// 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 _TopOpeBRep_FaceEdgeIntersector_HeaderFile
#define _TopOpeBRep_FaceEdgeIntersector_HeaderFile

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

#ifndef _TopoDS_Face_HeaderFile
#include <TopoDS_Face.hxx>
#endif
#ifndef _TopoDS_Edge_HeaderFile
#include <TopoDS_Edge.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _GeomAdaptor_Curve_HeaderFile
#include <GeomAdaptor_Curve.hxx>
#endif
#ifndef _IntCurveSurface_SequenceOfPnt_HeaderFile
#include <IntCurveSurface_SequenceOfPnt.hxx>
#endif
#ifndef _TColStd_SequenceOfInteger_HeaderFile
#include <TColStd_SequenceOfInteger.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _TopExp_Explorer_HeaderFile
#include <TopExp_Explorer.hxx>
#endif
#ifndef _TopoDS_Shape_HeaderFile
#include <TopoDS_Shape.hxx>
#endif
#ifndef _TopoDS_Vertex_HeaderFile
#include <TopoDS_Vertex.hxx>
#endif
#ifndef _TopAbs_State_HeaderFile
#include <TopAbs_State.hxx>
#endif
#ifndef _TopAbs_Orientation_HeaderFile
#include <TopAbs_Orientation.hxx>
#endif
#ifndef _TopAbs_ShapeEnum_HeaderFile
#include <TopAbs_ShapeEnum.hxx>
#endif
class TopoDS_Shape;
class gp_Pnt;
class gp_Pnt2d;
class TopOpeBRepDS_Transition;
class TopoDS_Vertex;



class TopOpeBRep_FaceEdgeIntersector  {
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   TopOpeBRep_FaceEdgeIntersector();
  
  Standard_EXPORT     void Perform(const TopoDS_Shape& F,const TopoDS_Shape& E) ;
  
  Standard_EXPORT     Standard_Boolean IsEmpty() ;
  //! returns intersected face or edge according to <br>
//!          value of <Index> = 1 or 2 <br>
  Standard_EXPORT    const TopoDS_Shape& Shape(const Standard_Integer Index) const;
  
//! Force the tolerance values used by the next Perform(S1,S2) call. <br>
  Standard_EXPORT     void ForceTolerance(const Standard_Real tol) ;
  
//! Return the tolerance value used in the last Perform() call <br>
//! If ForceTolerance() has been called, return the given value. <br>
//! If not, return value extracted from shapes. <br>
  Standard_EXPORT     Standard_Real Tolerance() const;
  
  Standard_EXPORT     Standard_Integer NbPoints() const;
  
  Standard_EXPORT     void InitPoint() ;
  
  Standard_EXPORT     Standard_Boolean MorePoint() const;
  
  Standard_EXPORT     void NextPoint() ;
  //! return the 3D point of the current intersection point. <br>
  Standard_EXPORT     gp_Pnt Value() const;
  //! parametre de Value() sur l'arete <br>
  Standard_EXPORT     Standard_Real Parameter() const;
  //! parametre de Value() sur la face <br>
  Standard_EXPORT     void UVPoint(gp_Pnt2d& P) const;
  //! IN ou ON / a la face. Les points OUT ne sont pas retournes. <br>
  Standard_EXPORT     TopAbs_State State() const;
  
//! Index = 1 transition par rapport a la face, en cheminant sur l'arete <br>
  Standard_EXPORT     TopOpeBRepDS_Transition Transition(const Standard_Integer Index,const TopAbs_Orientation FaceOrientation) const;
  
  Standard_EXPORT     Standard_Boolean IsVertex(const TopoDS_Shape& S,const gp_Pnt& P,const Standard_Real Tol,TopoDS_Vertex& V) ;
  
  Standard_EXPORT     Standard_Boolean IsVertex(const Standard_Integer I,TopoDS_Vertex& V) ;
  //! trace only <br>
  Standard_EXPORT     Standard_Integer Index() const;





protected:





private:

  
  Standard_EXPORT     void ResetIntersection() ;
  //! extract tolerance values from shapes <S1>,<S2>, <br>
//!          in order to perform intersection between <S1> and <S2> <br>
//!          with tolerance values "fitting" the shape tolerances. <br>
//! (called by Perform() by default, when ForceTolerances() has not <br>
//!  been called) <br>
  Standard_EXPORT     void ShapeTolerances(const TopoDS_Shape& S1,const TopoDS_Shape& S2) ;
  //! returns the max tolerance of sub-shapes of type <T> <br>
//!           found in shape <S>. If no such sub-shape found, return <br>
//!           Precision::Intersection() <br>
//! (called by ShapeTolerances()) <br>
  Standard_EXPORT     Standard_Real ToleranceMax(const TopoDS_Shape& S,const TopAbs_ShapeEnum T) const;


TopoDS_Face myFace;
TopoDS_Edge myEdge;
Standard_Real myTol;
Standard_Boolean myForceTolerance;
GeomAdaptor_Curve myCurve;
Standard_Boolean myIntersectionDone;
IntCurveSurface_SequenceOfPnt mySequenceOfPnt;
TColStd_SequenceOfInteger mySequenceOfState;
Standard_Integer myPointIndex;
Standard_Integer myNbPoints;
TopExp_Explorer myVertexExplorer;
TopoDS_Shape myNullShape;
TopoDS_Vertex myNullVertex;


};





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


#endif