b311480e |
1 | -- Created on: 1994-06-07 |
2 | -- Created by: Bruno DUMORTIER |
3 | -- Copyright (c) 1994-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | -- |
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. |
10 | -- |
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. |
13 | -- |
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. |
20 | |
7fd59977 |
21 | |
22 | |
23 | |
24 | |
25 | class Pipe from BRepFill |
26 | |
27 | ---Purpose: Create a shape by sweeping a shape (the profile) |
28 | -- along a wire (the spine). |
29 | -- |
30 | -- For each edge or vertex from the spine the user |
31 | -- may ask for the shape generated from each subshape |
32 | -- of the profile. |
33 | |
34 | uses |
35 | |
36 | HArray2OfShape from TopTools, |
37 | LocationLaw from BRepFill, |
38 | Shape from TopoDS, |
39 | Face from TopoDS, |
40 | Wire from TopoDS, |
41 | Edge from TopoDS, |
42 | Vertex from TopoDS, |
43 | Pnt from gp, |
a31abc03 |
44 | Trsf from gp, |
45 | Trihedron from GeomFill |
7fd59977 |
46 | |
47 | raises |
48 | DomainError from Standard, |
49 | NotDone from StdFail |
50 | |
51 | is |
52 | |
53 | Create returns Pipe from BRepFill; |
54 | |
55 | Create ( Spine : Wire from TopoDS; |
56 | Profile : Shape from TopoDS; |
57 | GeneratePartCase : Boolean from Standard = Standard_False) |
58 | returns Pipe from BRepFill; |
59 | |
a31abc03 |
60 | SetMode(me : in out; |
61 | aMode : Trihedron from GeomFill); |
62 | ---Purpose: Set the mode of sweeping |
63 | -- It can be: |
64 | -- - Frenet |
65 | -- - Corrected Frenet |
66 | -- - Discrete Trihedron |
67 | -- By default the mode is Corrected Frenet |
68 | |
69 | SetForceApproxC1(me : in out; |
70 | ForceApproxC1 : Boolean from Standard); |
71 | ---Purpose: Set the flag that indicates attempt to approximate |
72 | -- a C1-continuous surface if a swept surface proved |
73 | -- to be C0. |
74 | |
7fd59977 |
75 | Perform (me : in out; Spine : Wire from TopoDS; |
76 | Profile : Shape from TopoDS; |
77 | GeneratePartCase : Boolean from Standard = Standard_False) |
78 | is static; |
79 | |
80 | Spine(me) returns Shape from TopoDS |
81 | ---C++ : return const & |
82 | is static; |
83 | |
84 | Profile(me) returns Shape from TopoDS |
85 | ---C++ : return const & |
86 | is static; |
87 | |
88 | Shape(me) returns Shape from TopoDS |
89 | ---C++ : return const & |
90 | is static; |
91 | |
92 | FirstShape(me) returns Shape from TopoDS |
93 | ---C++ : return const & |
94 | is static; |
95 | |
96 | LastShape(me) returns Shape from TopoDS |
97 | ---C++ : return const & |
98 | is static; |
99 | |
100 | Face(me : in out; ESpine, EProfile : Edge from TopoDS) |
101 | returns Face from TopoDS |
102 | ---Purpose: Returns the face created from an edge of the spine |
103 | -- and an edge of the profile. |
104 | raises |
105 | DomainError from Standard |
106 | ---Purpose: if the edges are not in the spine or the profile |
107 | |
108 | is static; |
109 | |
110 | Edge(me : in out; ESpine : Edge from TopoDS; VProfile : Vertex from TopoDS) |
111 | returns Edge from TopoDS |
112 | ---Purpose: Returns the edge created from an edge of the spine |
113 | -- and a vertex of the profile. |
114 | raises |
115 | DomainError from Standard |
116 | ---Purpose: if the edge or the vertex are not in the spine or |
117 | -- the profile. |
118 | |
119 | is static; |
120 | |
121 | Section(me; VSpine : Vertex from TopoDS) |
122 | returns Shape from TopoDS |
123 | ---Purpose: Returns the shape created from the profile at the |
124 | -- position of the vertex VSpine. |
125 | raises |
126 | DomainError from Standard |
127 | ---Purpose: if the vertex is not in the Spine |
128 | is static; |
129 | |
130 | |
131 | PipeLine(me; Point : Pnt from gp) |
132 | ---Purpose: Create a Wire by sweeping the Point along the <spine> |
133 | returns Wire from TopoDS |
134 | raises |
135 | DomainError from Standard |
136 | ---Purpose: if the <Spine> is undefined |
137 | is static; |
138 | |
139 | |
140 | -- |
141 | -- Private methods |
142 | -- |
143 | |
144 | MakeShape(me : in out; S : Shape from TopoDS; |
145 | FirstShape, LastShape : Shape from TopoDS) |
146 | returns Shape from TopoDS |
147 | ---Purpose: Auxiliary recursive method used to build the |
148 | -- result. |
149 | is static private; |
150 | |
151 | |
152 | FindEdge(me; S : Shape from TopoDS; |
153 | E : Edge from TopoDS; |
154 | Init : in out Integer) |
155 | ---Purpose: Auxiliary recursive method used to find the edge's index |
156 | returns Integer |
157 | is static private; |
158 | |
159 | FindVertex(me; S : Shape from TopoDS; |
160 | V : Vertex from TopoDS; |
161 | Init : in out Integer) |
162 | returns Integer |
163 | is static private; |
164 | |
165 | DefineRealSegmax(me : in out) |
166 | is static private; |
167 | |
46e68e02 |
168 | ShareFaces(me: in out; theShape: Shape from TopoDS; |
169 | theInitialFacesLen: Integer; |
170 | theInitialEdgesLen: Integer; |
171 | theInitialSectionsLen: Integer) |
172 | ---Purpose: Performs sharing coincident faces in theShape. Also modifies |
173 | -- myFaces, mySections and myEdges to contain shared shapes. |
174 | -- Returns the shared shape. If theShape is not modified this |
175 | -- method returns it. |
176 | returns Shape from TopoDS |
177 | is static private; |
7fd59977 |
178 | |
179 | fields |
180 | mySpine : Wire from TopoDS; |
181 | myProfile : Shape from TopoDS; |
182 | myShape : Shape from TopoDS; |
183 | myTrsf : Trsf from gp; |
184 | myLoc : LocationLaw from BRepFill; |
185 | mySections: HArray2OfShape from TopTools; |
186 | myFaces : HArray2OfShape from TopTools; |
187 | myEdges : HArray2OfShape from TopTools; |
188 | myFirst : Shape from TopoDS; |
189 | myLast : Shape from TopoDS; |
190 | |
191 | myDegmax : Integer from Standard; |
192 | mySegmax : Integer from Standard; |
a31abc03 |
193 | myMode : Trihedron from GeomFill; |
194 | myForceApproxC1 : Boolean from Standard; |
195 | |
7fd59977 |
196 | end Pipe; |