42cf5bc1 |
1 | // Created on: 1993-06-08 |
2 | // Created by: Laurent BOURESCHE |
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_Trsf_HeaderFile |
18 | #define _BRepSweep_Trsf_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <TopLoc_Location.hxx> |
25 | #include <Standard_Boolean.hxx> |
26 | #include <BRepSweep_NumLinearRegularSweep.hxx> |
27 | #include <TopAbs_Orientation.hxx> |
28 | class BRep_Builder; |
29 | class TopoDS_Shape; |
30 | class Sweep_NumShape; |
31 | class TopLoc_Location; |
32 | |
33 | |
34 | //! This class is inherited from NumLinearRegularSweep |
35 | //! to implement the simple swept primitives built |
36 | //! moving a Shape with a Trsf. It often is possible |
37 | //! to build the constructed subshapes by a simple |
38 | //! move of the generating subshapes (shared topology |
39 | //! and geometry). So two ways of construction are |
40 | //! proposed : |
41 | //! |
42 | //! - sharing basis elements (the generatrice can be |
43 | //! modified , for exemples PCurves can be added on |
44 | //! faces); |
45 | //! |
46 | //! - copying everything. |
47 | class BRepSweep_Trsf : public BRepSweep_NumLinearRegularSweep |
48 | { |
49 | public: |
50 | |
51 | DEFINE_STANDARD_ALLOC |
52 | |
53 | |
54 | //! ends the construction of the swept primitive |
55 | //! calling the virtual geometric functions that can't |
56 | //! be called in the initialize. |
57 | Standard_EXPORT void Init(); |
58 | |
59 | //! function called to analize the way of construction |
60 | //! of the shapes generated by aGenS and aDirV. |
61 | Standard_EXPORT Standard_Boolean Process (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirV); |
62 | |
63 | //! Builds the vertex addressed by [aGenV,aDirV], with its |
64 | //! geometric part, but without subcomponents. |
65 | Standard_EXPORT virtual TopoDS_Shape MakeEmptyVertex (const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirV) = 0; |
66 | |
67 | //! Builds the edge addressed by [aGenV,aDirE], with its |
68 | //! geometric part, but without subcomponents. |
69 | Standard_EXPORT virtual TopoDS_Shape MakeEmptyDirectingEdge (const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirE) = 0; |
70 | |
71 | //! Builds the edge addressed by [aGenE,aDirV], with its |
72 | //! geometric part, but without subcomponents. |
73 | Standard_EXPORT virtual TopoDS_Shape MakeEmptyGeneratingEdge (const TopoDS_Shape& aGenE, const Sweep_NumShape& aDirV) = 0; |
74 | |
75 | //! Sets the parameters of the new vertex on the new |
76 | //! face. The new face and new vertex where generated |
77 | //! from aGenF, aGenV and aDirV . |
78 | 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; |
79 | |
80 | //! Sets the parameter of the new vertex on the new |
81 | //! edge. The new edge and new vertex where generated |
82 | //! from aGenV aDirE, and aDirV. |
83 | 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; |
84 | |
85 | //! Sets the parameter of the new vertex on the new |
86 | //! edge. The new edge and new vertex where generated |
87 | //! from aGenE, aGenV and aDirV . |
88 | 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; |
89 | |
90 | //! Builds the face addressed by [aGenS,aDirS], with |
91 | //! its geometric part, but without subcomponents. The |
92 | //! couple aGenS, aDirS can be a "generating face and |
93 | //! a directing vertex" or "a generating edge and a |
94 | //! directing edge". |
95 | Standard_EXPORT virtual TopoDS_Shape MakeEmptyFace (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS) = 0; |
96 | |
97 | //! Sets the PCurve for a new edge on a new face. The |
98 | //! new edge and the new face were generated using |
99 | //! aGenF, aGenE and aDirV. |
100 | 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; |
101 | |
102 | //! Sets the PCurve for a new edge on a new face. The |
103 | //! new edge and the new face were generated using |
104 | //! aGenE, aDirE and aDirV. |
105 | 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; |
106 | |
107 | //! Sets the PCurve for a new edge on a new face. The |
108 | //! new edge and the new face were generated using |
109 | //! aGenE, aDirE and aGenV. |
110 | 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; |
111 | |
112 | //! Returns true if aNewSubShape (addressed by |
113 | //! aSubGenS and aDirS) must be added in aNewShape |
114 | //! (addressed by aGenS and aDirS). |
115 | 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; |
116 | |
117 | //! Returns true if aNewSubShape (addressed by |
118 | //! aGenS and aSubDirS) must be added in aNewShape |
119 | //! (addressed by aGenS and aDirS). |
120 | 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; |
121 | |
122 | //! In some particular cases the topology of a |
123 | //! generated face must be composed of independant |
124 | //! closed wires, in this case this function returns |
125 | //! true. |
126 | 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; |
127 | |
128 | //! Returns true if aDirS and aGenS addresses a |
129 | //! resulting Shape. In some specific cases the shape |
130 | //! can be geometrically inexsistant, then this |
131 | //! function returns false. |
132 | Standard_EXPORT virtual Standard_Boolean HasShape (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS) const = 0; |
133 | |
134 | //! Returns true if the geometry of aGenS is not |
135 | //! modified by the trsf of the BRepSweep Trsf. |
136 | Standard_EXPORT virtual Standard_Boolean IsInvariant (const TopoDS_Shape& aGenS) const = 0; |
137 | |
138 | //! Called to propagate the continuity of every vertex |
139 | //! between two edges of the generating wire aGenS on |
140 | //! the generated edge and faces. |
141 | Standard_EXPORT void SetContinuity (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS); |
142 | |
143 | |
144 | |
145 | |
146 | protected: |
147 | |
148 | |
149 | //! Initialize the Trsf BrepSweep, if aCopy is true |
150 | //! the basis elements are shared as often as |
151 | //! possible, else everything is copied. |
152 | Standard_EXPORT BRepSweep_Trsf(const BRep_Builder& aBuilder, const TopoDS_Shape& aGenShape, const Sweep_NumShape& aDirWire, const TopLoc_Location& aLocation, const Standard_Boolean aCopy); |
153 | |
154 | |
155 | TopLoc_Location myLocation; |
156 | Standard_Boolean myCopy; |
157 | |
158 | |
159 | private: |
160 | |
161 | |
162 | |
163 | |
164 | |
165 | }; |
166 | |
167 | |
168 | |
169 | |
170 | |
171 | |
172 | |
173 | #endif // _BRepSweep_Trsf_HeaderFile |