0024553: Deleting obsolete/unused ".gxx" files from "GCPnts"
[occt.git] / src / GCPnts / GCPnts_QuasiUniformDeflection.cxx
1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 //
4 // This file is part of Open CASCADE Technology software library.
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
11 //
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
14
15
16 #include <Adaptor2d_Curve2d.hxx>
17 #include <Adaptor3d_Curve.hxx>
18 #include <GCPnts_QuasiUniformDeflection.hxx>
19 #include <gp_Pnt.hxx>
20 #include <gp_Pnt2d.hxx>
21 #include <gp_Vec.hxx>
22 #include <gp_Vec2d.hxx>
23 #include <Standard_ConstructionError.hxx>
24 #include <Standard_DomainError.hxx>
25 #include <Standard_NotImplemented.hxx>
26 #include <Standard_OutOfRange.hxx>
27 #include <StdFail_NotDone.hxx>
28
29 // mask the return of a Adaptor2d_Curve2d as a gp_Pnt 
30 static gp_Pnt Value(const Adaptor3d_Curve & C,
31                     const Standard_Real Parameter) 
32 {
33   return C.Value(Parameter) ;
34 }
35 static gp_Pnt Value(const Adaptor2d_Curve2d & C,
36                     const Standard_Real Parameter) 
37 {
38   gp_Pnt aPoint ;
39   gp_Pnt2d a2dPoint(C.Value(Parameter));
40   aPoint.SetCoord(a2dPoint.X(),a2dPoint.Y(),0.);
41   return aPoint ;
42 }
43
44 static void D1(const Adaptor3d_Curve & C,
45                const Standard_Real Parameter,
46                gp_Pnt& P,
47                gp_Vec& V) 
48 {
49   C.D1(Parameter,P,V);
50 }
51
52 static void D1(const Adaptor2d_Curve2d & C,
53                const Standard_Real Parameter,
54                gp_Pnt& P,
55                gp_Vec& V) 
56 {
57   gp_Pnt2d a2dPoint;
58   gp_Vec2d a2dVec;
59   C.D1(Parameter,a2dPoint,a2dVec);
60   P.SetCoord(a2dPoint.X(),a2dPoint.Y(),0.);
61   V.SetCoord(a2dVec.X(),a2dVec.Y(),0.);
62 }
63
64
65 //=======================================================================
66 //function : Value
67 //purpose  : 
68 //=======================================================================
69
70 gp_Pnt GCPnts_QuasiUniformDeflection::Value
71                       (const Standard_Integer Index) const
72
73   StdFail_NotDone_Raise_if(!myDone, 
74                          "GCPnts_QuasiUniformAbscissa::Parameter()");
75   return myPoints.Value(Index) ;
76 }
77 //=======================================================================
78 //function : GCPnts_QuasiUniformDeflection
79 //purpose  : 
80 //=======================================================================
81
82 GCPnts_QuasiUniformDeflection::GCPnts_QuasiUniformDeflection ()
83 :myDone(Standard_False),myCont(GeomAbs_C1)
84 {
85
86
87 #include <Geom_BezierCurve.hxx>
88 #include <Geom_BSplineCurve.hxx>
89
90 #define TheCurve                 Adaptor3d_Curve
91 #define Handle_TheBezierCurve   Handle(Geom_BezierCurve)
92 #define Handle_TheBSplineCurve  Handle(Geom_BSplineCurve)
93
94 #include "GCPnts_QuasiUniformDeflection.pxx"
95
96 #undef TheCurve
97 #undef Handle_TheBezierCurve
98 #undef Handle_TheBSplineCurve
99
100 #include <Geom2d_BezierCurve.hxx>
101 #include <Geom2d_BSplineCurve.hxx>
102
103 #define TheCurve                 Adaptor2d_Curve2d
104 #define Handle_TheBezierCurve   Handle(Geom2d_BezierCurve)
105 #define Handle_TheBSplineCurve  Handle(Geom2d_BSplineCurve)
106
107 #include "GCPnts_QuasiUniformDeflection.pxx"
108
109
110
111
112
113