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
9 -- under the terms of the GNU Lesser General Public 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 Adaptor2d 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 objects :
25 -- - the 2d curve. Curve2d
29 -- - Usual services found in Geom or Geom2d :
31 -- * parameter range, value and derivatives, etc...
33 -- - Continuity breakout services :
35 -- * Allows to divide a curve or a surfaces in
36 -- parts with a given derivation order.
38 -- - Special geometries detection services :
40 -- * Allows to test for special cases that can
41 -- be processed more easily :
42 -- - Conics, Quadrics, Bezier, BSpline ...
44 -- And to get the correponding data form the
45 -- package gp or Geom. The special type
46 -- OtherCurve means that no special case has
47 -- been detected and the algorithm may use
48 -- only the evaluation methods (D0, D1, ...)
51 -- For each category Curve2d, Curve, Surface we
52 -- define three classes, we illustrate now the
53 -- principles with the Curve, the same applies to
54 -- Curve2d and Surface.
56 -- The class Curve is the abstract root for all
57 -- Curves used by algorithms, it is handled by value
58 -- and provides as deferred methods the services
61 -- Some services (breakout) requires to create new
62 -- curves, this leads to memory allocation
63 -- considerations (who create the curve, who deletes
64 -- it ?). To solve this problem elegantly the curve
65 -- will return a HCurve, the HCurve is a curve
66 -- handled by reference so it will be deallocated
67 -- automatically when it is not used.
69 -- A third class GenHCurve is provided, this class is
70 -- generic and its utility is to provide automatic
71 -- generation of the HCurve class when you have
72 -- written the Curve class.
75 -- * Let us show an example (with 2d curves) :
77 -- Imagine an algorithm to intersect curves, this
78 -- algorithms is written to process Curve2d from
81 -- A method may look like :
83 -- Intersect(C1,C2 : Curve2d from Adaptor2d);
85 -- Which will look like in C++
87 -- Intersect(const Adaptor2d_Curve2d& C1,
88 -- const Adaptor2d_Curve2d& C2)
90 -- // you can call any method
91 -- Standard_Real first1 = C1.FirstParameter();
93 -- // but avoid to copy in an Adaptor2d_Curve which
94 -- // is an Abstract class, use a reference or a pointer
96 -- const Adaptor2d_Curve& C = C1;
97 -- const Adaptor2d_Curve *pC = &C1;
99 -- // If you are interseted in Intervals you must
100 -- // store them in a HCurve to ensure they are kept
101 -- // in memory. Then a referrence may be used.
103 -- Handle(Adaptor2d_HCurve) HCI = C1.Interval(1);
105 -- const Adaptor2d_Curve& CI = HCI->Curve();
106 -- pC = &(HCI->Curve());
109 -- * The Adaptor2d provides also Generic classes
110 -- implementing algorithmic curves and surfaces.
112 -- - IsoCurve : Isoparametric curve on a surface.
113 -- - CurveOnSurface : 2D curve in the parametric
114 -- space of a surface.
117 -- - OffsetCurve2d : 2d offset curve
118 -- - ProjectedCurve : 3d curve projected on a plane
119 -- - SurfaceOfLinearExtrusion
120 -- - SurfaceOfRevolution
122 -- They are instantiated with HCurve, HSurface, HCurved2d
136 deferred class Curve2d;
137 ---Purpose: Root of the 2d curve.
139 pointer Curve2dPtr to Curve2d from Adaptor2d;
141 deferred class HCurve2d;
142 ---Purpose: deferred class for the 2d curves manipulated with
145 generic class GenHCurve2d;
146 ---Purpose: Generic class used to create a curve inheriting
152 -- The following classes are used to define an abstract
153 -- simplified "topology" for surfaces. This is used by
154 -- algorithm as mass properties or surface intersections.
160 class HLine2d instantiates GenHCurve2d(Line2d from Adaptor2d);
161 ---Purpose: Use by the TopolTool to trim a surface.
164 -- The following classes provides algorithmic curves and
165 -- surface, they are inheriting from Curve and Surface and the
166 -- correponding HCurve and HSurface is instantiated.