Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:38

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)
0040   { myRotAxis.SetDirection(theDirection); }
0041 
0042   //! Change location of the axis of revolution
0043   void SetLocation(const gp_Pnt& theLocation)
0044   { myRotAxis.SetLocation(theLocation); }
0045 
0046   //! Change the axis of revolution
0047   void SetAxis(const gp_Ax1& theAxis)
0048   { myRotAxis = theAxis; }
0049 
0050   //! Value of surface
0051   Standard_EXPORT void D0(const Standard_Real theU, const Standard_Real theV,
0052                           gp_Pnt& theValue) const Standard_OVERRIDE;
0053   //! Value and first derivatives of surface
0054   Standard_EXPORT void D1(const Standard_Real theU, const Standard_Real theV,
0055                           gp_Pnt& theValue, gp_Vec& theD1U, gp_Vec& theD1V) const Standard_OVERRIDE;
0056   //! Value, first and second derivatives of surface
0057   Standard_EXPORT void D2(const Standard_Real theU, const Standard_Real theV,
0058                           gp_Pnt& theValue, gp_Vec& theD1U, gp_Vec& theD1V,
0059                           gp_Vec& theD2U, gp_Vec& theD2V, gp_Vec& theD2UV) const Standard_OVERRIDE;
0060   //! Value, first, second and third derivatives of surface
0061   Standard_EXPORT void D3(const Standard_Real theU, const Standard_Real theV,
0062                           gp_Pnt& theValue, gp_Vec& theD1U, gp_Vec& theD1V,
0063                           gp_Vec& theD2U, gp_Vec& theD2V, gp_Vec& theD2UV,
0064                           gp_Vec& theD3U, gp_Vec& theD3V,
0065                           gp_Vec& theD3UUV, gp_Vec& theD3UVV) const Standard_OVERRIDE;
0066   //! Calculates N-th derivatives of surface, where N = theDerU + theDerV.
0067   //!
0068   //! Raises if N < 1 or theDerU < 0 or theDerV < 0
0069   Standard_EXPORT gp_Vec DN(const Standard_Real theU,
0070                             const Standard_Real theV,
0071                             const Standard_Integer theDerU,
0072                             const Standard_Integer theDerV) const Standard_OVERRIDE;
0073 
0074   Standard_EXPORT Handle(GeomEvaluator_Surface) ShallowCopy() const Standard_OVERRIDE;
0075 
0076   DEFINE_STANDARD_RTTIEXT(GeomEvaluator_SurfaceOfRevolution,GeomEvaluator_Surface)
0077 
0078 private:
0079   Handle(Geom_Curve)       myBaseCurve;
0080   Handle(Adaptor3d_Curve) myBaseAdaptor;
0081   gp_Ax1 myRotAxis;
0082 };
0083 
0084 DEFINE_STANDARD_HANDLE(GeomEvaluator_SurfaceOfRevolution, GeomEvaluator_Surface)
0085 
0086 
0087 #endif // _GeomEvaluator_SurfaceOfRevolution_HeaderFile