1 -- Created on: 1995-07-17
2 -- Created by: Jing-Cheng MEI
3 -- Copyright (c) 1995-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
21 -- Modified: Mon Jan 12 10:46:37 1998
22 -- new method ArrangeWires
23 -- Modified: Mon Jan 19 10:11:49 1998
24 -- new methods CreateKPart and DetectKPart
25 -- Modified: Mon Feb 23 09:28:33 1998
26 -- modification of ArrangeWires
27 -- for sections with different number of elements
28 -- Modified: Mon Apr 6 16:24:40 1998
29 -- CreateKPart and DetectKPart moved in BRepFill
30 -- Modified: Wed Jul 1 14:33:22 1998
32 -- CreateKPart and DetectKPart moved in BRepFill
36 class ThruSections from BRepOffsetAPI inherits MakeShape from BRepBuilderAPI
38 ---Purpose: Describes functions to build a loft. This is a shell or a
39 -- solid passing through a set of sections in a given
40 -- sequence. Usually sections are wires, but the first and
41 -- the last sections may be vertices (punctual sections).
47 SequenceOfShape from TopTools,
50 DataMapOfShapeShape from TopTools,
51 Array1OfShape from TopTools,
52 BSplineSurface from Geom,
55 ParametrizationType from Approx
57 raises DomainError from Standard
61 Create(isSolid : Boolean from Standard = Standard_False;
62 ruled : Boolean from Standard = Standard_False;
63 pres3d : Real =1.0e-06)
64 returns ThruSections from BRepOffsetAPI;
65 ---Purpose: Initializes an algorithm for building a shell or a solid
66 -- passing through a set of sections, where:
67 -- - isSolid is set to true if the construction algorithm is
68 -- required to build a solid or to false if it is required to build
69 -- a shell (the default value),
70 -- - ruled is set to true if the faces generated between
71 -- the edges of two consecutive wires are ruled surfaces or to
72 -- false (the default value) if they are smoothed out by approximation,
73 -- - pres3d defines the precision criterion used by the
74 -- approximation algorithm; the default value is 1.0e-6.
75 -- Use AddWire and AddVertex to define the
76 -- successive sections of the shell or solid to be built.
78 Init(me: in out; isSolid : Boolean from Standard = Standard_False;
79 ruled : Boolean from Standard = Standard_False;
80 pres3d : Real =1.0e-06);
81 ---Purpose: Initializes this algorithm for building a shell or a solid
82 -- passing through a set of sections, where:
83 -- - isSolid is set to true if this construction algorithm is
84 -- required to build a solid or to false if it is required to
85 -- build a shell. false is the default value;
86 -- - ruled is set to true if the faces generated between the
87 -- edges of two consecutive wires are ruled surfaces or
88 -- to false (the default value) if they are smoothed out by approximation,
89 -- - pres3d defines the precision criterion used by the
90 -- approximation algorithm; the default value is 1.0e-6.
91 -- Use AddWire and AddVertex to define the successive
92 -- sections of the shell or solid to be built.
94 AddWire(me: in out; wire: Wire from TopoDS);
95 ---Purpose: Adds the wire wire to the set of
96 -- sections through which the shell or solid is built.
97 -- Use the Build function to construct the shape.
99 AddVertex(me: in out; aVertex: Vertex from TopoDS);
100 ---Purpose: Adds the vertex Vertex (punctual section) to the set of sections
101 -- through which the shell or solid is built. A vertex may be added to the
102 -- set of sections only as first or last section. At least one wire
103 -- must be added to the set of sections by the method AddWire.
104 -- Use the Build function to construct the shape.
106 CheckCompatibility(me: in out;
107 check : Boolean from Standard = Standard_True);
109 SetSmoothing(me: in out; UseSmoothing : Boolean from Standard)
110 ---Purpose: Define the approximation algorithm
113 SetParType(me: in out; ParType : ParametrizationType from Approx)
114 ---Purpose: Define the type of parametrization used in the approximation
118 SetContinuity(me: in out; C : Shape from GeomAbs)
119 ---Purpose: Define the Continuity used in the approximation
122 SetCriteriumWeight(me : in out;
124 ---Purpose: define the Weights associed to the criterium used in
127 raises DomainError -- if Wi <= 0
130 SetMaxDegree(me : in out; MaxDeg : Integer from Standard)
131 ---Purpose: Define the maximal U degree of result surface
135 ---Purpose: returns the type of parametrization used in the approximation
136 returns ParametrizationType from Approx
141 ---Purpose: returns the Continuity used in the approximation
142 returns Shape from GeomAbs
146 ---Purpose: returns the maximal U degree of result surface
147 returns Integer from Standard
151 ---Purpose: Define the approximation algorithm
152 returns Boolean from Standard
155 CriteriumWeight(me ; W1, W2, W3 : out Real)
156 ---Purpose: returns the Weights associed to the criterium used in
163 CreateRuled(me: in out)
166 CreateSmoothed(me: in out)
170 ---Purpose: Returns the TopoDS Shape of the bottom of the loft if solid
171 returns Shape from TopoDS;
172 ---C++ : return const &
175 ---Purpose: Returns the TopoDS Shape of the top of the loft if solid
176 returns Shape from TopoDS;
177 ---C++ : return const &
179 GeneratedFace (me; Edge : Shape from TopoDS)
181 -- Returns the Face generated by each edge
182 -- except the last wire
184 -- Returns the Face generated by each edge of the first wire
185 returns Shape from TopoDS;
187 TotalSurf(me; shapes: Array1OfShape from TopTools;
188 NbSect: Integer from Standard;
189 NbEdges: Integer from Standard;
190 w1Point: Boolean from Standard;
191 w2Point: Boolean from Standard;
192 vClosed: Boolean from Standard)
194 returns BSplineSurface from Geom
198 myWires : SequenceOfShape from TopTools;
199 myIsSolid : Boolean from Standard;
200 myIsRuled : Boolean from Standard;
201 myWCheck : Boolean from Standard;
202 myPres3d : Real from Standard;
203 myFirst : Face from TopoDS;
204 myLast : Face from TopoDS;
205 myGenerated : DataMapOfShapeShape from TopTools;
206 -- Approximation parameters
207 myContinuity: Shape from GeomAbs;
208 myParamType : ParametrizationType from Approx;
209 myDegMax : Integer from Standard;
210 myCritWeights : Real[3];
211 myUseSmoothing : Boolean from Standard;