42cf5bc1 |
1 | // Created on: 1995-03-22 |
2 | // Created by: Laurent BUCHARD |
3 | // Copyright (c) 1995-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _IntTools_FClass2d_HeaderFile |
18 | #define _IntTools_FClass2d_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
47cd8af2 |
24 | #include <BRepClass_FaceExplorer.hxx> |
42cf5bc1 |
25 | #include <BRepTopAdaptor_SeqOfPtr.hxx> |
26 | #include <TColStd_SequenceOfInteger.hxx> |
27 | #include <Standard_Real.hxx> |
28 | #include <TopoDS_Face.hxx> |
29 | #include <Standard_Boolean.hxx> |
30 | #include <TopAbs_State.hxx> |
47cd8af2 |
31 | #include <memory> |
32 | |
42cf5bc1 |
33 | class TopoDS_Face; |
34 | class gp_Pnt2d; |
35 | |
42cf5bc1 |
36 | //! Class provides an algorithm to classify a 2d Point |
37 | //! in 2d space of face using boundaries of the face. |
38 | class IntTools_FClass2d |
39 | { |
40 | public: |
41 | |
42 | DEFINE_STANDARD_ALLOC |
43 | |
44 | |
45 | |
46 | //! Empty constructor |
47 | Standard_EXPORT IntTools_FClass2d(); |
48 | |
49 | |
50 | //! Initializes algorithm by the face F |
51 | //! and tolerance Tol |
52 | Standard_EXPORT IntTools_FClass2d(const TopoDS_Face& F, const Standard_Real Tol); |
53 | |
54 | |
55 | //! Initializes algorithm by the face F |
56 | //! and tolerance Tol |
57 | Standard_EXPORT void Init (const TopoDS_Face& F, const Standard_Real Tol); |
58 | |
59 | |
60 | //! Returns state of infinite 2d point relatively to (0, 0) |
61 | Standard_EXPORT TopAbs_State PerformInfinitePoint() const; |
62 | |
63 | |
64 | //! Returns state of the 2d point Puv. |
65 | //! If RecadreOnPeriodic is true (defalut value), |
66 | //! for the periodic surface 2d point, adjusted to period, is |
67 | //! classified. |
68 | Standard_EXPORT TopAbs_State Perform (const gp_Pnt2d& Puv, const Standard_Boolean RecadreOnPeriodic = Standard_True) const; |
69 | |
70 | |
71 | //! Destructor |
72 | Standard_EXPORT void Destroy(); |
73 | ~IntTools_FClass2d() |
74 | { |
75 | Destroy(); |
76 | } |
77 | |
78 | |
79 | //! Test a point with +- an offset (Tol) and returns |
80 | //! On if some points are OUT an some are IN |
81 | //! (Caution: Internal use . see the code for more details) |
82 | Standard_EXPORT TopAbs_State TestOnRestriction (const gp_Pnt2d& Puv, const Standard_Real Tol, const Standard_Boolean RecadreOnPeriodic = Standard_True) const; |
83 | |
84 | Standard_EXPORT Standard_Boolean IsHole() const; |
85 | |
86 | |
87 | |
88 | |
89 | protected: |
90 | |
91 | |
92 | |
93 | |
94 | |
95 | private: |
96 | |
97 | |
98 | |
99 | BRepTopAdaptor_SeqOfPtr TabClass; |
100 | TColStd_SequenceOfInteger TabOrien; |
101 | Standard_Real Toluv; |
102 | TopoDS_Face Face; |
103 | Standard_Real U1; |
104 | Standard_Real V1; |
105 | Standard_Real U2; |
106 | Standard_Real V2; |
107 | Standard_Real Umin; |
108 | Standard_Real Umax; |
109 | Standard_Real Vmin; |
110 | Standard_Real Vmax; |
111 | Standard_Boolean myIsHole; |
112 | |
47cd8af2 |
113 | #ifdef _MSC_VER |
114 | #if _MSC_VER < 1600 |
115 | mutable std::auto_ptr<BRepClass_FaceExplorer> myFExplorer; |
116 | #else |
117 | mutable std::unique_ptr<BRepClass_FaceExplorer> myFExplorer; |
118 | #endif |
119 | #else |
120 | mutable std::unique_ptr<BRepClass_FaceExplorer> myFExplorer; |
121 | #endif |
42cf5bc1 |
122 | |
123 | }; |
124 | |
125 | |
126 | |
127 | |
128 | |
129 | |
130 | |
131 | #endif // _IntTools_FClass2d_HeaderFile |