1 -- Created on: 1992-10-08
2 -- Created by: Isabelle GRIGNON
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.
27 ---Purpose: The Adaptor3d package is used to help defining
28 -- reusable geometric algorithms. i.e. that can be
29 -- used on curves and surfaces.
31 -- It defines general services for 3 kind of objects :
33 -- - the 2d curve. Curve2d
34 -- - the 3d curve. Curve
35 -- - the 3d surface. Surface
39 -- - Usual services found in Geom or Geom2d :
41 -- * parameter range, value and derivatives, etc...
43 -- - Continuity breakout services :
45 -- * Allows to divide a curve or a surfaces in
46 -- parts with a given derivation order.
48 -- - Special geometries detection services :
50 -- * Allows to test for special cases that can
51 -- be processed more easily :
52 -- - Conics, Quadrics, Bezier, BSpline ...
54 -- And to get the correponding data form the
55 -- package gp or Geom. The special type
56 -- OtherCurve means that no special case has
57 -- been detected and the algorithm may use
58 -- only the evaluation methods (D0, D1, ...)
61 -- For each category Curve2d, Curve, Surface we
62 -- define three classes, we illustrate now the
63 -- principles with the Curve, the same applies to
64 -- Curve2d and Surface.
66 -- The class Curve is the abstract root for all
67 -- Curves used by algorithms, it is handled by value
68 -- and provides as deferred methods the services
71 -- Some services (breakout) requires to create new
72 -- curves, this leads to memory allocation
73 -- considerations (who create the curve, who deletes
74 -- it ?). To solve this problem elegantly the curve
75 -- will return a HCurve, the HCurve is a curve
76 -- handled by reference so it will be deallocated
77 -- automatically when it is not used.
79 -- A third class GenHCurve is provided, this class is
80 -- generic and its utility is to provide automatic
81 -- generation of the HCurve class when you have
82 -- written the Curve class.
85 -- * Let us show an example (with 2d curves) :
87 -- Imagine an algorithm to intersect curves, this
88 -- algorithms is written to process Curve2d from
91 -- A method may look like :
93 -- Intersect(C1,C2 : Curve2d from Adaptor3d);
95 -- Which will look like in C++
97 -- Intersect(const Adaptor2d_Curve2d& C1,
98 -- const Adaptor2d_Curve2d& C2)
100 -- // you can call any method
101 -- Standard_Real first1 = C1.FirstParameter();
103 -- // but avoid to copy in an Adaptor3d_Curve which
104 -- // is an Abstract class, use a reference or a pointer
106 -- const Adaptor3d_Curve& C = C1;
107 -- const Adaptor3d_Curve *pC = &C1;
109 -- // If you are interseted in Intervals you must
110 -- // store them in a HCurve to ensure they are kept
111 -- // in memory. Then a referrence may be used.
113 -- Handle(Adaptor3d_HCurve) HCI = C1.Interval(1);
115 -- const Adaptor3d_Curve& CI = HCI->Curve();
116 -- pC = &(HCI->Curve());
119 -- * The Adaptor3d provides also Generic classes
120 -- implementing algorithmic curves and surfaces.
122 -- - IsoCurve : Isoparametric curve on a surface.
123 -- - CurveOnSurface : 2D curve in the parametric
124 -- space of a surface.
127 -- - OffsetCurve2d : 2d offset curve
128 -- - ProjectedCurve : 3d curve projected on a plane
129 -- - SurfaceOfLinearExtrusion
130 -- - SurfaceOfRevolution
132 -- They are instantiated with HCurve, HSurface, HCurved2d
149 deferred class Curve;
150 ---Purpose: Root of the 3d curve.
152 pointer CurvePtr to Curve from Adaptor3d;
154 deferred class HCurve;
155 ---Purpose: deferred class for the curves manipulated with
158 generic class GenHCurve;
159 ---Purpose: Generic class used to create a curve inheriting
163 deferred class Surface;
164 ---Purpose: Root of the surface.
166 pointer SurfacePtr to Surface from Adaptor3d;
168 deferred class HSurface;
169 ---Purpose: deferred class for the surfaces manipulated with
172 generic class GenHSurface;
173 ---Purpose: Generic class used to create a surface inheriting
178 -- The following classes are used to define an abstract
179 -- simplified "topology" for surfaces. This is used by
180 -- algorithm as mass properties or surface intersections.
191 -- The following classes provides algorithmic curves and
192 -- surface, they are inheriting from Curve and Surface and the
193 -- correponding HCurve and HSurface is instantiated.
199 ---Purpose: Algorithmic 3d curv, isoparametric on a surface.
201 class HIsoCurve instantiates GenHCurve from Adaptor3d
202 (IsoCurve from Adaptor3d);
205 class CurveOnSurface;
206 ---Purpose: Algorithmic 3d curve from a surface and a 2d curve
207 -- in the parameter space.
209 pointer CurveOnSurfacePtr to CurveOnSurface from Adaptor3d;
211 class HCurveOnSurface instantiates GenHCurve from Adaptor3d
212 (CurveOnSurface from Adaptor3d);
217 ---Purpose: Algorithmic 2d curve.
219 class HOffsetCurve instantiates GenHCurve2d from Adaptor2d
220 (OffsetCurve from Adaptor3d);
223 class SurfaceOfRevolution;
224 ---Purpose: Algorithmic Surface from a Curve and an Axis
225 -- Curve and Axis are coplanar.
226 -- Curve doesn't intersect Axis.
228 class HSurfaceOfRevolution instantiates GenHSurface from Adaptor3d
229 (SurfaceOfRevolution from Adaptor3d);
233 class SurfaceOfLinearExtrusion;
234 ---Purpose: Algorithmic Surface from a curve and a direction
236 class HSurfaceOfLinearExtrusion instantiates GenHSurface from Adaptor3d
237 (SurfaceOfLinearExtrusion from Adaptor3d);
239 private class InterFunc;
240 ---Purpose: function to find the Cn discontinuity point. Used to
241 -- find the roots of the functions