1 -- Created on: 1996-10-02
2 -- Created by: Jacques GOUSSARD
3 -- Copyright (c) 1996-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.
25 class SplitDrafts from LocOpe
27 ---Purpose: This class provides a tool to realize the
28 -- following operations on a shape :
29 -- - split a face of the shape with a wire,
30 -- - put draft angle on both side of the wire.
31 -- For each side, the draft angle may be different.
34 uses Shape from TopoDS,
38 ListOfShape from TopTools,
39 DataMapOfShapeListOfShape from TopTools,
45 raises NotDone from StdFail,
46 NoSuchObject from Standard,
47 ConstructionError from Standard,
48 NullObject from Standard
53 ---Purpose: Empty constructor.
54 returns SplitDrafts from LocOpe;
57 Create(S: Shape from TopoDS)
59 ---Purpose: Creates the algoritm on the shape <S>.
60 returns SplitDrafts from LocOpe;
64 Init(me: in out; S: Shape from TopoDS)
66 ---Purpose: Initializes the algoritm with the shape <S>.
70 Perform(me: in out; F : Face from TopoDS;
72 Extractg : Dir from gp;
74 Angleg : Real from Standard;
75 Extractd : Dir from gp;
77 Angled : Real from Standard;
78 ModifyLeft : Boolean from Standard = Standard_True;
79 ModifyRight : Boolean from Standard = Standard_True)
82 ---Purpose: Splits the face <F> of the former given shape with
83 -- the wire <W>. The wire is assumed to lie on the
84 -- face. Puts a draft angle on both parts of the
85 -- wire. <Extractg>, <Nplg>, <Angleg> define the
86 -- arguments for the left part of the wire.
87 -- <Extractd>, <Npld>, <Angled> define the arguments
88 -- for the right part of the wire. The draft angle is
89 -- measured with the direction <Extract>. <Npl>
90 -- defines the neutral plane (points belonging to the
91 -- neutral plane are not modified). <Angle> is the
92 -- value of the draft angle. If <ModifyLeft> is set
93 -- to <Standard_False>, no draft angle is applied to
94 -- the left part of the wire. If <ModifyRight> is set
95 -- to <Standard_False>,no draft angle is applied to
96 -- the right part of the wire.
100 raises ConstructionError from Standard
101 -- the exception is raised if the original shape is a null
102 -- shape, or when ModLeft = ModRight = STnadard_False.
107 Perform(me: in out; F : Face from TopoDS;
108 W : Wire from TopoDS;
109 Extract : Dir from gp;
111 Angle : Real from Standard)
113 ---Purpose: Splits the face <F> of the former given shape with
114 -- the wire <W>. The wire is assumed to lie on the
115 -- face. Puts a draft angle on the left part of the
116 -- wire. The draft angle is measured with the
117 -- direction <Extract>. <Npl> defines the neutral
118 -- plane (points belonging to the neutral plane are
119 -- not modified). <Angle> is the value of the draft
122 raises ConstructionError from Standard
123 -- the exception is raised if the original shape is a null
131 returns Boolean from Standard
132 ---Purpose: Returns <Standard_True> if the modification has
133 -- been succesfully performed.
139 ---C++: return const&
141 returns Shape from TopoDS
147 ---C++: return const&
148 returns Shape from TopoDS
149 ---Purpose: Returns the modified shape.
150 raises NotDone from StdFail
151 -- The exception is raised when IsDone returns <Standard_False>.
156 ShapesFromShape(me; S: Shape from TopoDS)
158 returns ListOfShape from TopTools
159 ---C++: return const&
160 ---Purpose: Manages the descendant shapes.
161 raises NotDone from StdFail,
162 -- The exception is raised when IsDone returns <Standard_False>.
163 NoSuchObject from Standard
164 -- The exception is raised when <S> is not a valid
165 -- shape to be asked for descendants.
172 myShape : Shape from TopoDS;
173 myResult : Shape from TopoDS;
174 myMap : DataMapOfShapeListOfShape from TopTools;