42cf5bc1 |
1 | // Created on: 1994-02-18 |
2 | // Created by: Remi LEQUETTE |
3 | // Copyright (c) 1994-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 _BRepAlgoAPI_Section_HeaderFile |
18 | #define _BRepAlgoAPI_Section_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <Standard_Boolean.hxx> |
25 | #include <BRepAlgoAPI_BooleanOperation.hxx> |
26 | class BOPAlgo_PaveFiller; |
27 | class TopoDS_Shape; |
28 | class gp_Pln; |
29 | class Geom_Surface; |
30 | |
31 | |
32 | |
33 | //! The algorithm is to build a Secton operation between arguments and tools. |
34 | //! The result of Section operation consists of vertices and edges. |
35 | //! The result of Section operation contains: |
36 | //! 1. new vertices that are subjects of V/V, E/E, E/F, F/F interferences |
37 | //! 2. vertices that are subjects of V/E, V/F interferences |
38 | //! 3. new edges that are subjects of F/F interferences |
39 | //! 4. edges that are Common Blocks |
40 | class BRepAlgoAPI_Section : public BRepAlgoAPI_BooleanOperation |
41 | { |
42 | public: |
43 | |
44 | DEFINE_STANDARD_ALLOC |
45 | |
46 | |
47 | //! Empty constructor |
48 | Standard_EXPORT BRepAlgoAPI_Section(); |
49 | Standard_EXPORT virtual ~BRepAlgoAPI_Section(); |
50 | |
51 | //! Empty constructor |
52 | //! <PF> - PaveFiller object that is carried out |
53 | Standard_EXPORT BRepAlgoAPI_Section(const BOPAlgo_PaveFiller& PF); |
54 | |
55 | //! Constructor with two shapes |
56 | //! <S1> -argument |
57 | //! <S2> -tool |
58 | //! <PerformNow> - the flag: |
59 | //! if <PerformNow>=True - the algorithm is performed immediatly |
60 | //! Obsolete |
61 | Standard_EXPORT BRepAlgoAPI_Section(const TopoDS_Shape& S1, const TopoDS_Shape& S2, const Standard_Boolean PerformNow = Standard_True); |
62 | |
63 | //! Constructor with two shapes |
64 | //! <S1> -argument |
65 | //! <S2> -tool |
66 | //! <PF> - PaveFiller object that is carried out |
67 | //! <PerformNow> - the flag: |
68 | //! if <PerformNow>=True - the algorithm is performed immediatly |
69 | //! Obsolete |
70 | Standard_EXPORT BRepAlgoAPI_Section(const TopoDS_Shape& S1, const TopoDS_Shape& S2, const BOPAlgo_PaveFiller& aDSF, const Standard_Boolean PerformNow = Standard_True); |
71 | |
72 | //! Constructor with two shapes |
73 | //! <S1> - argument |
74 | //! <Pl> - tool |
75 | //! <PerformNow> - the flag: |
76 | //! if <PerformNow>=True - the algorithm is performed immediatly |
77 | //! Obsolete |
78 | Standard_EXPORT BRepAlgoAPI_Section(const TopoDS_Shape& S1, const gp_Pln& Pl, const Standard_Boolean PerformNow = Standard_True); |
79 | |
80 | //! Constructor with two shapes |
81 | //! <S1> - argument |
82 | //! <Sf> - tool |
83 | //! <PerformNow> - the flag: |
84 | //! if <PerformNow>=True - the algorithm is performed immediatly |
85 | //! Obsolete |
86 | Standard_EXPORT BRepAlgoAPI_Section(const TopoDS_Shape& S1, const Handle(Geom_Surface)& Sf, const Standard_Boolean PerformNow = Standard_True); |
87 | |
88 | //! Constructor with two shapes |
89 | //! <Sf> - argument |
90 | //! <S2> - tool |
91 | //! <PerformNow> - the flag: |
92 | //! if <PerformNow>=True - the algorithm is performed immediatly |
93 | //! Obsolete |
94 | Standard_EXPORT BRepAlgoAPI_Section(const Handle(Geom_Surface)& Sf, const TopoDS_Shape& S2, const Standard_Boolean PerformNow = Standard_True); |
95 | |
96 | //! Constructor with two shapes |
97 | //! <Sf1> - argument |
98 | //! <Sf2> - tool |
99 | //! <PerformNow> - the flag: |
100 | //! if <PerformNow>=True - the algorithm is performed immediatly |
101 | //! Obsolete |
102 | Standard_EXPORT BRepAlgoAPI_Section(const Handle(Geom_Surface)& Sf1, const Handle(Geom_Surface)& Sf2, const Standard_Boolean PerformNow = Standard_True); |
103 | |
104 | //! initialize the argument |
105 | //! <S1> - argument |
106 | //! Obsolete |
107 | Standard_EXPORT void Init1 (const TopoDS_Shape& S1); |
108 | |
109 | //! initialize the argument |
110 | //! <Pl> - argument |
111 | //! Obsolete |
112 | Standard_EXPORT void Init1 (const gp_Pln& Pl); |
113 | |
114 | //! initialize the argument |
115 | //! <Sf> - argument |
116 | //! Obsolete |
117 | Standard_EXPORT void Init1 (const Handle(Geom_Surface)& Sf); |
118 | |
119 | //! initialize the tool |
120 | //! <S2> - tool |
121 | //! Obsolete |
122 | Standard_EXPORT void Init2 (const TopoDS_Shape& S2); |
123 | |
124 | //! initialize the tool |
125 | //! <Pl> - tool |
126 | //! Obsolete |
127 | Standard_EXPORT void Init2 (const gp_Pln& Pl); |
128 | |
129 | //! initialize the tool |
130 | //! <Sf> - tool |
131 | //! Obsolete |
132 | Standard_EXPORT void Init2 (const Handle(Geom_Surface)& Sf); |
133 | |
134 | Standard_EXPORT void Approximation (const Standard_Boolean B); |
135 | |
136 | |
137 | //! Indicates whether the P-Curve should be (or not) |
138 | //! performed on the argument. |
139 | //! By default, no parametric 2D curve (pcurve) is defined for the |
140 | //! edges of the result. |
141 | //! If ComputePCurve1 equals true, further computations performed |
142 | //! to attach an P-Curve in the parametric space of the argument |
143 | //! to the constructed edges. |
144 | //! Obsolete |
145 | Standard_EXPORT void ComputePCurveOn1 (const Standard_Boolean B); |
146 | |
147 | |
148 | //! Indicates whether the P-Curve should be (or not) |
149 | //! performed on the tool. |
150 | //! By default, no parametric 2D curve (pcurve) is defined for the |
151 | //! edges of the result. |
152 | //! If ComputePCurve1 equals true, further computations performed |
153 | //! to attach an P-Curve in the parametric space of the tool |
154 | //! to the constructed edges. |
155 | //! Obsolete |
156 | Standard_EXPORT void ComputePCurveOn2 (const Standard_Boolean B); |
157 | |
158 | //! Performs the algorithm |
159 | //! Filling interference Data Structure (if it is necessary) |
160 | //! Building the result of the operation. |
161 | Standard_EXPORT virtual void Build() Standard_OVERRIDE; |
162 | |
163 | |
164 | //! get the face of the first part giving section edge <E>. |
165 | //! Returns True on the 3 following conditions : |
166 | //! 1/ <E> is an edge returned by the Shape() metwod. |
167 | //! 2/ First part of section performed is a shape. |
168 | //! 3/ <E> is built on a intersection curve (i.e <E> |
169 | //! is not the result of common edges) |
170 | //! When False, F remains untouched. |
171 | //! Obsolete |
172 | Standard_EXPORT Standard_Boolean HasAncestorFaceOn1 (const TopoDS_Shape& E, TopoDS_Shape& F) const; |
173 | |
174 | //! Identifies the ancestor faces of |
175 | //! the intersection edge E resulting from the last |
176 | //! computation performed in this framework, that is, the faces of |
177 | //! the two original shapes on which the edge E lies: |
178 | //! - HasAncestorFaceOn1 gives the ancestor face in the first shape, and |
179 | //! - HasAncestorFaceOn2 gives the ancestor face in the second shape. |
180 | //! These functions return true if an ancestor face F is found, or false if not. |
181 | //! An ancestor face is identifiable for the edge E if the following |
182 | //! conditions are satisfied: |
183 | //! - the first part on which this algorithm performed its |
184 | //! last computation is a shape, that is, it was not given as |
185 | //! a surface or a plane at the time of construction of this |
186 | //! algorithm or at a later time by the Init1 function, |
187 | //! - E is one of the elementary edges built by the |
188 | //! last computation of this section algorithm. |
189 | //! To use these functions properly, you have to test the returned |
190 | //! Boolean value before using the ancestor face: F is significant |
191 | //! only if the returned Boolean value equals true. |
192 | //! Obsolete |
193 | Standard_EXPORT Standard_Boolean HasAncestorFaceOn2 (const TopoDS_Shape& E, TopoDS_Shape& F) const; |
194 | |
195 | |
42cf5bc1 |
196 | protected: |
197 | |
198 | |
199 | Standard_EXPORT void Init (const Standard_Boolean PerformNow); |
200 | |
201 | Standard_EXPORT virtual void SetAttributes() Standard_OVERRIDE; |
202 | |
203 | |
42cf5bc1 |
204 | private: |
205 | |
42cf5bc1 |
206 | Standard_Boolean myApprox; |
207 | Standard_Boolean myComputePCurve1; |
208 | Standard_Boolean myComputePCurve2; |
209 | |
42cf5bc1 |
210 | }; |
211 | |
42cf5bc1 |
212 | #endif // _BRepAlgoAPI_Section_HeaderFile |