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_SurfaceOfExtrusion_HeaderFile
0016 #define _GeomEvaluator_SurfaceOfExtrusion_HeaderFile
0017 
0018 #include <Adaptor3d_Curve.hxx>
0019 #include <GeomEvaluator_Surface.hxx>
0020 #include <Geom_Curve.hxx>
0021 #include <gp_Dir.hxx>
0022 
0023 //! Allows to calculate values and derivatives for surfaces of linear extrusion
0024 class GeomEvaluator_SurfaceOfExtrusion : public GeomEvaluator_Surface
0025 {
0026 public:
0027   //! Initialize evaluator by surface
0028   Standard_EXPORT GeomEvaluator_SurfaceOfExtrusion(const Handle(Geom_Curve)& theBase,
0029                                                    const gp_Dir& theExtrusionDir);
0030   //! Initialize evaluator by surface adaptor
0031   Standard_EXPORT GeomEvaluator_SurfaceOfExtrusion(const Handle(Adaptor3d_Curve)& theBase,
0032                                                    const gp_Dir& theExtrusionDir);
0033 
0034   ///! Changes the direction of extrusion
0035   void SetDirection(const gp_Dir& theDirection)
0036   { myDirection = theDirection; }
0037 
0038   //! Value of surface
0039   Standard_EXPORT void D0(const Standard_Real theU, const Standard_Real theV,
0040                           gp_Pnt& theValue) const Standard_OVERRIDE;
0041   //! Value and first derivatives of surface
0042   Standard_EXPORT void D1(const Standard_Real theU, const Standard_Real theV,
0043                           gp_Pnt& theValue, gp_Vec& theD1U, gp_Vec& theD1V) const Standard_OVERRIDE;
0044   //! Value, first and second derivatives of surface
0045   Standard_EXPORT void D2(const Standard_Real theU, const Standard_Real theV,
0046                           gp_Pnt& theValue, gp_Vec& theD1U, gp_Vec& theD1V,
0047                           gp_Vec& theD2U, gp_Vec& theD2V, gp_Vec& theD2UV) const Standard_OVERRIDE;
0048   //! Value, first, second and third derivatives of surface
0049   Standard_EXPORT void D3(const Standard_Real theU, const Standard_Real theV,
0050                           gp_Pnt& theValue, gp_Vec& theD1U, gp_Vec& theD1V,
0051                           gp_Vec& theD2U, gp_Vec& theD2V, gp_Vec& theD2UV,
0052                           gp_Vec& theD3U, gp_Vec& theD3V,
0053                           gp_Vec& theD3UUV, gp_Vec& theD3UVV) const Standard_OVERRIDE;
0054   //! Calculates N-th derivatives of surface, where N = theDerU + theDerV.
0055   //!
0056   //! Raises if N < 1 or theDerU < 0 or theDerV < 0
0057   Standard_EXPORT gp_Vec DN(const Standard_Real theU,
0058                             const Standard_Real theV,
0059                             const Standard_Integer theDerU,
0060                             const Standard_Integer theDerV) const Standard_OVERRIDE;
0061 
0062   Standard_EXPORT Handle(GeomEvaluator_Surface) ShallowCopy() const Standard_OVERRIDE;
0063 
0064   DEFINE_STANDARD_RTTIEXT(GeomEvaluator_SurfaceOfExtrusion,GeomEvaluator_Surface)
0065 
0066 private:
0067   //! Shift the point along direction to the given distance (theShift)
0068   void Shift(const Standard_Real theShift, gp_Pnt& thePoint) const
0069   {
0070     thePoint.ChangeCoord() += myDirection.XYZ() * theShift;
0071   }
0072 
0073 private:
0074   Handle(Geom_Curve)       myBaseCurve;
0075   Handle(Adaptor3d_Curve) myBaseAdaptor;
0076 
0077   gp_Dir myDirection;
0078 };
0079 
0080 DEFINE_STANDARD_HANDLE(GeomEvaluator_SurfaceOfExtrusion, GeomEvaluator_Surface)
0081 
0082 
0083 #endif // _GeomEvaluator_SurfaceOfExtrusion_HeaderFile