Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-09 09:15:29

0001 // Created on: 2015-09-21
0002 // Copyright (c) 2015 OPEN CASCADE SAS
0003 //
0004 // This file is part of Open CASCADE Technology software library.
0005 //
0006 // This library is free software; you can redistribute it and/or modify it under
0007 // the terms of the GNU Lesser General Public License version 2.1 as published
0008 // by the Free Software Foundation, with special exception defined in the file
0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0010 // distribution for complete text of the license and disclaimer of any warranty.
0011 //
0012 // Alternatively, this file may be used under the terms of Open CASCADE
0013 // commercial license or contractual agreement.
0014 
0015 #ifndef _GeomEvaluator_SurfaceOfRevolution_HeaderFile
0016 #define _GeomEvaluator_SurfaceOfRevolution_HeaderFile
0017 
0018 #include <Adaptor3d_Curve.hxx>
0019 #include <GeomEvaluator_Surface.hxx>
0020 #include <Geom_Curve.hxx>
0021 #include <gp_Dir.hxx>
0022 #include <gp_Pnt.hxx>
0023 #include <gp_Ax1.hxx>
0024 
0025 //! Allows to calculate values and derivatives for surfaces of revolution
0026 class GeomEvaluator_SurfaceOfRevolution : public GeomEvaluator_Surface
0027 {
0028 public:
0029   //! Initialize evaluator by revolved curve, the axis of revolution and the location
0030   Standard_EXPORT GeomEvaluator_SurfaceOfRevolution(const Handle(Geom_Curve)& theBase,
0031                                                     const gp_Dir&             theRevolDir,
0032                                                     const gp_Pnt&             theRevolLoc);
0033   //! Initialize evaluator by adaptor of the revolved curve, the axis of revolution and the location
0034   Standard_EXPORT GeomEvaluator_SurfaceOfRevolution(const Handle(Adaptor3d_Curve)& theBase,
0035                                                     const gp_Dir&                  theRevolDir,
0036                                                     const gp_Pnt&                  theRevolLoc);
0037 
0038   //! Change direction of the axis of revolution
0039   void SetDirection(const gp_Dir& theDirection) { myRotAxis.SetDirection(theDirection); }
0040 
0041   //! Change location of the axis of revolution
0042   void SetLocation(const gp_Pnt& theLocation) { myRotAxis.SetLocation(theLocation); }
0043 
0044   //! Change the axis of revolution
0045   void SetAxis(const gp_Ax1& theAxis) { myRotAxis = theAxis; }
0046 
0047   //! Value of surface
0048   Standard_EXPORT void D0(const Standard_Real theU,
0049                           const Standard_Real theV,
0050                           gp_Pnt&             theValue) const Standard_OVERRIDE;
0051   //! Value and first derivatives of surface
0052   Standard_EXPORT void D1(const Standard_Real theU,
0053                           const Standard_Real theV,
0054                           gp_Pnt&             theValue,
0055                           gp_Vec&             theD1U,
0056                           gp_Vec&             theD1V) const Standard_OVERRIDE;
0057   //! Value, first and second derivatives of surface
0058   Standard_EXPORT void D2(const Standard_Real theU,
0059                           const Standard_Real theV,
0060                           gp_Pnt&             theValue,
0061                           gp_Vec&             theD1U,
0062                           gp_Vec&             theD1V,
0063                           gp_Vec&             theD2U,
0064                           gp_Vec&             theD2V,
0065                           gp_Vec&             theD2UV) const Standard_OVERRIDE;
0066   //! Value, first, second and third derivatives of surface
0067   Standard_EXPORT void D3(const Standard_Real theU,
0068                           const Standard_Real theV,
0069                           gp_Pnt&             theValue,
0070                           gp_Vec&             theD1U,
0071                           gp_Vec&             theD1V,
0072                           gp_Vec&             theD2U,
0073                           gp_Vec&             theD2V,
0074                           gp_Vec&             theD2UV,
0075                           gp_Vec&             theD3U,
0076                           gp_Vec&             theD3V,
0077                           gp_Vec&             theD3UUV,
0078                           gp_Vec&             theD3UVV) const Standard_OVERRIDE;
0079   //! Calculates N-th derivatives of surface, where N = theDerU + theDerV.
0080   //!
0081   //! Raises if N < 1 or theDerU < 0 or theDerV < 0
0082   Standard_EXPORT gp_Vec DN(const Standard_Real    theU,
0083                             const Standard_Real    theV,
0084                             const Standard_Integer theDerU,
0085                             const Standard_Integer theDerV) const Standard_OVERRIDE;
0086 
0087   Standard_EXPORT Handle(GeomEvaluator_Surface) ShallowCopy() const Standard_OVERRIDE;
0088 
0089   DEFINE_STANDARD_RTTIEXT(GeomEvaluator_SurfaceOfRevolution, GeomEvaluator_Surface)
0090 
0091 private:
0092   Handle(Geom_Curve)      myBaseCurve;
0093   Handle(Adaptor3d_Curve) myBaseAdaptor;
0094   gp_Ax1                  myRotAxis;
0095 };
0096 
0097 DEFINE_STANDARD_HANDLE(GeomEvaluator_SurfaceOfRevolution, GeomEvaluator_Surface)
0098 
0099 #endif // _GeomEvaluator_SurfaceOfRevolution_HeaderFile