0029915: Porting to VC 2017 : Regressions in Modeling Algorithms on VC 2017
[occt.git] / src / GCPnts / GCPnts_UniformDeflection.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_UniformDeflection.hxx>
19 #include <gp_Pnt.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>
26
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) 
30 {
31   return C.Value(Parameter) ;
32 }
33 static gp_Pnt Value(const Adaptor2d_Curve2d & C,
34                     const Standard_Real Parameter) 
35 {
36   gp_Pnt aPoint ;
37   gp_Pnt2d a2dPoint =
38   C.Value(Parameter) ;
39   aPoint.SetX ( a2dPoint.X()) ;
40   aPoint.SetY ( a2dPoint.Y()) ;
41   aPoint.SetZ ( 0.0e0) ;
42   return aPoint ;
43 }
44 //=======================================================================
45 //function : Value
46 //purpose  : 
47 //=======================================================================
48
49 gp_Pnt GCPnts_UniformDeflection::Value
50                       (const Standard_Integer Index) const
51
52   StdFail_NotDone_Raise_if(!myDone, 
53                          "GCPnts_UniformAbscissa::Parameter()");
54   return myPoints.Value(Index) ;
55 }
56 //=======================================================================
57 //function : GCPnts_UniformDeflection
58 //purpose  : 
59 //=======================================================================
60
61 GCPnts_UniformDeflection::GCPnts_UniformDeflection ()
62 :myDone(Standard_False)
63 {
64
65
66 #include <Geom_BezierCurve.hxx>
67 #include <Geom_BSplineCurve.hxx>
68
69 #define TheCurve                 Adaptor3d_Curve
70 #define Handle_TheBezierCurve   Handle(Geom_BezierCurve)
71 #define Handle_TheBSplineCurve  Handle(Geom_BSplineCurve)
72 #include "GCPnts_UniformDeflection.pxx"
73 #undef TheCurve
74 #undef Handle_TheBezierCurve
75 #undef Handle_TheBSplineCurve
76
77 #include <Geom2d_BezierCurve.hxx>
78 #include <Geom2d_BSplineCurve.hxx>
79 #define TheCurve                 Adaptor2d_Curve2d
80 #define Handle_TheBezierCurve   Handle(Geom2d_BezierCurve)
81 #define Handle_TheBSplineCurve  Handle(Geom2d_BSplineCurve)
82 #include "GCPnts_UniformDeflection.pxx"
83 #undef TheCurve
84 #undef Handle_TheBezierCurve
85 #undef Handle_TheBSplineCurve
86
87
88
89
90
91