42cf5bc1 |
1 | // Created on: 2000-11-23 |
2 | // Created by: Michael KLOKOV |
3 | // Copyright (c) 2000-2014 OPEN CASCADE SAS |
4 | // |
5 | // This file is part of Open CASCADE Technology software library. |
6 | // |
7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published |
9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | // distribution for complete text of the license and disclaimer of any warranty. |
12 | // |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
15 | |
16 | #ifndef _IntTools_FaceFace_HeaderFile |
17 | #define _IntTools_FaceFace_HeaderFile |
18 | |
19 | #include <Standard.hxx> |
20 | #include <Standard_DefineAlloc.hxx> |
21 | #include <Standard_Handle.hxx> |
22 | |
23 | #include <Standard_Boolean.hxx> |
24 | #include <IntPatch_Intersection.hxx> |
25 | #include <GeomInt_LineConstructor.hxx> |
26 | #include <Standard_Integer.hxx> |
27 | #include <Standard_Real.hxx> |
28 | #include <IntTools_SequenceOfCurves.hxx> |
29 | #include <TopoDS_Face.hxx> |
30 | #include <IntTools_SequenceOfPntOn2Faces.hxx> |
31 | #include <IntSurf_ListOfPntOn2S.hxx> |
32 | class GeomAdaptor_HSurface; |
33 | class IntTools_Context; |
34 | class StdFail_NotDone; |
35 | class TopoDS_Face; |
36 | class Adaptor3d_TopolTool; |
37 | |
38 | |
39 | //! This class provides the intersection of |
40 | //! face's underlying surfaces. |
41 | class IntTools_FaceFace |
42 | { |
43 | public: |
44 | |
45 | DEFINE_STANDARD_ALLOC |
46 | |
47 | |
48 | |
49 | //! Empty constructor. |
50 | Standard_EXPORT IntTools_FaceFace(); |
51 | |
52 | |
53 | //! Modifier |
54 | Standard_EXPORT void SetParameters (const Standard_Boolean ApproxCurves, const Standard_Boolean ComputeCurveOnS1, const Standard_Boolean ComputeCurveOnS2, const Standard_Real ApproximationTolerance); |
55 | |
56 | |
57 | //! Intersects underliing surfaces of F1 and F2 |
58 | //! Use sum of tolerance of F1 and F2 as intersection |
59 | //! criteria |
60 | Standard_EXPORT void Perform (const TopoDS_Face& F1, const TopoDS_Face& F2); |
61 | |
62 | |
63 | //! Returns True if the intersection was successful |
64 | Standard_EXPORT Standard_Boolean IsDone() const; |
65 | |
66 | |
67 | //! Returns sequence of 3d curves as result of intersection |
68 | Standard_EXPORT const IntTools_SequenceOfCurves& Lines() const; |
69 | |
70 | |
71 | //! Returns sequence of 3d curves as result of intersection |
72 | Standard_EXPORT const IntTools_SequenceOfPntOn2Faces& Points() const; |
73 | |
74 | |
3510db62 |
75 | //! Returns tolerance reached during approximation, |
76 | //! and possibly increased to cover more area due to a small angle between surfaces. |
42cf5bc1 |
77 | //! If approximation was not done, returns zero. |
78 | Standard_EXPORT Standard_Real TolReached3d() const; |
3510db62 |
79 | |
80 | //! Returns tolerance reached during approximation, without any increase. |
81 | //! If approximation was not done, returns zero. |
82 | Standard_EXPORT Standard_Real TolReal() const; |
42cf5bc1 |
83 | |
84 | //! Returns tolerance reached during approximation. |
85 | //! If approximation was not done, returns zero. |
86 | Standard_EXPORT Standard_Real TolReached2d() const; |
87 | |
88 | |
89 | //! Returns first of processed faces |
90 | Standard_EXPORT const TopoDS_Face& Face1() const; |
91 | |
92 | |
93 | //! Returns second of processed faces |
94 | Standard_EXPORT const TopoDS_Face& Face2() const; |
95 | |
96 | |
97 | //! Returns True if faces are tangent |
98 | Standard_EXPORT Standard_Boolean TangentFaces() const; |
3510db62 |
99 | |
42cf5bc1 |
100 | |
101 | //! Provides post-processing the result lines. |
102 | //! <bToSplit> - the flag. |
103 | //! In case of <bToSplit> is true the closed 3D-curves will be splitted |
104 | //! on parts. |
105 | //! In case of <bToSplit> is false the closed 3D-curves remain untouched. |
106 | Standard_EXPORT void PrepareLines3D (const Standard_Boolean bToSplit = Standard_True); |
107 | |
108 | Standard_EXPORT void SetList (IntSurf_ListOfPntOn2S& ListOfPnts); |
109 | |
110 | |
111 | //! Sets the intersecton context |
112 | Standard_EXPORT void SetContext (const Handle(IntTools_Context)& aContext); |
113 | |
114 | |
115 | //! Gets the intersecton context |
116 | Standard_EXPORT const Handle(IntTools_Context)& Context() const; |
117 | |
118 | |
119 | |
120 | |
121 | protected: |
122 | |
123 | |
71958f7d |
124 | Standard_EXPORT void MakeCurve (const Standard_Integer Index, |
125 | const Handle(Adaptor3d_TopolTool)& D1, |
126 | const Handle(Adaptor3d_TopolTool)& D2, |
127 | const Standard_Real theToler); |
42cf5bc1 |
128 | |
129 | Standard_EXPORT void ComputeTolReached3d(); |
130 | |
131 | Standard_EXPORT Standard_Real ComputeTolerance(); |
132 | |
133 | |
134 | |
135 | |
136 | private: |
137 | |
138 | |
139 | |
140 | Standard_Boolean myIsDone; |
141 | IntPatch_Intersection myIntersector; |
142 | GeomInt_LineConstructor myLConstruct; |
143 | Handle(GeomAdaptor_HSurface) myHS1; |
144 | Handle(GeomAdaptor_HSurface) myHS2; |
145 | Standard_Integer myNbrestr; |
146 | Standard_Real myTolReached2d; |
147 | Standard_Real myTolReached3d; |
3510db62 |
148 | Standard_Real myTolReal; |
42cf5bc1 |
149 | Standard_Boolean myApprox; |
150 | Standard_Boolean myApprox1; |
151 | Standard_Boolean myApprox2; |
152 | Standard_Real myTolApprox; |
153 | IntTools_SequenceOfCurves mySeqOfCurve; |
154 | Standard_Boolean myTangentFaces; |
155 | TopoDS_Face myFace1; |
156 | TopoDS_Face myFace2; |
157 | IntTools_SequenceOfPntOn2Faces myPnts; |
158 | IntSurf_ListOfPntOn2S myListOfPnts; |
159 | Handle(IntTools_Context) myContext; |
160 | |
161 | |
162 | }; |
163 | |
164 | |
165 | |
166 | |
167 | |
168 | |
169 | |
170 | #endif // _IntTools_FaceFace_HeaderFile |