42cf5bc1 |
1 | // Created on: 1993-02-03 |
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_Translation_HeaderFile |
18 | #define _BRepSweep_Translation_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <gp_Vec.hxx> |
25 | #include <Standard_Boolean.hxx> |
26 | #include <BRepSweep_Trsf.hxx> |
27 | #include <TopAbs_Orientation.hxx> |
28 | class Standard_ConstructionError; |
29 | class TopoDS_Shape; |
30 | class Sweep_NumShape; |
31 | class TopLoc_Location; |
32 | class gp_Vec; |
33 | |
34 | |
35 | //! Provides an algorithm to build object by |
36 | //! translation sweep. |
37 | class BRepSweep_Translation : public BRepSweep_Trsf |
38 | { |
39 | public: |
40 | |
41 | DEFINE_STANDARD_ALLOC |
42 | |
43 | |
44 | //! Creates a topology by translating <S> with the |
45 | //! vector <V>. If C is true S Sucomponents are |
46 | //! copied. If Canonize is true then generated surfaces |
47 | //! are attempted to be canonized in simple types |
48 | Standard_EXPORT BRepSweep_Translation(const TopoDS_Shape& S, const Sweep_NumShape& N, const TopLoc_Location& L, const gp_Vec& V, const Standard_Boolean C, const Standard_Boolean Canonize = Standard_True); |
49 | |
50 | //! Builds the vertex addressed by [aGenV,aDirV], with its |
51 | //! geometric part, but without subcomponents. |
52 | Standard_EXPORT TopoDS_Shape MakeEmptyVertex (const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirV); |
53 | |
54 | //! Builds the edge addressed by [aGenV,aDirE], with its |
55 | //! geometric part, but without subcomponents. |
56 | Standard_EXPORT TopoDS_Shape MakeEmptyDirectingEdge (const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirE); |
57 | |
58 | //! Builds the edge addressed by [aGenE,aDirV], with its |
59 | //! geometric part, but without subcomponents. |
60 | Standard_EXPORT TopoDS_Shape MakeEmptyGeneratingEdge (const TopoDS_Shape& aGenE, const Sweep_NumShape& aDirV); |
61 | |
62 | //! Sets the parameters of the new vertex on the new |
63 | //! face. The new face and new vertex where generated |
64 | //! from aGenF, aGenV and aDirV . |
65 | Standard_EXPORT void SetParameters (const TopoDS_Shape& aNewFace, TopoDS_Shape& aNewVertex, const TopoDS_Shape& aGenF, const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirV); |
66 | |
67 | //! Sets the parameter of the new vertex on the new |
68 | //! edge. The new edge and new vertex where generated |
69 | //! from aGenV aDirE, and aDirV. |
70 | Standard_EXPORT void SetDirectingParameter (const TopoDS_Shape& aNewEdge, TopoDS_Shape& aNewVertex, const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirE, const Sweep_NumShape& aDirV); |
71 | |
72 | //! Sets the parameter of the new vertex on the new |
73 | //! edge. The new edge and new vertex where generated |
74 | //! from aGenE, aGenV and aDirV . |
75 | Standard_EXPORT void SetGeneratingParameter (const TopoDS_Shape& aNewEdge, TopoDS_Shape& aNewVertex, const TopoDS_Shape& aGenE, const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirV); |
76 | |
77 | //! Builds the face addressed by [aGenS,aDirS], with |
78 | //! its geometric part, but without subcomponents. The |
79 | //! couple aGenS, aDirS can be a "generating face and |
80 | //! a directing vertex" or "a generating edge and a |
81 | //! directing edge". |
82 | Standard_EXPORT TopoDS_Shape MakeEmptyFace (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS); |
83 | |
84 | //! Sets the PCurve for a new edge on a new face. The |
85 | //! new edge and the new face were generated using |
86 | //! aGenF, aGenE and aDirV. |
87 | Standard_EXPORT 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); |
88 | |
89 | //! Sets the PCurve for a new edge on a new face. The |
90 | //! new edge and the new face were generated using |
91 | //! aGenE, aDirE and aDirV. |
92 | Standard_EXPORT 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); |
93 | |
94 | //! Sets the PCurve for a new edge on a new face. The |
95 | //! new edge and the new face were generated using |
96 | //! aGenE, aDirE and aGenV. |
97 | Standard_EXPORT 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); |
98 | |
99 | //! Returns the Orientation of the shell in the solid |
100 | //! generated by the face aGenS with the edge aDirS. |
101 | //! It is REVERSED if the surface is swept in the |
102 | //! direction of the normal. |
103 | Standard_EXPORT TopAbs_Orientation DirectSolid (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS); |
104 | |
105 | //! Returns true if aNewSubShape (addressed by |
106 | //! aSubGenS and aDirS) must be added in aNewShape |
107 | //! (addressed by aGenS and aDirS). |
108 | Standard_EXPORT Standard_Boolean GGDShapeIsToAdd (const TopoDS_Shape& aNewShape, const TopoDS_Shape& aNewSubShape, const TopoDS_Shape& aGenS, const TopoDS_Shape& aSubGenS, const Sweep_NumShape& aDirS) const; |
109 | |
110 | //! Returns true if aNewSubShape (addressed by |
111 | //! aGenS and aSubDirS) must be added in aNewShape |
112 | //! (addressed by aGenS and aDirS). |
113 | Standard_EXPORT Standard_Boolean GDDShapeIsToAdd (const TopoDS_Shape& aNewShape, const TopoDS_Shape& aNewSubShape, const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS, const Sweep_NumShape& aSubDirS) const; |
114 | |
115 | //! In some particular cases the topology of a |
116 | //! generated face must be composed of independant |
117 | //! closed wires, in this case this function returns |
118 | //! true. |
119 | //! Here it always returns false. |
120 | Standard_EXPORT Standard_Boolean SeparatedWires (const TopoDS_Shape& aNewShape, const TopoDS_Shape& aNewSubShape, const TopoDS_Shape& aGenS, const TopoDS_Shape& aSubGenS, const Sweep_NumShape& aDirS) const; |
121 | |
122 | //! Returns true if aDirS and aGenS addresses a |
123 | //! resulting Shape. In some specific cases the shape |
124 | //! can be geometrically inexsistant, then this |
125 | //! function returns false. |
126 | Standard_EXPORT Standard_Boolean HasShape (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS) const; |
127 | |
128 | //! Returns always false because here the |
129 | //! transformation is a translation. |
130 | Standard_EXPORT Standard_Boolean IsInvariant (const TopoDS_Shape& aGenS) const; |
131 | |
132 | //! Returns the Vector of the Prism, if it is an infinite |
133 | //! prism the Vec is unitar. |
134 | Standard_EXPORT gp_Vec Vec() const; |
135 | |
136 | |
137 | |
138 | |
139 | protected: |
140 | |
141 | |
142 | |
143 | |
144 | |
145 | private: |
146 | |
147 | |
148 | |
149 | gp_Vec myVec; |
150 | Standard_Boolean myCanonize; |
151 | |
152 | |
153 | }; |
154 | |
155 | |
156 | |
157 | |
158 | |
159 | |
160 | |
161 | #endif // _BRepSweep_Translation_HeaderFile |