2 -- Created: Thu Oct 8 10:33:07 1992
3 -- Author: Isabelle GRIGNON
5 ---Copyright: Matra Davision 1992
12 ---Purpose: The Adaptor3d package is used to help defining
13 -- reusable geometric algorithms. i.e. that can be
14 -- used on curves and surfaces.
16 -- It defines general services for 3 kind of objects :
18 -- - the 2d curve. Curve2d
19 -- - the 3d curve. Curve
20 -- - the 3d surface. Surface
24 -- - Usual services found in Geom or Geom2d :
26 -- * parameter range, value and derivatives, etc...
28 -- - Continuity breakout services :
30 -- * Allows to divide a curve or a surfaces in
31 -- parts with a given derivation order.
33 -- - Special geometries detection services :
35 -- * Allows to test for special cases that can
36 -- be processed more easily :
37 -- - Conics, Quadrics, Bezier, BSpline ...
39 -- And to get the correponding data form the
40 -- package gp or Geom. The special type
41 -- OtherCurve means that no special case has
42 -- been detected and the algorithm may use
43 -- only the evaluation methods (D0, D1, ...)
46 -- For each category Curve2d, Curve, Surface we
47 -- define three classes, we illustrate now the
48 -- principles with the Curve, the same applies to
49 -- Curve2d and Surface.
51 -- The class Curve is the abstract root for all
52 -- Curves used by algorithms, it is handled by value
53 -- and provides as deferred methods the services
56 -- Some services (breakout) requires to create new
57 -- curves, this leads to memory allocation
58 -- considerations (who create the curve, who deletes
59 -- it ?). To solve this problem elegantly the curve
60 -- will return a HCurve, the HCurve is a curve
61 -- handled by reference so it will be deallocated
62 -- automatically when it is not used.
64 -- A third class GenHCurve is provided, this class is
65 -- generic and its utility is to provide automatic
66 -- generation of the HCurve class when you have
67 -- written the Curve class.
70 -- * Let us show an example (with 2d curves) :
72 -- Imagine an algorithm to intersect curves, this
73 -- algorithms is written to process Curve2d from
76 -- A method may look like :
78 -- Intersect(C1,C2 : Curve2d from Adaptor3d);
80 -- Which will look like in C++
82 -- Intersect(const Adaptor2d_Curve2d& C1,
83 -- const Adaptor2d_Curve2d& C2)
85 -- // you can call any method
86 -- Standard_Real first1 = C1.FirstParameter();
88 -- // but avoid to copy in an Adaptor3d_Curve which
89 -- // is an Abstract class, use a reference or a pointer
91 -- const Adaptor3d_Curve& C = C1;
92 -- const Adaptor3d_Curve *pC = &C1;
94 -- // If you are interseted in Intervals you must
95 -- // store them in a HCurve to ensure they are kept
96 -- // in memory. Then a referrence may be used.
98 -- Handle(Adaptor3d_HCurve) HCI = C1.Interval(1);
100 -- const Adaptor3d_Curve& CI = HCI->Curve();
101 -- pC = &(HCI->Curve());
104 -- * The Adaptor3d provides also Generic classes
105 -- implementing algorithmic curves and surfaces.
107 -- - IsoCurve : Isoparametric curve on a surface.
108 -- - CurveOnSurface : 2D curve in the parametric
109 -- space of a surface.
112 -- - OffsetCurve2d : 2d offset curve
113 -- - ProjectedCurve : 3d curve projected on a plane
114 -- - SurfaceOfLinearExtrusion
115 -- - SurfaceOfRevolution
117 -- They are instantiated with HCurve, HSurface, HCurved2d
134 deferred class Curve;
135 ---Purpose: Root of the 3d curve.
137 pointer CurvePtr to Curve from Adaptor3d;
139 deferred class HCurve;
140 ---Purpose: deferred class for the curves manipulated with
143 generic class GenHCurve;
144 ---Purpose: Generic class used to create a curve inheriting
148 deferred class Surface;
149 ---Purpose: Root of the surface.
151 pointer SurfacePtr to Surface from Adaptor3d;
153 deferred class HSurface;
154 ---Purpose: deferred class for the surfaces manipulated with
157 generic class GenHSurface;
158 ---Purpose: Generic class used to create a surface inheriting
163 -- The following classes are used to define an abstract
164 -- simplified "topology" for surfaces. This is used by
165 -- algorithm as mass properties or surface intersections.
176 -- The following classes provides algorithmic curves and
177 -- surface, they are inheriting from Curve and Surface and the
178 -- correponding HCurve and HSurface is instantiated.
184 ---Purpose: Algorithmic 3d curv, isoparametric on a surface.
186 class HIsoCurve instantiates GenHCurve from Adaptor3d
187 (IsoCurve from Adaptor3d);
190 class CurveOnSurface;
191 ---Purpose: Algorithmic 3d curve from a surface and a 2d curve
192 -- in the parameter space.
194 pointer CurveOnSurfacePtr to CurveOnSurface from Adaptor3d;
196 class HCurveOnSurface instantiates GenHCurve from Adaptor3d
197 (CurveOnSurface from Adaptor3d);
202 ---Purpose: Algorithmic 2d curve.
204 class HOffsetCurve instantiates GenHCurve2d from Adaptor2d
205 (OffsetCurve from Adaptor3d);
208 class SurfaceOfRevolution;
209 ---Purpose: Algorithmic Surface from a Curve and an Axis
210 -- Curve and Axis are coplanar.
211 -- Curve doesn't intersect Axis.
213 class HSurfaceOfRevolution instantiates GenHSurface from Adaptor3d
214 (SurfaceOfRevolution from Adaptor3d);
218 class SurfaceOfLinearExtrusion;
219 ---Purpose: Algorithmic Surface from a curve and a direction
221 class HSurfaceOfLinearExtrusion instantiates GenHSurface from Adaptor3d
222 (SurfaceOfLinearExtrusion from Adaptor3d);
224 private class InterFunc;
225 ---Purpose: function to find the Cn discontinuity point. Used to
226 -- find the roots of the functions