b311480e |
1 | -- Created on: 1993-02-03 |
2 | -- Created by: Laurent BOURESCHE |
3 | -- Copyright (c) 1993-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | class Translation from BRepSweep inherits Trsf from BRepSweep |
18 | |
19 | ---Purpose: Provides an algorithm to build object by |
20 | -- translation sweep. |
21 | |
22 | uses |
23 | Vec from gp, |
24 | Location from TopLoc, |
25 | Shape from TopoDS, |
26 | NumShape from Sweep, |
27 | Orientation from TopAbs |
28 | |
29 | raises |
30 | |
31 | ConstructionError from Standard |
32 | |
33 | is |
34 | Create (S : Shape from TopoDS; |
35 | N : NumShape from Sweep; |
36 | L : Location from TopLoc; |
37 | V : Vec from gp; |
38 | C : Boolean from Standard; |
39 | Canonize: Boolean from Standard = Standard_True) |
40 | returns Translation from BRepSweep |
41 | ---Purpose: Creates a topology by translating <S> with the |
42 | -- vector <V>. If C is true S Sucomponents are |
43 | -- copied. If Canonize is true then generated surfaces |
44 | -- are attempted to be canonized in simple types |
45 | raises |
46 | ConstructionError from Standard; -- if <V> is null |
47 | |
7fd59977 |
48 | -- """""""""""""""""""""""""""""""""""""""""""""""""""""" |
49 | -- Methods supporting the creation of the geometric part. |
50 | -- """""""""""""""""""""""""""""""""""""""""""""""""""""" |
51 | |
52 | |
53 | MakeEmptyVertex(me : in out; |
54 | aGenV : Shape from TopoDS; |
55 | aDirV : NumShape from Sweep) |
56 | ---Purpose: Builds the vertex addressed by [aGenV,aDirV], with its |
57 | -- geometric part, but without subcomponents. |
58 | returns Shape from TopoDS; |
59 | |
60 | MakeEmptyDirectingEdge(me : in out; |
61 | aGenV : Shape from TopoDS; |
62 | aDirE : NumShape from Sweep) |
63 | ---Purpose: Builds the edge addressed by [aGenV,aDirE], with its |
64 | -- geometric part, but without subcomponents. |
65 | returns Shape from TopoDS; |
66 | |
67 | MakeEmptyGeneratingEdge(me : in out; |
68 | aGenE : Shape from TopoDS; |
69 | aDirV : NumShape from Sweep) |
70 | ---Purpose: Builds the edge addressed by [aGenE,aDirV], with its |
71 | -- geometric part, but without subcomponents. |
72 | returns Shape from TopoDS; |
73 | |
74 | SetParameters(me : in out; |
75 | aNewFace : Shape from TopoDS; |
76 | aNewVertex : in out Shape from TopoDS; |
77 | aGenF : Shape from TopoDS; |
78 | aGenV : Shape from TopoDS; |
79 | aDirV : NumShape from Sweep); |
80 | ---Purpose: Sets the parameters of the new vertex on the new |
81 | -- face. The new face and new vertex where generated |
82 | -- from aGenF, aGenV and aDirV . |
83 | |
84 | SetDirectingParameter(me : in out; |
85 | aNewEdge : Shape from TopoDS; |
86 | aNewVertex : in out Shape from TopoDS; |
87 | aGenV : Shape from TopoDS; |
88 | aDirE : NumShape from Sweep; |
89 | aDirV : NumShape from Sweep); |
90 | ---Purpose: Sets the parameter of the new vertex on the new |
91 | -- edge. The new edge and new vertex where generated |
92 | -- from aGenV aDirE, and aDirV. |
93 | |
94 | SetGeneratingParameter(me : in out; |
95 | aNewEdge : Shape from TopoDS; |
96 | aNewVertex : in out Shape from TopoDS; |
97 | aGenE : Shape from TopoDS; |
98 | aGenV : Shape from TopoDS; |
99 | aDirV : NumShape from Sweep); |
100 | ---Purpose: Sets the parameter of the new vertex on the new |
101 | -- edge. The new edge and new vertex where generated |
102 | -- from aGenE, aGenV and aDirV . |
103 | |
104 | MakeEmptyFace(me : in out; |
105 | aGenS : Shape from TopoDS; |
106 | aDirS : NumShape from Sweep) |
107 | ---Purpose: Builds the face addressed by [aGenS,aDirS], with |
108 | -- its geometric part, but without subcomponents. The |
109 | -- couple aGenS, aDirS can be a "generating face and |
110 | -- a directing vertex" or "a generating edge and a |
111 | -- directing edge". |
112 | returns Shape from TopoDS; |
113 | |
114 | SetPCurve(me : in out; |
115 | aNewFace : Shape from TopoDS; |
116 | aNewEdge : in out Shape from TopoDS; |
117 | aGenF : Shape from TopoDS; |
118 | aGenE : Shape from TopoDS; |
119 | aDirV : NumShape from Sweep; |
120 | orien : Orientation from TopAbs); |
121 | |
122 | ---Purpose: Sets the PCurve for a new edge on a new face. The |
123 | -- new edge and the new face were generated using |
124 | -- aGenF, aGenE and aDirV. |
125 | |
126 | SetGeneratingPCurve(me : in out; |
127 | aNewFace : Shape from TopoDS; |
128 | aNewEdge : in out Shape from TopoDS; |
129 | aGenE : Shape from TopoDS; |
130 | aDirE : NumShape from Sweep; |
131 | aDirV : NumShape from Sweep; |
132 | orien : Orientation from TopAbs); |
133 | ---Purpose: Sets the PCurve for a new edge on a new face. The |
134 | -- new edge and the new face were generated using |
135 | -- aGenE, aDirE and aDirV. |
136 | |
137 | SetDirectingPCurve(me : in out; |
138 | aNewFace : Shape from TopoDS; |
139 | aNewEdge : in out Shape from TopoDS; |
140 | aGenE : Shape from TopoDS; |
141 | aGenV : Shape from TopoDS; |
142 | aDirE : NumShape from Sweep; |
143 | orien : Orientation from TopAbs); |
144 | ---Purpose: Sets the PCurve for a new edge on a new face. The |
145 | -- new edge and the new face were generated using |
146 | -- aGenE, aDirE and aGenV. |
147 | |
148 | DirectSolid(me : in out; |
149 | aGenS : Shape from TopoDS; |
150 | aDirS : NumShape from Sweep) |
151 | returns Orientation from TopAbs; |
152 | ---Purpose: Returns the Orientation of the shell in the solid |
153 | -- generated by the face aGenS with the edge aDirS. |
154 | -- It is REVERSED if the surface is swept in the |
155 | -- direction of the normal. |
156 | |
157 | GGDShapeIsToAdd (me; |
158 | aNewShape : Shape from TopoDS; |
159 | aNewSubShape : Shape from TopoDS; |
160 | aGenS : Shape from TopoDS; |
161 | aSubGenS : Shape from TopoDS; |
162 | aDirS : NumShape from Sweep) |
163 | ---Purpose: Returns true if aNewSubShape (addressed by |
164 | -- aSubGenS and aDirS) must be added in aNewShape |
165 | -- (addressed by aGenS and aDirS). |
166 | returns Boolean from Standard; |
167 | |
168 | GDDShapeIsToAdd (me; |
169 | aNewShape : Shape from TopoDS; |
170 | aNewSubShape : Shape from TopoDS; |
171 | aGenS : Shape from TopoDS; |
172 | aDirS : NumShape from Sweep; |
173 | aSubDirS : NumShape from Sweep) |
174 | ---Purpose: Returns true if aNewSubShape (addressed by |
175 | -- aGenS and aSubDirS) must be added in aNewShape |
176 | -- (addressed by aGenS and aDirS). |
177 | returns Boolean from Standard; |
178 | |
179 | SeparatedWires (me; |
180 | aNewShape : Shape from TopoDS; |
181 | aNewSubShape : Shape from TopoDS; |
182 | aGenS : Shape from TopoDS; |
183 | aSubGenS : Shape from TopoDS; |
184 | aDirS : NumShape from Sweep) |
185 | ---Purpose: In some particular cases the topology of a |
186 | -- generated face must be composed of independant |
187 | -- closed wires, in this case this function returns |
188 | -- true. |
189 | -- Here it always returns false. |
190 | returns Boolean from Standard; |
191 | |
192 | HasShape(me; aGenS : Shape from TopoDS; aDirS : NumShape from Sweep) |
193 | ---Purpose: Returns true if aDirS and aGenS addresses a |
194 | -- resulting Shape. In some specific cases the shape |
195 | -- can be geometrically inexsistant, then this |
196 | -- function returns false. |
197 | returns Boolean from Standard; |
198 | |
199 | IsInvariant (me; aGenS : Shape from TopoDS) |
200 | ---Purpose: Returns always false because here the |
201 | -- transformation is a translation. |
202 | returns Boolean from Standard; |
203 | |
204 | Vec(me) |
205 | ---Purpose: Returns the Vector of the Prism, if it is an infinite |
206 | -- prism the Vec is unitar. |
207 | returns Vec from gp |
208 | is static; |
209 | |
210 | fields |
211 | |
212 | myVec : Vec from gp; |
213 | myCanonize : Boolean from Standard; |
214 | |
215 | end Translation; |