summaryrefslogtreecommitdiff
path: root/inc/IntTools_Tools.hxx
blob: 1c7d3ef8c2d31e40b73b92c3058ea585016bffed (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
// 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_Tools_HeaderFile
#define _IntTools_Tools_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.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 _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _Handle_Geom_Curve_HeaderFile
#include <Handle_Geom_Curve.hxx>
#endif
class TopoDS_Vertex;
class TopoDS_Wire;
class TopoDS_Face;
class gp_Pnt2d;
class TopoDS_Edge;
class IntTools_CommonPrt;
class gp_Pnt;
class IntTools_Curve;
class IntTools_SequenceOfCurves;
class gp_Dir;
class Geom_Curve;



//!  The class contains handy static functions <br>
//!  dealing with the geometry and topology. <br>
class IntTools_Tools  {
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); 
  }

  
//! Computes distance between vertex V1 and vertex V2, <br>
//! if the distance is less than sum of vertex tolerances <br>
//! returns zero, <br>
//! otherwise returns negative value <br>
  Standard_EXPORT   static  Standard_Integer ComputeVV(const TopoDS_Vertex& V1,const TopoDS_Vertex& V2) ;
  
//! Returns True if wire aW contains edges <br>
//! with INTERNAL orientation <br>
  Standard_EXPORT   static  Standard_Boolean HasInternalEdge(const TopoDS_Wire& aW) ;
  
//! Build a face based on surface of given face aF <br>
//! and bounded by wire aW <br>
  Standard_EXPORT   static  void MakeFaceFromWireAndFace(const TopoDS_Wire& aW,const TopoDS_Face& aF,TopoDS_Face& aFNew) ;
  
//! <br>
  Standard_EXPORT   static  TopAbs_State ClassifyPointByFace(const TopoDS_Face& aF,const gp_Pnt2d& P) ;
  
//! Computes square distance between a point on the edge E <br>
//! corresponded to parameter t and vertices of edge E. <br>
//! Returns True if this distance is less than square <br>
//! tolerance of vertex, otherwise returns false. <br>
  Standard_EXPORT   static  Standard_Boolean IsVertex(const TopoDS_Edge& E,const Standard_Real t) ;
  
//! Returns True if square distance between vertex V <br>
//! and a point on the edge E corresponded to parameter t <br>
//! is less than square tolerance of V <br>
  Standard_EXPORT   static  Standard_Boolean IsVertex(const TopoDS_Edge& E,const TopoDS_Vertex& V,const Standard_Real t) ;
  
//! Returns True if IsVertx for middle parameter of fist range <br>
//! and first edge returns True <br>
//! and if IsVertex for middle parameter of second range and <br>
//! second range returns True, <br>
//! otherwise returns False <br>
  Standard_EXPORT   static  Standard_Boolean IsVertex(const IntTools_CommonPrt& aCmnPrt) ;
  
//! Gets boundary of parameters of E1 and E2. <br>
//! Computes 3d points on each corresponded to average parameters. <br>
//! Returns True if distance between computed points is less than <br>
//! sum of edge tolerance, otherwise returns False. <br>
  Standard_EXPORT   static  Standard_Boolean IsMiddlePointsEqual(const TopoDS_Edge& E1,const TopoDS_Edge& E2) ;
  
//! Returns True if the distance between point aP and <br>
//! vertex aV is less or equal to sum of aTolPV and <br>
//! vertex tolerance, otherwise returns False <br>
  Standard_EXPORT   static  Standard_Boolean IsVertex(const gp_Pnt& aP,const Standard_Real aTolPV,const TopoDS_Vertex& aV) ;
  
//! Returns some value between aFirst and aLast <br>
  Standard_EXPORT   static  Standard_Real IntermediatePoint(const Standard_Real aFirst,const Standard_Real aLast) ;
  
//! Split aC by average parameter if aC is closed in 3D. <br>
//! Returns positive value if splitting has been done, <br>
//! otherwise returns zero. <br>
  Standard_EXPORT   static  Standard_Integer SplitCurve(const IntTools_Curve& aC,IntTools_SequenceOfCurves& aS) ;
  
//! Puts curves from aSIn to aSOut except those curves that <br>
//! are coincide with first curve from aSIn. <br>
  Standard_EXPORT   static  void RejectLines(const IntTools_SequenceOfCurves& aSIn,IntTools_SequenceOfCurves& aSOut) ;
  
//! Returns True if D1 and D2 coinside <br>
//! <br>
  Standard_EXPORT   static  Standard_Boolean IsDirsCoinside(const gp_Dir& D1,const gp_Dir& D2) ;
  
//! Returns True if D1 and D2 coinside with given tolerance <br>
//! <br>
  Standard_EXPORT   static  Standard_Boolean IsDirsCoinside(const gp_Dir& D1,const gp_Dir& D2,const Standard_Real aTol) ;
  
//! Returns True if aC is BoundedCurve from Geom and <br>
//! the distance between first point <br>
//! of the curve aC and last point <br>
//! is less than 1.e-12 <br>
  Standard_EXPORT   static  Standard_Boolean IsClosed(const Handle(Geom_Curve)& aC) ;
  
//! Returns adaptive tolerance for given aTolBase <br>
//! if aC is trimmed curve and basis curve is parabola, <br>
//! otherwise returns value of aTolBase <br>
  Standard_EXPORT   static  Standard_Real CurveTolerance(const Handle(Geom_Curve)& aC,const Standard_Real aTolBase) ;





protected:





private:





};





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


#endif