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_UniformDeflection.hxx>
20 #include <gp_Pnt2d.hxx>
21 #include <Standard_ConstructionError.hxx>
22 #include <Standard_DomainError.hxx>
23 #include <Standard_NotImplemented.hxx>
24 #include <Standard_OutOfRange.hxx>
25 #include <StdFail_NotDone.hxx>
27 // mask the return of a Adaptor2d_Curve2d as a gp_Pnt
28 static gp_Pnt Value(const Adaptor3d_Curve & C,
29 const Standard_Real Parameter)
31 return C.Value(Parameter) ;
33 static gp_Pnt Value(const Adaptor2d_Curve2d & C,
34 const Standard_Real Parameter)
39 aPoint.SetX ( a2dPoint.X()) ;
40 aPoint.SetY ( a2dPoint.Y()) ;
41 aPoint.SetZ ( 0.0e0) ;
44 //=======================================================================
47 //=======================================================================
49 gp_Pnt GCPnts_UniformDeflection::Value
50 (const Standard_Integer Index) const
52 StdFail_NotDone_Raise_if(!myDone,
53 "GCPnts_UniformAbscissa::Parameter()");
54 return myPoints.Value(Index) ;
56 //=======================================================================
57 //function : GCPnts_UniformDeflection
59 //=======================================================================
61 GCPnts_UniformDeflection::GCPnts_UniformDeflection ()
62 : myDone(Standard_False),
67 #include <Geom_BezierCurve.hxx>
68 #include <Geom_BSplineCurve.hxx>
70 #define TheCurve Adaptor3d_Curve
71 #define Handle_TheBezierCurve Handle(Geom_BezierCurve)
72 #define Handle_TheBSplineCurve Handle(Geom_BSplineCurve)
73 #include "GCPnts_UniformDeflection.pxx"
75 #undef Handle_TheBezierCurve
76 #undef Handle_TheBSplineCurve
78 #include <Geom2d_BezierCurve.hxx>
79 #include <Geom2d_BSplineCurve.hxx>
80 #define TheCurve Adaptor2d_Curve2d
81 #define Handle_TheBezierCurve Handle(Geom2d_BezierCurve)
82 #define Handle_TheBSplineCurve Handle(Geom2d_BSplineCurve)
83 #include "GCPnts_UniformDeflection.pxx"
85 #undef Handle_TheBezierCurve
86 #undef Handle_TheBSplineCurve