2 -- Created: Thu Oct 8 10:33:07 1992
3 -- Author: Isabelle GRIGNON
5 ---Copyright: Matra Davision 1992
12 ---Purpose: The Adaptor2d 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 objects :
18 -- - the 2d curve. Curve2d
22 -- - Usual services found in Geom or Geom2d :
24 -- * parameter range, value and derivatives, etc...
26 -- - Continuity breakout services :
28 -- * Allows to divide a curve or a surfaces in
29 -- parts with a given derivation order.
31 -- - Special geometries detection services :
33 -- * Allows to test for special cases that can
34 -- be processed more easily :
35 -- - Conics, Quadrics, Bezier, BSpline ...
37 -- And to get the correponding data form the
38 -- package gp or Geom. The special type
39 -- OtherCurve means that no special case has
40 -- been detected and the algorithm may use
41 -- only the evaluation methods (D0, D1, ...)
44 -- For each category Curve2d, Curve, Surface we
45 -- define three classes, we illustrate now the
46 -- principles with the Curve, the same applies to
47 -- Curve2d and Surface.
49 -- The class Curve is the abstract root for all
50 -- Curves used by algorithms, it is handled by value
51 -- and provides as deferred methods the services
54 -- Some services (breakout) requires to create new
55 -- curves, this leads to memory allocation
56 -- considerations (who create the curve, who deletes
57 -- it ?). To solve this problem elegantly the curve
58 -- will return a HCurve, the HCurve is a curve
59 -- handled by reference so it will be deallocated
60 -- automatically when it is not used.
62 -- A third class GenHCurve is provided, this class is
63 -- generic and its utility is to provide automatic
64 -- generation of the HCurve class when you have
65 -- written the Curve class.
68 -- * Let us show an example (with 2d curves) :
70 -- Imagine an algorithm to intersect curves, this
71 -- algorithms is written to process Curve2d from
74 -- A method may look like :
76 -- Intersect(C1,C2 : Curve2d from Adaptor2d);
78 -- Which will look like in C++
80 -- Intersect(const Adaptor2d_Curve2d& C1,
81 -- const Adaptor2d_Curve2d& C2)
83 -- // you can call any method
84 -- Standard_Real first1 = C1.FirstParameter();
86 -- // but avoid to copy in an Adaptor2d_Curve which
87 -- // is an Abstract class, use a reference or a pointer
89 -- const Adaptor2d_Curve& C = C1;
90 -- const Adaptor2d_Curve *pC = &C1;
92 -- // If you are interseted in Intervals you must
93 -- // store them in a HCurve to ensure they are kept
94 -- // in memory. Then a referrence may be used.
96 -- Handle(Adaptor2d_HCurve) HCI = C1.Interval(1);
98 -- const Adaptor2d_Curve& CI = HCI->Curve();
99 -- pC = &(HCI->Curve());
102 -- * The Adaptor2d provides also Generic classes
103 -- implementing algorithmic curves and surfaces.
105 -- - IsoCurve : Isoparametric curve on a surface.
106 -- - CurveOnSurface : 2D curve in the parametric
107 -- space of a surface.
110 -- - OffsetCurve2d : 2d offset curve
111 -- - ProjectedCurve : 3d curve projected on a plane
112 -- - SurfaceOfLinearExtrusion
113 -- - SurfaceOfRevolution
115 -- They are instantiated with HCurve, HSurface, HCurved2d
130 deferred class Curve2d;
131 ---Purpose: Root of the 2d curve.
133 pointer Curve2dPtr to Curve2d from Adaptor2d;
135 deferred class HCurve2d;
136 ---Purpose: deferred class for the 2d curves manipulated with
139 generic class GenHCurve2d;
140 ---Purpose: Generic class used to create a curve inheriting
146 -- The following classes are used to define an abstract
147 -- simplified "topology" for surfaces. This is used by
148 -- algorithm as mass properties or surface intersections.
154 class HLine2d instantiates GenHCurve2d(Line2d from Adaptor2d);
155 ---Purpose: Use by the TopolTool to trim a surface.
158 -- The following classes provides algorithmic curves and
159 -- surface, they are inheriting from Curve and Surface and the
160 -- correponding HCurve and HSurface is instantiated.