1 -- Created on: 1999-06-18
2 -- Created by: Galina Koulikova
3 -- Copyright (c) 1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 private class BSplineRestriction from ShapeCustom inherits Modification from BRepTools
19 ---Purpose: this tool intended for aproximation surfaces, curves and pcurves with
20 -- specified degree , max number of segments, tolerance 2d, tolerance 3d. Specified
21 -- continuity can be reduced if approximation with specified continuity was not done.
34 RestrictionParameters from ShapeCustom
37 Create returns BSplineRestriction from ShapeCustom;
38 ---Purpose: Empty constructor.
41 Create(anApproxSurfaceFlag,
43 anApproxCurve2dFlag : Boolean;
44 aTol3d, aTol2d : Real;
45 aContinuity3d, aContinuity2d: Shape from GeomAbs ;
46 aMaxDegree, aNbMaxSeg : Integer;
47 Degree, Rational : Boolean)
48 returns BSplineRestriction from ShapeCustom;
49 ---Purpose: Initializes with specified parameters of aproximation.
51 Create(anApproxSurfaceFlag, anApproxCurve3dFlag, anApproxCurve2dFlag: Boolean from Standard;
52 aTol3d, aTol2d : Real;
53 aContinuity3d, aContinuity2d : Shape from GeomAbs ;
54 aMaxDegree, aNbMaxSeg : Integer;
55 Degree, Rational : Boolean;
56 aModes : RestrictionParameters from ShapeCustom)
57 returns BSplineRestriction from ShapeCustom;
58 ---Purpose: Initializes with specified parameters of aproximation.
60 NewSurface(me: mutable; F : Face from TopoDS;
61 S : out Surface from Geom;
62 L : out Location from TopLoc;
63 Tol : out Real from Standard;
64 RevWires : out Boolean from Standard;
65 RevFace : out Boolean from Standard)
67 ---Purpose: Returns Standard_True if the face <F> has been
68 -- modified. In this case, <S> is the new geometric
69 -- support of the face, <L> the new location,<Tol>
70 -- the new tolerance.<RevWires> has to be set to
71 -- Standard_True when the modification reverses the
72 -- normal of the surface.(the wires have to be
73 -- reversed). <RevFace> has to be set to
74 -- Standard_True if the orientation of the modified
75 -- face changes in the shells which contain it.
77 -- Otherwise, returns Standard_False, and <S>, <L>,
78 -- <Tol> , <RevWires> ,<RevFace> are not significant.
81 returns Boolean from Standard;
84 NewCurve(me: mutable; E : Edge from TopoDS;
85 C : out Curve from Geom;
86 L : out Location from TopLoc;
87 Tol: out Real from Standard)
89 returns Boolean from Standard;
91 ---Purpose: Returns Standard_True if curve from the edge <E> has been
92 -- modified. In this case, <C> is the new geometric
93 -- support of the edge, <L> the new location, <Tol>
95 -- Otherwise, returns Standard_True if Surface is modified or
96 -- one of pcurves of edge is modified. In this case C is copy of
97 -- geometric support of the edge.
98 -- In other cases returns Standard_False, and <C>, <L>, <Tol> are not
101 NewCurve2d(me: mutable; E : Edge from TopoDS;
102 F : Face from TopoDS;
103 NewE : Edge from TopoDS;
104 NewF : Face from TopoDS;
105 C : out Curve from Geom2d;
106 Tol : out Real from Standard)
108 returns Boolean from Standard;
110 ---Purpose: Returns Standard_True if the edge <E> has been modified.
111 -- In this case,if curve on the surface is modified, <C>
112 -- is the new geometric support of the edge, <L> the
113 -- new location, <Tol> the new tolerance. If curve on the surface
114 -- is not modified C is copy curve on surface from the edge <E>.
116 -- Otherwise, returns Standard_False, and <C>, <L>,
117 -- <Tol> are not significant.
119 -- <NewE> is the new edge created from <E>. <NewF>
120 -- is the new face created from <F>. They may be usefull.
123 ConvertSurface(me: mutable; aSurface : Surface from Geom; S : out Surface from Geom;
124 UF,UL,VF,VL : Real from Standard;
125 IsOf : Boolean from Standard = Standard_True)
126 returns Boolean from Standard;
127 ---Purpose: Returns Standard_True if the surface has been modified.
128 -- if flag IsOf equals Standard_True Offset surfaces are aproximated to Offset
129 -- if Standard_False to BSpline
131 ConvertCurve(me: mutable;aCurve : in out Curve from Geom; C : out Curve from Geom; IsConvert : Boolean;
132 First, Last : Real; TolCur : in out Real;IsOf : Boolean from Standard = Standard_True)
133 returns Boolean from Standard;
134 ---Purpose: Returns Standard_True if the curve has been modified.
135 -- if flag IsOf equals Standard_True Offset curves are aproximated to Offset
136 -- if Standard_False to BSpline
138 ConvertCurve2d(me: mutable;aCurve : in out Curve from Geom2d; C : out Curve from Geom2d; IsConvert : Boolean;
139 First, Last : Real; TolCur : in out Real;IsOf : Boolean from Standard = Standard_True)
140 returns Boolean from Standard;
141 ---Purpose: Returns Standard_True if the pcurve has been modified.
142 -- if flag IsOf equals Standard_True Offset pcurves are aproximated to Offset
143 -- if Standard_False to BSpline
145 -- Methods for setting and obtaining fields
147 SetTol3d(me: mutable; Tol3d : Real from Standard);
149 ---Purpose: Sets tolerance of aproximation for curve3d and surface
151 SetTol2d(me: mutable; Tol2d : Real from Standard);
153 ---Purpose: Sets tolerance of aproximation for curve2d
155 ModifyApproxSurfaceFlag(me : mutable) returns Boolean;
158 ---Purpose: Returns (modifiable) the flag which defines whether the
159 -- surface is aproximated.
161 ModifyApproxCurve3dFlag(me : mutable) returns Boolean;
164 ---Purpose: Returns (modifiable) the flag which defines whether the
165 -- curve3d is aproximated.
167 ModifyApproxCurve2dFlag(me : mutable) returns Boolean;
170 ---Purpose: Returns (modifiable) the flag which defines whether the curve2d is aproximated.
172 SetContinuity3d(me : mutable; Continuity3d : Shape from GeomAbs);
174 ---Purpose: Sets continuity3d for aproximation curve3d and surface.
176 SetContinuity2d(me : mutable; Continuity2d : Shape from GeomAbs);
178 ---Purpose: Sets continuity3d for aproximation curve2d.
180 SetMaxDegree(me : mutable; MaxDegree : Integer from Standard);
182 ---Purpose: Sets max degree for aproximation.
184 SetMaxNbSegments(me : mutable; MaxNbSegments : Integer from Standard);
186 ---Purpose: Sets max number of segments for aproximation.
188 SetPriority(me : mutable; Degree : Boolean from Standard);
190 ---Purpose: Sets priority for aproximation curves and surface.
191 -- If Degree is True approximation is made with degree less
192 -- then specified MaxDegree at the expense of number of spanes.
193 -- If Degree is False approximation is made with number of
194 -- spans less then specified MaxNbSegment at the expense of
195 -- specified MaxDegree.
197 SetConvRational(me : mutable; Rational : Boolean from Standard);
199 ---Purpose: Sets flag for define if rational BSpline or Bezier is
200 -- converted to polynomial. If Rational is True approximation
201 -- for rational BSpline and Bezier is made to polynomial even
202 -- if degree is less then MaxDegree and number of spans is less
203 -- then specified MaxNbSegment.
205 GetRestrictionParameters(me)
206 returns RestrictionParameters from ShapeCustom;
208 ---Purpose: Returns the container of modes which defines
209 -- what geometry should be converted to BSplines.
211 SetRestrictionParameters(me: mutable;
212 aModes: RestrictionParameters from ShapeCustom);
214 ---Purpose: Sets the container of modes which defines
215 -- what geometry should be converted to BSplines.
217 Curve3dError(me) returns Real;
219 ---Purpose:Returns error for aproximation curve3d.
221 Curve2dError(me) returns Real;
223 ---Purpose:Returns error for aproximation curve2d.
225 SurfaceError(me) returns Real;
227 ---Purpose:Returns error for aproximation surface.
229 NewPoint(me: mutable; V : Vertex from TopoDS;
231 Tol: out Real from Standard)
233 returns Boolean from Standard;
235 NewParameter(me: mutable; V : Vertex from TopoDS;
236 E : Edge from TopoDS;
237 P : out Real from Standard;
238 Tol: out Real from Standard)
240 returns Boolean from Standard;
245 Continuity(me: mutable; E : Edge from TopoDS;
246 F1,F2 : Face from TopoDS;
247 NewE : Edge from TopoDS;
248 NewF1,NewF2: Face from TopoDS)
250 returns Shape from GeomAbs;
252 MaxErrors (me; aCurve3dErr, aCurve2dErr : out Real) returns Real from Standard;
253 ---Purpose:Returns error for aproximation surface, curve3d and curve2d.
255 NbOfSpan (me) returns Integer from Standard;
256 ---Purpose:Returns number for aproximation surface, curve3d and curve2d.
261 myContinuity2d : Shape from GeomAbs;
263 myNbMaxSeg : Integer from Standard;
268 myCurve2dError : Real from Standard;
269 myNbOfSpan : Integer from Standard;
272 myApproxCurve2dFlag : Boolean from Standard;
273 myDeg : Boolean from Standard;
274 myConvert : Boolean from Standard;
275 myRational : Boolean from Standard;
277 myParameters : RestrictionParameters from ShapeCustom;
280 end BSplineRestriction;