1 -- Created on: 1997-10-13
2 -- Created by: Roman BORISOV
3 -- Copyright (c) 1997-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.
22 class NormalProjection from BRepAlgo
24 ---Purpose: This class makes the projection of a wire on a
28 uses Shape from TopoDS,
32 ListOfShape from TopTools,
33 DataMapOfShapeShape from TopTools,
34 DataMapOfShapeListOfShape from TopTools
37 raises ConstructionError from Standard,
38 NoSuchObject from Standard,
45 returns NormalProjection;
48 Create(S: Shape from TopoDS)
50 returns NormalProjection;
53 Init(me: in out; S: Shape from TopoDS)
57 Add(me: in out; ToProj: Shape from TopoDS)
58 ---Purpose: Add an edge or a wire to the list of shape to project
60 raises ConstructionError from Standard
63 SetParams(me : in out; Tol3D, Tol2D : Real from Standard;
64 InternalContinuity : Shape from GeomAbs;
65 MaxDegree , MaxSeg : Integer from Standard)
66 ---Purpose: Set the parameters used for computation
67 -- Tol3d is the requiered tolerance between the 3d projected
68 -- curve and its 2d representation
69 -- InternalContinuity is the order of constraints
70 -- used for approximation.
71 -- MaxDeg and MaxSeg are the maximum degree and the maximum
72 -- number of segment for BSpline resulting of an approximation.
76 SetDefaultParams(me : in out)
77 ---Purpose: Set the parameters used for computation
78 -- in their default values
82 SetMaxDistance(me: in out; MaxDist: Real from Standard)
83 ---Purpose: Sets the maximum distance between target shape and
84 -- shape to project. If this condition is not satisfied then
85 -- corresponding part of solution is discarded.
86 -- if MaxDist < 0 then this method does not affect the algorithm
90 Compute3d(me: in out; With3d: Boolean from Standard = Standard_True)
91 ---Purpose: if With3d = Standard_False the 3dcurve is not computed
92 -- the initial 3dcurve is kept to build the resulting edges.
95 SetLimit(me : in out; FaceBoundaries: Boolean from Standard = Standard_True)
96 ---Purpose: Manage limitation of projected edges.
97 --By default edges are limited by face boundaries,
98 --else they are limited by supporting surface boundaries.
102 ---Purpose: Builds the result as a compound.
106 returns Boolean from Standard
111 ---Purpose: returns the result
112 returns Shape from TopoDS
113 ---C++: return const&
114 raises NotDone from StdFail
118 Ancestor(me; E: Edge from TopoDS)
119 ---Purpose: For a resulting edge, returns the corresponding initial edge.
121 returns Shape from TopoDS
122 ---C++: return const&
123 raises NotDone from StdFail,
124 NoSuchObject from Standard
127 Couple(me; E: Edge from TopoDS)
128 ---Purpose: For a projected edge, returns the corresponding initial face.
130 returns Shape from TopoDS
131 ---C++: return const&
132 raises NotDone from StdFail,
133 NoSuchObject from Standard
136 Generated (me: in out; S : Shape from TopoDS)
137 ---Purpose: Returns the list of shapes generated from the
139 ---C++: return const &
140 returns ListOfShape from TopTools;
143 IsElementary(me; C: Curve from Adaptor3d)
144 returns Boolean from Standard
147 BuildWire(me; Liste : out ListOfShape from TopTools)
148 returns Boolean from Standard
150 --- Purpose : build the result as a list of wire if possible in --
151 -- a first returns a wire only if there is only a wire.
157 myShape : Shape from TopoDS;
158 myIsDone : Boolean from Standard;
159 myTol3d : Real from Standard;
160 myTol2d : Real from Standard;
161 myMaxDist : Real from Standard;
162 myWith3d : Boolean from Standard;
163 myContinuity : Shape from GeomAbs;
164 myMaxDegree : Integer from Standard;
165 myMaxSeg : Integer from Standard;
166 myFaceBounds : Boolean from Standard;
167 myToProj : Shape from TopoDS;
168 myAncestorMap : DataMapOfShapeShape from TopTools;
169 myCorresp : DataMapOfShapeShape from TopTools;
170 myDescendants : DataMapOfShapeListOfShape from TopTools;
171 myRes : Shape from TopoDS;
173 end NormalProjection;