b311480e |
1 | -- Created on: 1995-07-17 |
2 | -- Created by: Jing-Cheng MEI |
3 | -- Copyright (c) 1995-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. |
b311480e |
16 | |
7fd59977 |
17 | -- Modified: Mon Jan 12 10:46:37 1998 |
7fd59977 |
18 | -- new method ArrangeWires |
19 | -- Modified: Mon Jan 19 10:11:49 1998 |
7fd59977 |
20 | -- new methods CreateKPart and DetectKPart |
21 | -- Modified: Mon Feb 23 09:28:33 1998 |
7fd59977 |
22 | -- modification of ArrangeWires |
23 | -- for sections with different number of elements |
24 | -- Modified: Mon Apr 6 16:24:40 1998 |
7fd59977 |
25 | -- CreateKPart and DetectKPart moved in BRepFill |
26 | -- Modified: Wed Jul 1 14:33:22 1998 |
7fd59977 |
27 | -- Add history |
28 | -- CreateKPart and DetectKPart moved in BRepFill |
7fd59977 |
29 | |
30 | |
31 | |
32 | class ThruSections from BRepOffsetAPI inherits MakeShape from BRepBuilderAPI |
33 | |
34 | ---Purpose: Describes functions to build a loft. This is a shell or a |
35 | -- solid passing through a set of sections in a given |
36 | -- sequence. Usually sections are wires, but the first and |
37 | -- the last sections may be vertices (punctual sections). |
38 | |
39 | uses |
40 | |
41 | Wire from TopoDS, |
42 | Vertex from TopoDS, |
43 | SequenceOfShape from TopTools, |
44 | Face from TopoDS, |
45 | Shape from TopoDS, |
46 | DataMapOfShapeShape from TopTools, |
47 | Array1OfShape from TopTools, |
48 | BSplineSurface from Geom, |
49 | -- |
50 | Shape from GeomAbs, |
51 | ParametrizationType from Approx |
52 | |
53 | raises DomainError from Standard |
54 | |
55 | is |
56 | |
57 | Create(isSolid : Boolean from Standard = Standard_False; |
58 | ruled : Boolean from Standard = Standard_False; |
59 | pres3d : Real =1.0e-06) |
60 | returns ThruSections from BRepOffsetAPI; |
61 | ---Purpose: Initializes an algorithm for building a shell or a solid |
62 | -- passing through a set of sections, where: |
63 | -- - isSolid is set to true if the construction algorithm is |
64 | -- required to build a solid or to false if it is required to build |
65 | -- a shell (the default value), |
66 | -- - ruled is set to true if the faces generated between |
67 | -- the edges of two consecutive wires are ruled surfaces or to |
68 | -- false (the default value) if they are smoothed out by approximation, |
69 | -- - pres3d defines the precision criterion used by the |
70 | -- approximation algorithm; the default value is 1.0e-6. |
71 | -- Use AddWire and AddVertex to define the |
72 | -- successive sections of the shell or solid to be built. |
73 | |
74 | Init(me: in out; isSolid : Boolean from Standard = Standard_False; |
75 | ruled : Boolean from Standard = Standard_False; |
76 | pres3d : Real =1.0e-06); |
77 | ---Purpose: Initializes this algorithm for building a shell or a solid |
78 | -- passing through a set of sections, where: |
79 | -- - isSolid is set to true if this construction algorithm is |
80 | -- required to build a solid or to false if it is required to |
81 | -- build a shell. false is the default value; |
82 | -- - ruled is set to true if the faces generated between the |
83 | -- edges of two consecutive wires are ruled surfaces or |
84 | -- to false (the default value) if they are smoothed out by approximation, |
85 | -- - pres3d defines the precision criterion used by the |
86 | -- approximation algorithm; the default value is 1.0e-6. |
87 | -- Use AddWire and AddVertex to define the successive |
88 | -- sections of the shell or solid to be built. |
89 | |
90 | AddWire(me: in out; wire: Wire from TopoDS); |
91 | ---Purpose: Adds the wire wire to the set of |
92 | -- sections through which the shell or solid is built. |
93 | -- Use the Build function to construct the shape. |
94 | |
95 | AddVertex(me: in out; aVertex: Vertex from TopoDS); |
96 | ---Purpose: Adds the vertex Vertex (punctual section) to the set of sections |
97 | -- through which the shell or solid is built. A vertex may be added to the |
98 | -- set of sections only as first or last section. At least one wire |
99 | -- must be added to the set of sections by the method AddWire. |
100 | -- Use the Build function to construct the shape. |
101 | |
102 | CheckCompatibility(me: in out; |
103 | check : Boolean from Standard = Standard_True); |
172f6352 |
104 | ---Purpose: Sets/unsets the option to |
105 | -- compute origin and orientation on wires to avoid twisted results |
106 | -- and update wires to have same number of edges. |
7fd59977 |
107 | |
108 | SetSmoothing(me: in out; UseSmoothing : Boolean from Standard) |
109 | ---Purpose: Define the approximation algorithm |
110 | is static; |
111 | |
112 | SetParType(me: in out; ParType : ParametrizationType from Approx) |
113 | ---Purpose: Define the type of parametrization used in the approximation |
114 | is static; |
115 | |
116 | |
117 | SetContinuity(me: in out; C : Shape from GeomAbs) |
118 | ---Purpose: Define the Continuity used in the approximation |
119 | is static; |
120 | |
121 | SetCriteriumWeight(me : in out; |
122 | W1, W2, W3 : Real) |
123 | ---Purpose: define the Weights associed to the criterium used in |
124 | -- the optimization. |
125 | -- |
126 | raises DomainError -- if Wi <= 0 |
127 | is static; |
128 | |
129 | SetMaxDegree(me : in out; MaxDeg : Integer from Standard) |
130 | ---Purpose: Define the maximal U degree of result surface |
131 | is static; |
132 | |
133 | ParType(me) |
134 | ---Purpose: returns the type of parametrization used in the approximation |
135 | returns ParametrizationType from Approx |
136 | is static; |
137 | |
138 | |
139 | Continuity(me) |
140 | ---Purpose: returns the Continuity used in the approximation |
141 | returns Shape from GeomAbs |
142 | is static; |
143 | |
144 | MaxDegree(me) |
145 | ---Purpose: returns the maximal U degree of result surface |
146 | returns Integer from Standard |
147 | is static; |
148 | |
149 | UseSmoothing(me) |
150 | ---Purpose: Define the approximation algorithm |
151 | returns Boolean from Standard |
152 | is static; |
153 | |
154 | CriteriumWeight(me ; W1, W2, W3 : out Real) |
155 | ---Purpose: returns the Weights associed to the criterium used in |
156 | -- the optimization. |
157 | is static; |
158 | |
159 | Build(me: in out) |
160 | is redefined; |
161 | |
162 | CreateRuled(me: in out) |
163 | is private; |
164 | |
165 | CreateSmoothed(me: in out) |
166 | is private; |
167 | |
168 | FirstShape (me) |
169 | ---Purpose: Returns the TopoDS Shape of the bottom of the loft if solid |
170 | returns Shape from TopoDS; |
171 | ---C++ : return const & |
172 | |
173 | LastShape (me) |
174 | ---Purpose: Returns the TopoDS Shape of the top of the loft if solid |
175 | returns Shape from TopoDS; |
176 | ---C++ : return const & |
177 | |
178 | GeneratedFace (me; Edge : Shape from TopoDS) |
179 | ---Purpose: if Ruled |
180 | -- Returns the Face generated by each edge |
181 | -- except the last wire |
182 | -- if smoothed |
183 | -- Returns the Face generated by each edge of the first wire |
184 | returns Shape from TopoDS; |
185 | |
186 | TotalSurf(me; shapes: Array1OfShape from TopTools; |
187 | NbSect: Integer from Standard; |
188 | NbEdges: Integer from Standard; |
189 | w1Point: Boolean from Standard; |
190 | w2Point: Boolean from Standard; |
191 | vClosed: Boolean from Standard) |
192 | |
193 | returns BSplineSurface from Geom |
194 | is private; |
195 | |
196 | fields |
197 | myWires : SequenceOfShape from TopTools; |
198 | myIsSolid : Boolean from Standard; |
199 | myIsRuled : Boolean from Standard; |
200 | myWCheck : Boolean from Standard; |
201 | myPres3d : Real from Standard; |
202 | myFirst : Face from TopoDS; |
203 | myLast : Face from TopoDS; |
204 | myGenerated : DataMapOfShapeShape from TopTools; |
205 | -- Approximation parameters |
206 | myContinuity: Shape from GeomAbs; |
207 | myParamType : ParametrizationType from Approx; |
208 | myDegMax : Integer from Standard; |
209 | myCritWeights : Real[3]; |
210 | myUseSmoothing : Boolean from Standard; |
211 | |
212 | end ThruSections; |
213 | |