b311480e |
1 | -- Created on: 1995-06-13 |
2 | -- Created by: Jacques GOUSSARD |
3 | -- Copyright (c) 1995-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 | package BRepFeat |
24 | |
4e57c75e |
25 | ---Purpose: BRepFeat is necessary for the |
26 | -- creation and manipulation of both form and mechanical features in a |
27 | -- Boundary Representation framework. Form features can be depressions or |
28 | -- protrusions and include the following types: |
29 | -- - Cylinder |
30 | -- - Draft Prism |
31 | -- - Prism |
32 | -- - Revolved feature |
33 | -- - Pipe |
34 | -- Depending on whether you wish to make a depression or a protrusion, |
35 | -- you can choose your operation type between the following: |
36 | -- - removing matter (a Boolean cut: Fuse setting 0) |
37 | -- - adding matter (Boolean fusion: Fuse setting 1) |
38 | -- The semantics of form feature creation is based on the |
39 | -- construction of shapes: |
40 | -- - for a certain length in a certain direction |
41 | -- - up to a limiting face |
42 | -- - from a limiting face at a height |
43 | -- - above and/or below a plane |
44 | -- The shape defining the construction of a feature can be either a |
45 | -- supporting edge or a concerned area of a face. |
46 | -- In case of supporting edge, this contour can be attached to a face |
47 | -- of the basis shape by binding. When the contour is bound to this face, |
48 | -- the information that the contour will slide on the face becomes |
49 | -- available to the relevant class methods. In case of the concerned |
50 | -- area of a face, you could, for example, cut it out and move it at |
51 | -- a different height, which will define the limiting face of a |
52 | -- protrusion or depression. Topological definition with local |
53 | -- operations of this sort makes calculations simpler and faster |
54 | -- than a global operation. The latter would entail a second phase of |
55 | -- removing unwanted matter to get the same result. |
56 | -- Mechanical features include ribs - protrusions - and grooves (or |
57 | -- slots) - depressions along planar (linear) surfaces or revolution surfaces. |
58 | -- The semantics of mechanical features is based on giving |
59 | -- thickness to a contour. This thickness can either be unilateral |
60 | -- - on one side of the contour - or bilateral - on both sides. As in |
61 | -- the semantics of form features, the thickness is defined by |
62 | -- construction of shapes in specific contexts. |
63 | -- However, in case of mechanical features, development contexts |
64 | -- differ. Here they include extrusion: |
65 | -- - to a limiting face of the basis shape |
66 | -- - to or from a limiting plane |
67 | -- - to a height. |
7fd59977 |
68 | |
69 | uses BRepBuilderAPI, |
70 | LocOpe, |
71 | TopoDS, |
72 | TopTools, |
73 | TopOpeBRepBuild, |
74 | Geom, |
75 | gp, |
76 | TColgp, |
77 | TColGeom, |
78 | StdFail, |
79 | BRepTopAdaptor, |
80 | Geom2dAdaptor, |
81 | TopAbs, |
82 | --modified by NIZNHY-PKV Thu Mar 21 18:31:59 2002 f |
4e57c75e |
83 | BRepAlgoAPI, |
84 | BOPAlgo, |
85 | BOPDS, |
86 | BOPCol, |
87 | BOPTools |
88 | --BOP |
7fd59977 |
89 | --modified by NIZNHY-PKV Thu Mar 21 18:32:02 2002 t |
4e57c75e |
90 | |
91 | |
7fd59977 |
92 | is |
93 | |
94 | enumeration StatusError is |
4e57c75e |
95 | ---Purpose: Discribes the error. |
96 | OK, |
97 | BadDirect, |
98 | BadIntersect, |
99 | EmptyBaryCurve, |
100 | EmptyCutResult, |
101 | FalseSide, |
102 | IncDirection, |
103 | IncSlidFace, |
104 | IncParameter, |
105 | IncTypes, |
106 | IntervalOverlap, |
107 | InvFirstShape, |
108 | InvOption, |
109 | InvShape, |
110 | LocOpeNotDone, |
111 | LocOpeInvNotDone, |
112 | NoExtFace, |
113 | NoFaceProf, |
114 | NoGluer, |
115 | NoIntersectF, |
116 | NoIntersectU, |
117 | NoParts, |
118 | NoProjPt, |
119 | NotInitialized, |
120 | NotYetImplemented, |
121 | NullRealTool, |
122 | NullToolF, |
123 | NullToolU |
7fd59977 |
124 | |
125 | end StatusError; |
126 | |
127 | |
4e57c75e |
128 | class Builder; -- inherits BOP from BOPAlgo |
7fd59977 |
129 | |
7fd59977 |
130 | class MakeCylindricalHole; -- inherits Builder from BRepFeat; |
131 | |
7fd59977 |
132 | class SplitShape; -- inherits MakeShape from BRepBuilderAPI; |
133 | |
134 | deferred class Form; -- inherits MakeShape from BRepBuilderAPI; |
135 | |
136 | deferred class RibSlot; -- inherits MakeShape from BRepBuilderAPI; |
137 | |
138 | class MakePrism; -- inherits Form from BRepFeat |
139 | |
140 | class MakeRevol; -- inherits Form from BRepFeat |
141 | |
142 | class MakePipe; -- inherits Form from BRepFeat |
143 | |
144 | class Gluer; -- inherits MakeShape from BRepBuilderAPI |
145 | |
146 | class MakeDPrism; |
147 | |
148 | class MakeLinearForm; |
149 | |
150 | class MakeRevolutionForm; |
151 | |
152 | enumeration Status is -- to be completed |
153 | |
4e57c75e |
154 | NoError, |
155 | InvalidPlacement, |
156 | HoleTooLong |
7fd59977 |
157 | |
158 | end Status; |
159 | |
160 | enumeration PerfSelection is |
161 | |
4e57c75e |
162 | NoSelection, |
163 | SelectionFU, |
164 | SelectionU, |
165 | SelectionSh, |
166 | SelectionShU |
167 | ---Purpose: To declare the type of selection semantics for local operation Perform methods |
168 | -- - NoSelection |
169 | -- - SelectionFU - selection of a face up to which a |
170 | -- local operation will be performed |
171 | -- - SelectionU - selection of a point up to which a |
172 | -- local operation will be performed |
173 | -- - SelectionSh - selection of a shape on which a |
174 | -- local operation will be performed |
175 | -- - SelectionShU - selection of a shape up to which a |
176 | -- local operation will be performed. |
7fd59977 |
177 | end PerfSelection; |
178 | |
179 | |
180 | SampleEdges(S : Shape from TopoDS; |
4e57c75e |
181 | Pt: in out SequenceOfPnt from TColgp); |
7fd59977 |
182 | |
183 | |
184 | |
185 | Barycenter(S : Shape from TopoDS; |
4e57c75e |
186 | Pt: in out Pnt from gp); |
187 | |
7fd59977 |
188 | ParametricBarycenter(S : Shape from TopoDS; |
4e57c75e |
189 | C : Curve from Geom) |
190 | |
191 | returns Real from Standard; |
7fd59977 |
192 | |
193 | ParametricMinMax(S : Shape from TopoDS; |
4e57c75e |
194 | C : Curve from Geom; |
195 | prmin : out Real from Standard; |
196 | prmax : out Real from Standard; |
197 | prbmin: out Real from Standard; |
198 | prbmax: out Real from Standard; |
199 | flag : out Boolean from Standard; |
200 | Ori : Boolean from Standard = Standard_False); |
201 | ---Purpose: Ori = True taking account the orientation |
202 | |
7fd59977 |
203 | IsInside(F1 : Face from TopoDS; |
4e57c75e |
204 | F2 : Face from TopoDS) |
205 | |
206 | returns Boolean from Standard; |
7fd59977 |
207 | |
208 | IsInOut (FC : FClass2d from BRepTopAdaptor; |
4e57c75e |
209 | AC : Curve from Geom2dAdaptor) |
7fd59977 |
210 | |
4e57c75e |
211 | |
212 | returns Boolean from Standard; |
7fd59977 |
213 | |
214 | -- TangSli(E : Edge from TopoDS; |
4e57c75e |
215 | -- F : Shape from TopoDS) |
216 | |
217 | -- returns Boolean from Standard; |
7fd59977 |
218 | |
219 | |
220 | FaceUntil (S : Shape from TopoDS; |
4e57c75e |
221 | F : in out Face from TopoDS); |
222 | |
7fd59977 |
223 | |
224 | Tool (SRef : Shape from TopoDS; |
4e57c75e |
225 | Fac : Face from TopoDS; |
226 | Orf : Orientation from TopAbs) |
227 | |
228 | returns Solid from TopoDS; |
7fd59977 |
229 | |
230 | Print(SE : StatusError from BRepFeat; S : in out OStream) returns OStream; |
4e57c75e |
231 | ---Purpose: Prints the Error description of the State <St> as a String on |
232 | -- the Stream <S> and returns <S>. |
233 | -- |
234 | ---C++: return & |
7fd59977 |
235 | |
236 | end BRepFeat; |