Back to home page

EIC code displayed by LXR

 
 

    


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

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