1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
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.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
16 #include <Adaptor2d_Curve2d.hxx>
17 #include <Adaptor3d_Curve.hxx>
18 #include <GCPnts_QuasiUniformDeflection.hxx>
20 #include <gp_Pnt2d.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>
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)
33 return C.Value(Parameter) ;
35 static gp_Pnt Value(const Adaptor2d_Curve2d & C,
36 const Standard_Real Parameter)
39 gp_Pnt2d a2dPoint(C.Value(Parameter));
40 aPoint.SetCoord(a2dPoint.X(),a2dPoint.Y(),0.);
44 static void D1(const Adaptor3d_Curve & C,
45 const Standard_Real Parameter,
52 static void D1(const Adaptor2d_Curve2d & C,
53 const Standard_Real Parameter,
59 C.D1(Parameter,a2dPoint,a2dVec);
60 P.SetCoord(a2dPoint.X(),a2dPoint.Y(),0.);
61 V.SetCoord(a2dVec.X(),a2dVec.Y(),0.);
65 //=======================================================================
68 //=======================================================================
70 gp_Pnt GCPnts_QuasiUniformDeflection::Value
71 (const Standard_Integer Index) const
73 StdFail_NotDone_Raise_if(!myDone,
74 "GCPnts_QuasiUniformAbscissa::Parameter()");
75 return myPoints.Value(Index) ;
77 //=======================================================================
78 //function : GCPnts_QuasiUniformDeflection
80 //=======================================================================
82 GCPnts_QuasiUniformDeflection::GCPnts_QuasiUniformDeflection ()
83 :myDone(Standard_False),myCont(GeomAbs_C1)
87 #include <Geom_BezierCurve.hxx>
88 #include <Geom_BSplineCurve.hxx>
90 #define TheCurve Adaptor3d_Curve
91 #define Handle_TheBezierCurve Handle(Geom_BezierCurve)
92 #define Handle_TheBSplineCurve Handle(Geom_BSplineCurve)
94 #include "GCPnts_QuasiUniformDeflection.pxx"
97 #undef Handle_TheBezierCurve
98 #undef Handle_TheBSplineCurve
100 #include <Geom2d_BezierCurve.hxx>
101 #include <Geom2d_BSplineCurve.hxx>
103 #define TheCurve Adaptor2d_Curve2d
104 #define Handle_TheBezierCurve Handle(Geom2d_BezierCurve)
105 #define Handle_TheBSplineCurve Handle(Geom2d_BSplineCurve)
107 #include "GCPnts_QuasiUniformDeflection.pxx"