1 -- Created on: 1998-01-14
2 -- Created by: Philippe MANGIN
3 -- Copyright (c) 1998-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.
23 deferred class LocationLaw from BRepFill inherits TShared from MMgt
25 ---Purpose: Location Law on a Wire.
30 LocationLaw from GeomFill,
31 HArray1OfLocationLaw from GeomFill,
32 PipeError from GeomFill,
33 HArray1OfReal from TColStd,
34 Array1OfInteger from TColStd,
35 HArray1OfInteger from TColStd,
36 HArray1OfShape from TopTools,
43 OutOfRange from Standard
46 Init (me : mutable; Path : Wire from TopoDS)
47 ---Purpose: Initialize all the fields, this methode have to
48 -- be called by the constructors of Inherited class.
52 ---Purpose: Return a error status, if the status is not PipeOk then
53 -- it exist a parameter tlike the law is not valuable for t.
54 returns PipeError from GeomFill;
56 TransformInG0Law(me : mutable)
57 ---Purpose: Apply a linear transformation on each law, to have
58 -- continuity of the global law beetween the edges.
62 TransformInCompatibleLaw(me : mutable;
63 AngularTolerance : Real)
64 ---Purpose: Apply a linear transformation on each law, to reduce
65 -- the dicontinuities of law at one rotation.
68 TangentIsMain(me : mutable)
69 ---Purpose: To preseve if possible the Tangent in transformations
70 -- It is the default mode.
73 NormalIsMain(me : mutable)
74 ---Purpose: To preseve if possible the Normal in transformations
77 BiNormalIsMain(me : mutable)
78 ---Purpose: To preseve if possible the BiNormal in transformations
81 DeleteTransform(me : mutable)
84 NbHoles(me: mutable; Tol : Real = 1.0e-7)
87 Holes(me; Interval : out Array1OfInteger from TColStd);
90 ---Purpose: Return the number of elementary Law
93 Law(me; Index : Integer)
94 ---Purpose: Return the elementary Law of rank <Index>
95 -- <Index> have to be in [1, NbLaw()]
96 ---C++: return const &
97 returns LocationLaw from GeomFill
101 ---Purpose: return the path
102 ---C++: return const &
103 returns Wire from TopoDS;
105 Edge(me; Index : Integer)
106 ---Purpose: Return the Edge of rank <Index> in the path
107 -- <Index> have to be in [1, NbLaw()]
108 ---C++: return const &
109 returns Edge from TopoDS
112 Vertex(me; Index : Integer)
113 ---Purpose: Return the vertex of rank <Index> in the path
114 -- <Index> have to be in [0, NbLaw()]
115 returns Vertex from TopoDS
118 PerformVertex(me; Index : Integer;
119 InputVertex : Vertex from TopoDS;
121 OutputVertex : out Vertex;
122 Location : Integer = 0)
123 ---Purpose: Compute <OutputVertex> like a transformation of
124 -- <InputVertex> the transformation is given by
125 -- evaluation of the location law in the vertex of
127 -- <Location> is used to manage discontinuities :
128 -- - -1 : The law before the vertex is used.
129 -- - 1 : The law after the vertex is used.
130 -- - 0 : Average of the both laws is used.
133 CurvilinearBounds(me; Index : Integer;
134 First, Last :out Real);
135 ---Purpose:Return the Curvilinear Bounds of the <Index> Law
137 IsClosed(me) returns Boolean;
139 IsG1(me; Index : Integer;
140 SpatialTolerance : Real = 1.0e-7;
141 AngularTolerance : Real = 1.0e-4)
142 ---Purpose: Compute the Law's continuity beetween 2 edges of the path
143 -- The result can be :
144 -- -1 : Case Not connex
145 -- 0 : It is connex (G0)
146 -- 1 : It is tangent (G1)
149 D0(me:mutable; Abscissa :Real;
150 Section : in out Shape from TopoDS);
151 ---Purpose: Apply the Law to a shape, for a given Curnilinear abscissa
154 Parameter(me:mutable; Abscissa :Real;
157 ---Purpose: Find the index Law and the parmaeter, for a given
158 -- Curnilinear abscissa
161 Abscissa(me:mutable; Index : Integer;
163 ---Purpose:Return the curvilinear abscissa corresponding to a point
164 -- of the path, defined by <Index> of Edge and a
165 -- parameter on the edge.
169 myPath : Wire from TopoDS is protected;
170 myTol : Real is protected;
171 myLaws : HArray1OfLocationLaw from GeomFill is protected;
172 myLength : HArray1OfReal from TColStd is protected;
173 myEdges : HArray1OfShape from TopTools is protected;
174 myDisc : HArray1OfInteger from TColStd is protected;