42cf5bc1 |
1 | // Created on: 1993-01-27 |
2 | // Created by: Philippe DAUTRY |
3 | // Copyright (c) 1993-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 _BRepSweep_NumLinearRegularSweep_HeaderFile |
18 | #define _BRepSweep_NumLinearRegularSweep_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
42cf5bc1 |
22 | |
23 | #include <BRepSweep_Builder.hxx> |
24 | #include <TopoDS_Shape.hxx> |
42cf5bc1 |
25 | #include <BRepSweep_Tool.hxx> |
26 | #include <Sweep_NumShapeTool.hxx> |
27 | #include <TopTools_Array2OfShape.hxx> |
28 | #include <TColStd_Array2OfBoolean.hxx> |
29 | #include <TopAbs_Orientation.hxx> |
42cf5bc1 |
30 | |
31 | |
32 | //! This a generic class is used to build Sweept |
33 | //! primitives with a generating "shape" and a |
34 | //! directing "line". |
35 | //! |
36 | //! The indexation and type analysis services required |
37 | //! for the generatrix are given by <Tool from BRepSweep>. |
38 | //! |
39 | //! The indexation and type analysis services required |
40 | //! for the directrix are given by <NumShapeTool from Sweep>. |
41 | //! |
42 | //! The iteration services required for the generatrix |
43 | //! are given by <Iterator from BRepSweep>. |
44 | //! |
45 | //! The iteration services required for the directrix |
46 | //! are given by <NumShapeIterator from Sweep>. |
47 | //! |
48 | //! The topology is like a grid of shapes. Each shape |
49 | //! of the grid must be addressable without confusion |
50 | //! by one or two objects from the generating or |
b81b237f |
51 | //! directing shapes. Here are examples of correct |
42cf5bc1 |
52 | //! associations to address: |
53 | //! |
54 | //! - a vertex : GenVertex - DirVertex |
55 | //! - an edge : GenVertex - DirEdge |
56 | //! - : GenEdge - DirVertex |
57 | //! - a face : GenEdge - DirEdge |
58 | //! GenFace - DirVertex |
59 | //! ... |
60 | //! |
61 | //! "GenObject" is used to identify an object from the |
62 | //! Generating Shape, and "DirObject" from the |
63 | //! Directing Shape. So may they be from different |
64 | //! types. |
65 | //! |
66 | //! The method Has... is given because in some special |
67 | //! cases, a vertex, an edge or a face may be |
b81b237f |
68 | //! geometricaly nonexistant or not useful. |
42cf5bc1 |
69 | class BRepSweep_NumLinearRegularSweep |
70 | { |
71 | public: |
72 | |
73 | DEFINE_STANDARD_ALLOC |
74 | |
75 | |
76 | //! Builds the vertex addressed by [aGenV,aDirV], with its |
77 | //! geometric part, but without subcomponents. |
78 | Standard_EXPORT virtual TopoDS_Shape MakeEmptyVertex (const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirV) = 0; |
79 | Standard_EXPORT virtual ~BRepSweep_NumLinearRegularSweep(); |
80 | |
81 | //! Builds the edge addressed by [aGenV,aDirE], with its |
82 | //! geometric part, but without subcomponents. |
83 | Standard_EXPORT virtual TopoDS_Shape MakeEmptyDirectingEdge (const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirE) = 0; |
84 | |
85 | //! Builds the edge addressed by [aGenE,aDirV], with its |
86 | //! geometric part, but without subcomponents. |
87 | Standard_EXPORT virtual TopoDS_Shape MakeEmptyGeneratingEdge (const TopoDS_Shape& aGenE, const Sweep_NumShape& aDirV) = 0; |
88 | |
89 | //! Sets the parameters of the new vertex on the new |
90 | //! face. The new face and new vertex where generated |
91 | //! from aGenF, aGenV and aDirV . |
92 | Standard_EXPORT virtual void SetParameters (const TopoDS_Shape& aNewFace, TopoDS_Shape& aNewVertex, const TopoDS_Shape& aGenF, const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirV) = 0; |
93 | |
94 | //! Sets the parameter of the new vertex on the new |
95 | //! edge. The new edge and new vertex where generated |
96 | //! from aGenV aDirE, and aDirV. |
97 | Standard_EXPORT virtual void SetDirectingParameter (const TopoDS_Shape& aNewEdge, TopoDS_Shape& aNewVertex, const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirE, const Sweep_NumShape& aDirV) = 0; |
98 | |
99 | //! Sets the parameter of the new vertex on the new |
100 | //! edge. The new edge and new vertex where generated |
101 | //! from aGenE, aGenV and aDirV . |
102 | Standard_EXPORT virtual void SetGeneratingParameter (const TopoDS_Shape& aNewEdge, TopoDS_Shape& aNewVertex, const TopoDS_Shape& aGenE, const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirV) = 0; |
103 | |
104 | //! Builds the face addressed by [aGenS,aDirS], with |
105 | //! its geometric part, but without subcomponents. The |
106 | //! couple aGenS, aDirS can be a "generating face and |
107 | //! a directing vertex" or "a generating edge and a |
108 | //! directing edge". |
109 | Standard_EXPORT virtual TopoDS_Shape MakeEmptyFace (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS) = 0; |
110 | |
111 | //! Sets the PCurve for a new edge on a new face. The |
112 | //! new edge and the new face were generated using |
113 | //! aGenF, aGenE and aDirV. |
114 | Standard_EXPORT virtual void SetPCurve (const TopoDS_Shape& aNewFace, TopoDS_Shape& aNewEdge, const TopoDS_Shape& aGenF, const TopoDS_Shape& aGenE, const Sweep_NumShape& aDirV, const TopAbs_Orientation orien) = 0; |
115 | |
116 | //! Sets the PCurve for a new edge on a new face. The |
117 | //! new edge and the new face were generated using |
118 | //! aGenE, aDirE and aDirV. |
119 | Standard_EXPORT virtual void SetGeneratingPCurve (const TopoDS_Shape& aNewFace, TopoDS_Shape& aNewEdge, const TopoDS_Shape& aGenE, const Sweep_NumShape& aDirE, const Sweep_NumShape& aDirV, const TopAbs_Orientation orien) = 0; |
120 | |
121 | //! Sets the PCurve for a new edge on a new face. The |
122 | //! new edge and the new face were generated using |
123 | //! aGenE, aDirE and aGenV. |
124 | Standard_EXPORT virtual void SetDirectingPCurve (const TopoDS_Shape& aNewFace, TopoDS_Shape& aNewEdge, const TopoDS_Shape& aGenE, const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirE, const TopAbs_Orientation orien) = 0; |
125 | |
126 | //! Returns the Orientation of the shell in the solid |
127 | //! generated by the face aGenS with the edge aDirS. |
128 | //! It is REVERSED if the surface is swept in the |
129 | //! direction of the normal. |
130 | Standard_EXPORT virtual TopAbs_Orientation DirectSolid (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS) = 0; |
131 | |
132 | //! Returns true if aNewSubShape (addressed by |
133 | //! aSubGenS and aDirS) must be added in aNewShape |
134 | //! (addressed by aGenS and aDirS). |
135 | Standard_EXPORT virtual Standard_Boolean GGDShapeIsToAdd (const TopoDS_Shape& aNewShape, const TopoDS_Shape& aNewSubShape, const TopoDS_Shape& aGenS, const TopoDS_Shape& aSubGenS, const Sweep_NumShape& aDirS) const = 0; |
136 | |
137 | //! Returns true if aNewSubShape (addressed by |
138 | //! aGenS and aSubDirS) must be added in aNewShape |
139 | //! (addressed by aGenS and aDirS). |
140 | Standard_EXPORT virtual Standard_Boolean GDDShapeIsToAdd (const TopoDS_Shape& aNewShape, const TopoDS_Shape& aNewSubShape, const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS, const Sweep_NumShape& aSubDirS) const = 0; |
141 | |
142 | //! In some particular cases the topology of a |
b81b237f |
143 | //! generated face must be composed of independent |
42cf5bc1 |
144 | //! closed wires, in this case this function returns |
145 | //! true. |
146 | Standard_EXPORT virtual Standard_Boolean SeparatedWires (const TopoDS_Shape& aNewShape, const TopoDS_Shape& aNewSubShape, const TopoDS_Shape& aGenS, const TopoDS_Shape& aSubGenS, const Sweep_NumShape& aDirS) const = 0; |
147 | |
148 | //! In some particular cases the topology of a |
b81b237f |
149 | //! generated Shell must be composed of independent |
42cf5bc1 |
150 | //! closed Shells, in this case this function returns |
b81b237f |
151 | //! a Compound of independent Shells. |
42cf5bc1 |
152 | Standard_EXPORT virtual TopoDS_Shape SplitShell (const TopoDS_Shape& aNewShape) const; |
153 | |
154 | //! Called to propagate the continuity of every vertex |
155 | //! between two edges of the generating wire aGenS on |
156 | //! the generated edge and faces. |
157 | Standard_EXPORT virtual void SetContinuity (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS) = 0; |
158 | |
159 | //! Returns true if aDirS and aGenS addresses a |
160 | //! resulting Shape. In some specific cases the shape |
161 | //! can be geometrically inexsistant, then this |
162 | //! function returns false. |
163 | Standard_EXPORT virtual Standard_Boolean HasShape (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS) const = 0; |
80eeb3ce |
164 | |
165 | //! Returns true if aGenS cannot be transformed. |
166 | Standard_EXPORT virtual Standard_Boolean IsInvariant(const TopoDS_Shape& aGenS) const = 0; |
167 | |
42cf5bc1 |
168 | //! Returns the resulting Shape indexed by aDirS and |
169 | //! aGenS. |
170 | Standard_EXPORT TopoDS_Shape Shape (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS); |
171 | |
172 | //! Returns the resulting Shape indexed by myDirWire |
173 | //! and aGenS. |
174 | Standard_EXPORT TopoDS_Shape Shape (const TopoDS_Shape& aGenS); |
80eeb3ce |
175 | |
176 | //! Returns true if the initial shape aGenS |
177 | //! is used in result shape |
178 | Standard_EXPORT Standard_Boolean IsUsed(const TopoDS_Shape& aGenS) const; |
179 | |
180 | //! Returns true if the shape, generated from theS |
181 | //! is used in result shape |
182 | Standard_EXPORT Standard_Boolean GenIsUsed(const TopoDS_Shape& theS) const; |
183 | |
42cf5bc1 |
184 | //! Returns the resulting Shape indexed by myDirWire |
185 | //! and myGenShape. |
186 | Standard_EXPORT TopoDS_Shape Shape(); |
187 | |
188 | //! Returns the resulting Shape indexed by the first |
189 | //! Vertex of myDirWire and myGenShape. |
190 | Standard_EXPORT TopoDS_Shape FirstShape(); |
191 | |
192 | //! Returns the resulting Shape indexed by the last |
193 | //! Vertex of myDirWire and myGenShape. |
194 | Standard_EXPORT TopoDS_Shape LastShape(); |
195 | |
196 | //! Returns the resulting Shape indexed by the first |
197 | //! Vertex of myDirWire and aGenS. |
198 | Standard_EXPORT TopoDS_Shape FirstShape (const TopoDS_Shape& aGenS); |
199 | |
200 | //! Returns the resulting Shape indexed by the last |
201 | //! Vertex of myDirWire and aGenS. |
202 | Standard_EXPORT TopoDS_Shape LastShape (const TopoDS_Shape& aGenS); |
203 | |
204 | Standard_EXPORT Standard_Boolean Closed() const; |
205 | |
206 | |
207 | |
208 | |
209 | protected: |
210 | |
211 | |
212 | //! Creates a NumLinearRegularSweep. <aBuilder> gives |
213 | //! basic topological services. |
214 | Standard_EXPORT BRepSweep_NumLinearRegularSweep(const BRepSweep_Builder& aBuilder, const TopoDS_Shape& aGenShape, const Sweep_NumShape& aDirWire); |
215 | |
216 | |
217 | BRepSweep_Builder myBuilder; |
218 | TopoDS_Shape myGenShape; |
219 | Sweep_NumShape myDirWire; |
220 | BRepSweep_Tool myGenShapeTool; |
221 | Sweep_NumShapeTool myDirShapeTool; |
222 | TopTools_Array2OfShape myShapes; |
223 | TColStd_Array2OfBoolean myBuiltShapes; |
80eeb3ce |
224 | TColStd_Array2OfBoolean myUsedShapes; |
42cf5bc1 |
225 | |
226 | |
227 | private: |
228 | |
229 | |
230 | |
231 | |
232 | |
233 | }; |
234 | |
235 | |
236 | |
237 | |
238 | |
239 | |
240 | |
241 | #endif // _BRepSweep_NumLinearRegularSweep_HeaderFile |