1 -- Created on: 1992-10-08
2 -- Created by: Isabelle GRIGNON
3 -- Copyright (c) 1992-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
19 ---Purpose: The Adaptor3d package is used to help defining
20 -- reusable geometric algorithms. i.e. that can be
21 -- used on curves and surfaces.
23 -- It defines general services for 3 kind of objects :
25 -- - the 2d curve. Curve2d
26 -- - the 3d curve. Curve
27 -- - the 3d surface. Surface
31 -- - Usual services found in Geom or Geom2d :
33 -- * parameter range, value and derivatives, etc...
35 -- - Continuity breakout services :
37 -- * Allows to divide a curve or a surfaces in
38 -- parts with a given derivation order.
40 -- - Special geometries detection services :
42 -- * Allows to test for special cases that can
43 -- be processed more easily :
44 -- - Conics, Quadrics, Bezier, BSpline ...
46 -- And to get the correponding data form the
47 -- package gp or Geom. The special type
48 -- OtherCurve means that no special case has
49 -- been detected and the algorithm may use
50 -- only the evaluation methods (D0, D1, ...)
53 -- For each category Curve2d, Curve, Surface we
54 -- define three classes, we illustrate now the
55 -- principles with the Curve, the same applies to
56 -- Curve2d and Surface.
58 -- The class Curve is the abstract root for all
59 -- Curves used by algorithms, it is handled by value
60 -- and provides as deferred methods the services
63 -- Some services (breakout) requires to create new
64 -- curves, this leads to memory allocation
65 -- considerations (who create the curve, who deletes
66 -- it ?). To solve this problem elegantly the curve
67 -- will return a HCurve, the HCurve is a curve
68 -- handled by reference so it will be deallocated
69 -- automatically when it is not used.
71 -- A third class GenHCurve is provided, this class is
72 -- generic and its utility is to provide automatic
73 -- generation of the HCurve class when you have
74 -- written the Curve class.
77 -- * Let us show an example (with 2d curves) :
79 -- Imagine an algorithm to intersect curves, this
80 -- algorithms is written to process Curve2d from
83 -- A method may look like :
85 -- Intersect(C1,C2 : Curve2d from Adaptor3d);
87 -- Which will look like in C++
89 -- Intersect(const Adaptor2d_Curve2d& C1,
90 -- const Adaptor2d_Curve2d& C2)
92 -- // you can call any method
93 -- Standard_Real first1 = C1.FirstParameter();
95 -- // but avoid to copy in an Adaptor3d_Curve which
96 -- // is an Abstract class, use a reference or a pointer
98 -- const Adaptor3d_Curve& C = C1;
99 -- const Adaptor3d_Curve *pC = &C1;
101 -- // If you are interseted in Intervals you must
102 -- // store them in a HCurve to ensure they are kept
103 -- // in memory. Then a referrence may be used.
105 -- Handle(Adaptor3d_HCurve) HCI = C1.Interval(1);
107 -- const Adaptor3d_Curve& CI = HCI->Curve();
108 -- pC = &(HCI->Curve());
111 -- * The Adaptor3d provides also Generic classes
112 -- implementing algorithmic curves and surfaces.
114 -- - IsoCurve : Isoparametric curve on a surface.
115 -- - CurveOnSurface : 2D curve in the parametric
116 -- space of a surface.
119 -- - OffsetCurve2d : 2d offset curve
120 -- - ProjectedCurve : 3d curve projected on a plane
121 -- - SurfaceOfLinearExtrusion
122 -- - SurfaceOfRevolution
124 -- They are instantiated with HCurve, HSurface, HCurved2d
141 deferred class Curve;
142 ---Purpose: Root of the 3d curve.
144 pointer CurvePtr to Curve from Adaptor3d;
146 deferred class HCurve;
147 ---Purpose: deferred class for the curves manipulated with
150 generic class GenHCurve;
151 ---Purpose: Generic class used to create a curve inheriting
155 deferred class Surface;
156 ---Purpose: Root of the surface.
158 pointer SurfacePtr to Surface from Adaptor3d;
160 deferred class HSurface;
161 ---Purpose: deferred class for the surfaces manipulated with
164 generic class GenHSurface;
165 ---Purpose: Generic class used to create a surface inheriting
170 -- The following classes are used to define an abstract
171 -- simplified "topology" for surfaces. This is used by
172 -- algorithm as mass properties or surface intersections.
183 -- The following classes provides algorithmic curves and
184 -- surface, they are inheriting from Curve and Surface and the
185 -- correponding HCurve and HSurface is instantiated.
191 ---Purpose: Algorithmic 3d curv, isoparametric on a surface.
193 class HIsoCurve instantiates GenHCurve from Adaptor3d
194 (IsoCurve from Adaptor3d);
197 class CurveOnSurface;
198 ---Purpose: Algorithmic 3d curve from a surface and a 2d curve
199 -- in the parameter space.
201 pointer CurveOnSurfacePtr to CurveOnSurface from Adaptor3d;
203 class HCurveOnSurface instantiates GenHCurve from Adaptor3d
204 (CurveOnSurface from Adaptor3d);
209 ---Purpose: Algorithmic 2d curve.
211 class HOffsetCurve instantiates GenHCurve2d from Adaptor2d
212 (OffsetCurve from Adaptor3d);
215 class SurfaceOfRevolution;
216 ---Purpose: Algorithmic Surface from a Curve and an Axis
217 -- Curve and Axis are coplanar.
218 -- Curve doesn't intersect Axis.
220 class HSurfaceOfRevolution instantiates GenHSurface from Adaptor3d
221 (SurfaceOfRevolution from Adaptor3d);
225 class SurfaceOfLinearExtrusion;
226 ---Purpose: Algorithmic Surface from a curve and a direction
228 class HSurfaceOfLinearExtrusion instantiates GenHSurface from Adaptor3d
229 (SurfaceOfLinearExtrusion from Adaptor3d);
231 private class InterFunc;
232 ---Purpose: function to find the Cn discontinuity point. Used to
233 -- find the roots of the functions