42cf5bc1 |
1 | // Created on: 1996-05-31 |
2 | // Created by: Laurent BUCHARD |
3 | // Copyright (c) 1996-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 _IntCurvesFace_Intersector_HeaderFile |
18 | #define _IntCurvesFace_Intersector_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <Standard_Real.hxx> |
25 | #include <IntCurveSurface_SequenceOfPnt.hxx> |
26 | #include <TColStd_SequenceOfInteger.hxx> |
27 | #include <Standard_Boolean.hxx> |
28 | #include <Standard_Integer.hxx> |
29 | #include <TopoDS_Face.hxx> |
30 | #include <Standard_Address.hxx> |
31 | #include <GeomAbs_SurfaceType.hxx> |
32 | #include <IntCurveSurface_TransitionOnCurve.hxx> |
33 | #include <TopAbs_State.hxx> |
34 | class BRepTopAdaptor_TopolTool; |
35 | class BRepAdaptor_HSurface; |
36 | class TopoDS_Face; |
37 | class gp_Lin; |
38 | class Adaptor3d_HCurve; |
39 | class gp_Pnt; |
40 | class IntCurveSurface_HInter; |
41 | class gp_Pnt2d; |
42 | class Bnd_Box; |
43 | |
44 | |
45 | |
46 | class IntCurvesFace_Intersector |
47 | { |
48 | public: |
49 | |
50 | DEFINE_STANDARD_ALLOC |
51 | |
52 | |
53 | //! Load a Face. |
54 | //! |
55 | //! The Tolerance <Tol> is used to determine if the |
56 | //! first point of the segment is near the face. In |
57 | //! that case, the parameter of the intersection point |
58 | //! on the line can be a negative value (greater than -Tol). |
59 | Standard_EXPORT IntCurvesFace_Intersector(const TopoDS_Face& F, const Standard_Real aTol); |
60 | |
61 | //! Perform the intersection between the |
62 | //! segment L and the loaded face. |
63 | //! |
64 | //! PInf is the smallest parameter on the line |
65 | //! PSup is the highest parmaeter on the line |
66 | //! |
67 | //! For an infinite line PInf and PSup can be |
68 | //! +/- RealLast. |
69 | Standard_EXPORT void Perform (const gp_Lin& L, const Standard_Real PInf, const Standard_Real PSup); |
70 | |
71 | //! same method for a HCurve from Adaptor3d. |
72 | //! PInf an PSup can also be - and + INF. |
73 | Standard_EXPORT void Perform (const Handle(Adaptor3d_HCurve)& HCu, const Standard_Real PInf, const Standard_Real PSup); |
74 | |
75 | //! Return the surface type |
76 | Standard_EXPORT GeomAbs_SurfaceType SurfaceType() const; |
77 | |
78 | //! True is returned when the intersection have been computed. |
79 | Standard_Boolean IsDone() const; |
80 | |
81 | Standard_Integer NbPnt() const; |
82 | |
83 | //! Returns the U parameter of the ith intersection point |
84 | //! on the surface. |
85 | Standard_Real UParameter (const Standard_Integer I) const; |
86 | |
87 | //! Returns the V parameter of the ith intersection point |
88 | //! on the surface. |
89 | Standard_Real VParameter (const Standard_Integer I) const; |
90 | |
91 | //! Returns the parameter of the ith intersection point |
92 | //! on the line. |
93 | Standard_Real WParameter (const Standard_Integer I) const; |
94 | |
95 | //! Returns the geometric point of the ith intersection |
96 | //! between the line and the surface. |
97 | const gp_Pnt& Pnt (const Standard_Integer I) const; |
98 | |
99 | //! Returns the ith transition of the line on the surface. |
100 | IntCurveSurface_TransitionOnCurve Transition (const Standard_Integer I) const; |
101 | |
102 | //! Returns the ith state of the point on the face. |
103 | //! The values can be either TopAbs_IN |
104 | //! ( the point is in the face) |
105 | //! or TopAbs_ON |
106 | //! ( the point is on a boudary of the face). |
107 | TopAbs_State State (const Standard_Integer I) const; |
108 | |
109 | //! Returns the significant face used to determine |
110 | //! the intersection. |
111 | const TopoDS_Face& Face() const; |
112 | |
113 | Standard_EXPORT TopAbs_State ClassifyUVPoint (const gp_Pnt2d& Puv) const; |
114 | |
115 | Standard_EXPORT Bnd_Box Bounding() const; |
116 | |
117 | Standard_EXPORT void Destroy(); |
118 | ~IntCurvesFace_Intersector() |
119 | { |
120 | Destroy(); |
121 | } |
122 | |
123 | |
124 | |
125 | |
126 | protected: |
127 | |
128 | |
129 | |
130 | |
131 | |
132 | private: |
133 | |
134 | |
135 | Standard_EXPORT void InternalCall (const IntCurveSurface_HInter& HICS, const Standard_Real pinf, const Standard_Real psup); |
136 | |
137 | |
138 | Handle(BRepTopAdaptor_TopolTool) myTopolTool; |
139 | Handle(BRepAdaptor_HSurface) Hsurface; |
140 | Standard_Real Tol; |
141 | IntCurveSurface_SequenceOfPnt SeqPnt; |
142 | TColStd_SequenceOfInteger mySeqState; |
143 | Standard_Boolean done; |
144 | Standard_Integer nbpnt; |
145 | TopoDS_Face face; |
146 | Standard_Address PtrOnPolyhedron; |
147 | Standard_Address PtrOnBndBounding; |
148 | |
149 | |
150 | }; |
151 | |
152 | |
153 | #include <IntCurvesFace_Intersector.lxx> |
154 | |
155 | |
156 | |
157 | |
158 | |
159 | #endif // _IntCurvesFace_Intersector_HeaderFile |