Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-26 09:16:25

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) { myDirection = theDirection; }
0036 
0037   //! Value of surface
0038   Standard_EXPORT void D0(const Standard_Real theU,
0039                           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,
0043                           const Standard_Real theV,
0044                           gp_Pnt&             theValue,
0045                           gp_Vec&             theD1U,
0046                           gp_Vec&             theD1V) const Standard_OVERRIDE;
0047   //! Value, first and second derivatives of surface
0048   Standard_EXPORT void D2(const Standard_Real theU,
0049                           const Standard_Real theV,
0050                           gp_Pnt&             theValue,
0051                           gp_Vec&             theD1U,
0052                           gp_Vec&             theD1V,
0053                           gp_Vec&             theD2U,
0054                           gp_Vec&             theD2V,
0055                           gp_Vec&             theD2UV) const Standard_OVERRIDE;
0056   //! Value, first, second and third derivatives of surface
0057   Standard_EXPORT void D3(const Standard_Real theU,
0058                           const Standard_Real theV,
0059                           gp_Pnt&             theValue,
0060                           gp_Vec&             theD1U,
0061                           gp_Vec&             theD1V,
0062                           gp_Vec&             theD2U,
0063                           gp_Vec&             theD2V,
0064                           gp_Vec&             theD2UV,
0065                           gp_Vec&             theD3U,
0066                           gp_Vec&             theD3V,
0067                           gp_Vec&             theD3UUV,
0068                           gp_Vec&             theD3UVV) const Standard_OVERRIDE;
0069   //! Calculates N-th derivatives of surface, where N = theDerU + theDerV.
0070   //!
0071   //! Raises if N < 1 or theDerU < 0 or theDerV < 0
0072   Standard_EXPORT gp_Vec DN(const Standard_Real    theU,
0073                             const Standard_Real    theV,
0074                             const Standard_Integer theDerU,
0075                             const Standard_Integer theDerV) const Standard_OVERRIDE;
0076 
0077   Standard_EXPORT Handle(GeomEvaluator_Surface) ShallowCopy() const Standard_OVERRIDE;
0078 
0079   DEFINE_STANDARD_RTTIEXT(GeomEvaluator_SurfaceOfExtrusion, GeomEvaluator_Surface)
0080 
0081 private:
0082   //! Shift the point along direction to the given distance (theShift)
0083   void Shift(const Standard_Real theShift, gp_Pnt& thePoint) const
0084   {
0085     thePoint.ChangeCoord() += myDirection.XYZ() * theShift;
0086   }
0087 
0088 private:
0089   Handle(Geom_Curve)      myBaseCurve;
0090   Handle(Adaptor3d_Curve) myBaseAdaptor;
0091 
0092   gp_Dir myDirection;
0093 };
0094 
0095 DEFINE_STANDARD_HANDLE(GeomEvaluator_SurfaceOfExtrusion, GeomEvaluator_Surface)
0096 
0097 #endif // _GeomEvaluator_SurfaceOfExtrusion_HeaderFile