1 -- Created on: 1992-03-25
2 -- Created by: Herve LEGRAND
3 -- Copyright (c) 1992-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 AbscissaPoint from GCPnts
24 ---Purpose: Provides an algorithm to compute a point on a curve
25 -- situated at a given distance from another point on the
26 -- curve, the distance being measured along the curve
27 -- (curvilinear abscissa on the curve).
28 -- This algorithm is also used to compute the length of a curve.
29 -- An AbscissaPoint object provides a framework for:
30 -- - defining the point to compute
31 -- - implementing the construction algorithm
32 -- - consulting the result.
36 Curve2d from Adaptor2d,
37 AbscissaPoint from CPnts
39 raises NotDone from StdFail,
40 ConstructionError from Standard
44 Length(myclass; C : in out Curve from Adaptor3d) returns Real;
45 ---Purpose: Computes the length of the Curve <C>.
47 Length(myclass; C : in out Curve2d from Adaptor2d) returns Real;
48 ---Purpose: Computes the length of the Curve <C>.
50 Length(myclass; C : in out Curve from Adaptor3d; Tol : Real) returns Real;
51 ---Purpose: Computes the length of the Curve <C> with the given tolerance.
53 Length(myclass; C : in out Curve2d from Adaptor2d; Tol : Real) returns Real;
54 ---Purpose: Computes the length of the Curve <C> with the given tolerance.
56 Length(myclass; C : in out Curve from Adaptor3d; U1, U2 : Real) returns Real;
57 ---Purpose: Computes the length of the Curve <C>.
59 Length(myclass; C : in out Curve2d from Adaptor2d; U1, U2 : Real) returns Real;
60 ---Purpose: Computes the length of the Curve <C>.
62 Length(myclass; C : in out Curve from Adaptor3d; U1, U2, Tol : Real) returns Real;
63 ---Purpose: Computes the length of the Curve <C> with the given tolerance.
65 Length(myclass; C : in out Curve2d from Adaptor2d; U1, U2, Tol : Real) returns Real;
66 ---Purpose: Computes the length of the Curve <C> with the given tolerance.
69 ---Purpose: Constructs an empty algorithm. This function is used
70 -- only for initializing a framework to compute the length
71 -- of a curve (or a series of curves).
73 -- The function IsDone will return the value false after the use of this function.
74 returns AbscissaPoint from GCPnts ;
76 Create (C : in out Curve from Adaptor3d; Abscissa, U0 : Real)
77 ---Purpose: the algorithm computes a point on a curve <Curve> at the
78 -- distance <Abscissa> from the point of parameter <U0>.
79 returns AbscissaPoint from GCPnts
80 raises ConstructionError;
81 -- raised when it is not possible to compute the curve's length or if
84 Create (Tol: Real; C : in out Curve from Adaptor3d; Abscissa, U0 : Real)
85 ---Purpose: the algorithm computes a point on a curve <Curve> at
86 -- the distance <Abscissa> from the point of parameter
87 -- <U0> with the given tolerance.
88 returns AbscissaPoint from GCPnts
89 raises ConstructionError;
90 -- raised when it is not possible to compute the curve's length or if
93 Create (Tol: Real; C : in out Curve2d from Adaptor2d; Abscissa, U0 : Real)
94 ---Purpose: the algorithm computes a point on a curve <Curve> at
95 -- the distance <Abscissa> from the point of parameter
96 -- <U0> with the given tolerance.
97 returns AbscissaPoint from GCPnts
98 raises ConstructionError;
99 -- raised when it is not possible to compute the curve's length or if
100 -- the curve is null;
102 Create (C : in out Curve2d from Adaptor2d; Abscissa, U0 : Real)
103 ---Purpose: the algorithm computes a point on a curve <Curve> at the
104 -- distance <Abscissa> from the point of parameter <U0>.
105 returns AbscissaPoint from GCPnts
106 raises ConstructionError;
107 -- raised when it is not possible to compute the curve's length or if
108 -- the curve is null;
110 Create (C : in out Curve from Adaptor3d; Abscissa, U0, Ui : Real)
111 ---Purpose: the algorithm computes a point on a curve <Curve> at the
112 -- distance <Abscissa> from the point of parameter <U0>.
113 -- <Ui> is the starting value used in the iterative process
114 -- which find the solution, it must be close to the final
116 returns AbscissaPoint from GCPnts
117 raises ConstructionError;
118 -- raised when it is not possible to compute the curve's length or if
119 -- the curve is null;
121 Create (C : in out Curve2d from Adaptor2d; Abscissa, U0, Ui : Real)
122 ---Purpose: the algorithm computes a point on a curve <Curve> at the
123 -- distance <Abscissa> from the point of parameter <U0>.
124 -- <Ui> is the starting value used in the iterative process
125 -- which find the solution, it must be closed to the final
127 returns AbscissaPoint from GCPnts
128 raises ConstructionError;
129 -- raised when it is not possible to compute the curve's length or if
130 -- the curve is null;
132 Create (C : in out Curve from Adaptor3d; Abscissa, U0, Ui, Tol : Real)
133 ---Purpose: the algorithm computes a point on a curve <Curve> at the
134 -- distance <Abscissa> from the point of parameter <U0>.
135 -- <Ui> is the starting value used in the iterative process
136 -- which find the solution, it must be close to the final
138 returns AbscissaPoint from GCPnts
139 raises ConstructionError;
140 -- raised when it is not possible to compute the curve's length or if
141 -- the curve is null;
143 Create (C : in out Curve2d from Adaptor2d; Abscissa, U0, Ui, Tol : Real)
144 ---Purpose: the algorithm computes a point on a curve <Curve> at the
145 -- distance <Abscissa> from the point of parameter <U0>.
146 -- <Ui> is the starting value used in the iterative process
147 -- which find the solution, it must be close to the final
149 returns AbscissaPoint from GCPnts
150 raises ConstructionError;
151 -- raised when it is not possible to compute the curve's length or if
152 -- the curve is null;
156 ---Purpose: True if the computation was successful, False otherwise.
157 -- IsDone is a protection against:
158 -- - non-convergence of the algorithm
159 -- - querying the results before computation.
164 Parameter(me) returns Real
165 ---Purpose: Returns the parameter on the curve of the point
166 -- solution of this algorithm.
168 -- StdFail_NotDone if the computation was not
169 -- successful, or was not done.
171 raises NotDone from StdFail
176 myComputer : AbscissaPoint from CPnts;