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 Adaptor2d 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 objects :
33 -- - the 2d curve. Curve2d
37 -- - Usual services found in Geom or Geom2d :
39 -- * parameter range, value and derivatives, etc...
41 -- - Continuity breakout services :
43 -- * Allows to divide a curve or a surfaces in
44 -- parts with a given derivation order.
46 -- - Special geometries detection services :
48 -- * Allows to test for special cases that can
49 -- be processed more easily :
50 -- - Conics, Quadrics, Bezier, BSpline ...
52 -- And to get the correponding data form the
53 -- package gp or Geom. The special type
54 -- OtherCurve means that no special case has
55 -- been detected and the algorithm may use
56 -- only the evaluation methods (D0, D1, ...)
59 -- For each category Curve2d, Curve, Surface we
60 -- define three classes, we illustrate now the
61 -- principles with the Curve, the same applies to
62 -- Curve2d and Surface.
64 -- The class Curve is the abstract root for all
65 -- Curves used by algorithms, it is handled by value
66 -- and provides as deferred methods the services
69 -- Some services (breakout) requires to create new
70 -- curves, this leads to memory allocation
71 -- considerations (who create the curve, who deletes
72 -- it ?). To solve this problem elegantly the curve
73 -- will return a HCurve, the HCurve is a curve
74 -- handled by reference so it will be deallocated
75 -- automatically when it is not used.
77 -- A third class GenHCurve is provided, this class is
78 -- generic and its utility is to provide automatic
79 -- generation of the HCurve class when you have
80 -- written the Curve class.
83 -- * Let us show an example (with 2d curves) :
85 -- Imagine an algorithm to intersect curves, this
86 -- algorithms is written to process Curve2d from
89 -- A method may look like :
91 -- Intersect(C1,C2 : Curve2d from Adaptor2d);
93 -- Which will look like in C++
95 -- Intersect(const Adaptor2d_Curve2d& C1,
96 -- const Adaptor2d_Curve2d& C2)
98 -- // you can call any method
99 -- Standard_Real first1 = C1.FirstParameter();
101 -- // but avoid to copy in an Adaptor2d_Curve which
102 -- // is an Abstract class, use a reference or a pointer
104 -- const Adaptor2d_Curve& C = C1;
105 -- const Adaptor2d_Curve *pC = &C1;
107 -- // If you are interseted in Intervals you must
108 -- // store them in a HCurve to ensure they are kept
109 -- // in memory. Then a referrence may be used.
111 -- Handle(Adaptor2d_HCurve) HCI = C1.Interval(1);
113 -- const Adaptor2d_Curve& CI = HCI->Curve();
114 -- pC = &(HCI->Curve());
117 -- * The Adaptor2d provides also Generic classes
118 -- implementing algorithmic curves and surfaces.
120 -- - IsoCurve : Isoparametric curve on a surface.
121 -- - CurveOnSurface : 2D curve in the parametric
122 -- space of a surface.
125 -- - OffsetCurve2d : 2d offset curve
126 -- - ProjectedCurve : 3d curve projected on a plane
127 -- - SurfaceOfLinearExtrusion
128 -- - SurfaceOfRevolution
130 -- They are instantiated with HCurve, HSurface, HCurved2d
144 deferred class Curve2d;
145 ---Purpose: Root of the 2d curve.
147 pointer Curve2dPtr to Curve2d from Adaptor2d;
149 deferred class HCurve2d;
150 ---Purpose: deferred class for the 2d curves manipulated with
153 generic class GenHCurve2d;
154 ---Purpose: Generic class used to create a curve inheriting
160 -- The following classes are used to define an abstract
161 -- simplified "topology" for surfaces. This is used by
162 -- algorithm as mass properties or surface intersections.
168 class HLine2d instantiates GenHCurve2d(Line2d from Adaptor2d);
169 ---Purpose: Use by the TopolTool to trim a surface.
172 -- The following classes provides algorithmic curves and
173 -- surface, they are inheriting from Curve and Surface and the
174 -- correponding HCurve and HSurface is instantiated.