Warnings on vc14 were eliminated
[occt.git] / src / GeomEvaluator / GeomEvaluator_SurfaceOfRevolution.hxx
1 // Created on: 2015-09-21
2 // Copyright (c) 2015 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 #ifndef _GeomEvaluator_SurfaceOfRevolution_HeaderFile
16 #define _GeomEvaluator_SurfaceOfRevolution_HeaderFile
17
18 #include <GeomEvaluator_Surface.hxx>
19
20 #include <Geom_Curve.hxx>
21 #include <gp_Dir.hxx>
22 #include <gp_Pnt.hxx>
23 #include <gp_Ax1.hxx>
24
25 class Adaptor3d_HCurve;
26
27 //! Allows to calculate values and derivatives for surfaces of revolution
28 class GeomEvaluator_SurfaceOfRevolution : public GeomEvaluator_Surface
29 {
30 public:
31   //! Initialize evaluator by revolved curve, the axis of revolution and the location
32   Standard_EXPORT GeomEvaluator_SurfaceOfRevolution(const Handle(Geom_Curve)& theBase,
33                                                     const gp_Dir& theRevolDir,
34                                                     const gp_Pnt& theRevolLoc);
35   //! Initialize evaluator by adaptor of the revolved curve, the axis of revolution and the location
36   Standard_EXPORT GeomEvaluator_SurfaceOfRevolution(const Handle(Adaptor3d_HCurve)& theBase,
37                                                     const gp_Dir& theRevolDir,
38                                                     const gp_Pnt& theRevolLoc);
39
40   //! Change direction of the axis of revolution
41   void SetDirection(const gp_Dir& theDirection)
42   { myRotAxis.SetDirection(theDirection); }
43
44   //! Change location of the axis of revolution
45   void SetLocation(const gp_Pnt& theLocation)
46   { myRotAxis.SetLocation(theLocation); }
47
48   //! Change the axis of revolution
49   void SetAxis(const gp_Ax1& theAxis)
50   { myRotAxis = theAxis; }
51
52   //! Value of surface
53   Standard_EXPORT void D0(const Standard_Real theU, const Standard_Real theV,
54                           gp_Pnt& theValue) const Standard_OVERRIDE;
55   //! Value and first derivatives of surface
56   Standard_EXPORT void D1(const Standard_Real theU, const Standard_Real theV,
57                           gp_Pnt& theValue, gp_Vec& theD1U, gp_Vec& theD1V) const Standard_OVERRIDE;
58   //! Value, first and second derivatives of surface
59   Standard_EXPORT void D2(const Standard_Real theU, const Standard_Real theV,
60                           gp_Pnt& theValue, gp_Vec& theD1U, gp_Vec& theD1V,
61                           gp_Vec& theD2U, gp_Vec& theD2V, gp_Vec& theD2UV) const Standard_OVERRIDE;
62   //! Value, first, second and third derivatives of surface
63   Standard_EXPORT void D3(const Standard_Real theU, const Standard_Real theV,
64                           gp_Pnt& theValue, gp_Vec& theD1U, gp_Vec& theD1V,
65                           gp_Vec& theD2U, gp_Vec& theD2V, gp_Vec& theD2UV,
66                           gp_Vec& theD3U, gp_Vec& theD3V,
67                           gp_Vec& theD3UUV, gp_Vec& theD3UVV) const Standard_OVERRIDE;
68   //! Calculates N-th derivatives of surface, where N = theDerU + theDerV.
69   //!
70   //! Raises if N < 1 or theDerU < 0 or theDerV < 0
71   Standard_EXPORT gp_Vec DN(const Standard_Real theU,
72                             const Standard_Real theV,
73                             const Standard_Integer theDerU,
74                             const Standard_Integer theDerV) const Standard_OVERRIDE;
75
76   DEFINE_STANDARD_RTTIEXT(GeomEvaluator_SurfaceOfRevolution,GeomEvaluator_Surface)
77
78 private:
79   Handle(Geom_Curve)       myBaseCurve;
80   Handle(Adaptor3d_HCurve) myBaseAdaptor;
81   gp_Ax1 myRotAxis;
82 };
83
84 DEFINE_STANDARD_HANDLE(GeomEvaluator_SurfaceOfRevolution, GeomEvaluator_Surface)
85
86
87 #endif // _GeomEvaluator_SurfaceOfRevolution_HeaderFile