Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:13

0001 // Created on: 2002-08-02
0002 // Created by: Alexander KARTOMIN  (akm)
0003 // Copyright (c) 2002-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _LProp3d_SLProps_HeaderFile
0017 #define _LProp3d_SLProps_HeaderFile
0018 
0019 #include <Adaptor3d_Surface.hxx>
0020 #include <LProp_Status.hxx>
0021 
0022 class LProp3d_SLProps 
0023 {
0024 public:
0025 
0026   DEFINE_STANDARD_ALLOC
0027 
0028   
0029   //! Initializes the local properties of the surface <S>
0030   //! for the parameter values (<U>, <V>).
0031   //! The current point and the derivatives are
0032   //! computed at the same time, which allows an
0033   //! optimization of the computation time.
0034   //! <N> indicates the maximum number of derivations to
0035   //! be done (0, 1, or 2). For example, to compute
0036   //! only the tangent, N should be equal to 1.
0037   //! <Resolution> is the linear tolerance (it is used to test
0038   //! if a vector is null).
0039   Standard_EXPORT LProp3d_SLProps(const Handle(Adaptor3d_Surface)& S, const Standard_Real U, const Standard_Real V, const Standard_Integer N, const Standard_Real Resolution);
0040   
0041   //! idem as previous constructor but without setting the value
0042   //! of parameters <U> and <V>.
0043   Standard_EXPORT LProp3d_SLProps(const Handle(Adaptor3d_Surface)& S, const Standard_Integer N, const Standard_Real Resolution);
0044   
0045   //! idem as previous constructor but without setting the value
0046   //! of parameters <U> and <V> and the surface.
0047   //! the surface can have an empty constructor.
0048   Standard_EXPORT LProp3d_SLProps(const Standard_Integer N, const Standard_Real Resolution);
0049   
0050   //! Initializes the local properties of the surface S
0051   //! for the new surface.
0052   Standard_EXPORT void SetSurface (const Handle(Adaptor3d_Surface)& S);
0053   
0054   //! Initializes the local properties of the surface S
0055   //! for the new parameter values (<U>, <V>).
0056   Standard_EXPORT void SetParameters (const Standard_Real U, const Standard_Real V);
0057   
0058   //! Returns the point.
0059   Standard_EXPORT const gp_Pnt& Value() const;
0060   
0061   //! Returns the first U derivative.
0062   //! The derivative is computed if it has not been yet.
0063   Standard_EXPORT const gp_Vec& D1U();
0064   
0065   //! Returns the first V derivative.
0066   //! The derivative is computed if it has not been yet.
0067   Standard_EXPORT const gp_Vec& D1V();
0068   
0069   //! Returns the second U derivatives
0070   //! The derivative is computed if it has not been yet.
0071   Standard_EXPORT const gp_Vec& D2U();
0072   
0073   //! Returns the second V derivative.
0074   //! The derivative is computed if it has not been yet.
0075   Standard_EXPORT const gp_Vec& D2V();
0076   
0077   //! Returns the second UV cross-derivative.
0078   //! The derivative is computed if it has not been yet.
0079   Standard_EXPORT const gp_Vec& DUV();
0080   
0081   //! returns True if the U tangent is defined.
0082   //! For example, the tangent is not defined if the
0083   //! two first U derivatives are null.
0084   Standard_EXPORT Standard_Boolean IsTangentUDefined();
0085   
0086   //! Returns the tangent direction <D> on the iso-V.
0087   Standard_EXPORT void TangentU (gp_Dir& D);
0088   
0089   //! returns if the V tangent is defined.
0090   //! For example, the tangent is not defined if the
0091   //! two first V derivatives are null.
0092   Standard_EXPORT Standard_Boolean IsTangentVDefined();
0093   
0094   //! Returns the tangent direction <D> on the iso-V.
0095   Standard_EXPORT void TangentV (gp_Dir& D);
0096   
0097   //! Tells if the normal is defined.
0098   Standard_EXPORT Standard_Boolean IsNormalDefined();
0099   
0100   //! Returns the normal direction.
0101   Standard_EXPORT const gp_Dir& Normal();
0102   
0103   //! returns True if the curvature is defined.
0104   Standard_EXPORT Standard_Boolean IsCurvatureDefined();
0105   
0106   //! returns True if the point is umbilic (i.e. if the
0107   //! curvature is constant).
0108   Standard_EXPORT Standard_Boolean IsUmbilic();
0109   
0110   //! Returns the maximum curvature
0111   Standard_EXPORT Standard_Real MaxCurvature();
0112   
0113   //! Returns the minimum curvature
0114   Standard_EXPORT Standard_Real MinCurvature();
0115   
0116   //! Returns the direction of the maximum and minimum curvature
0117   //! <MaxD> and <MinD>
0118   Standard_EXPORT void CurvatureDirections (gp_Dir& MaxD, gp_Dir& MinD);
0119   
0120   //! Returns the mean curvature.
0121   Standard_EXPORT Standard_Real MeanCurvature();
0122   
0123   //! Returns the Gaussian curvature
0124   Standard_EXPORT Standard_Real GaussianCurvature();
0125 
0126 private:
0127 
0128   Handle(Adaptor3d_Surface) mySurf;
0129   Standard_Real myU;
0130   Standard_Real myV;
0131   Standard_Integer myDerOrder;
0132   Standard_Integer myCN;
0133   Standard_Real myLinTol;
0134   gp_Pnt myPnt;
0135   gp_Vec myD1u;
0136   gp_Vec myD1v;
0137   gp_Vec myD2u;
0138   gp_Vec myD2v;
0139   gp_Vec myDuv;
0140   gp_Dir myNormal;
0141   Standard_Real myMinCurv;
0142   Standard_Real myMaxCurv;
0143   gp_Dir myDirMinCurv;
0144   gp_Dir myDirMaxCurv;
0145   Standard_Real myMeanCurv;
0146   Standard_Real myGausCurv;
0147   Standard_Integer mySignificantFirstDerivativeOrderU;
0148   Standard_Integer mySignificantFirstDerivativeOrderV;
0149   LProp_Status myUTangentStatus;
0150   LProp_Status myVTangentStatus;
0151   LProp_Status myNormalStatus;
0152   LProp_Status myCurvatureStatus;
0153 
0154 };
0155 
0156 #endif // _LProp3d_SLProps_HeaderFile