Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:46: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 _Geom2dLProp_CLProps2d_HeaderFile
0018 #define _Geom2dLProp_CLProps2d_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Real.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <gp_Pnt2d.hxx>
0027 #include <gp_Vec2d.hxx>
0028 #include <gp_Dir2d.hxx>
0029 #include <LProp_Status.hxx>
0030 #include <Standard_Boolean.hxx>
0031 class Geom2d_Curve;
0032 class LProp_BadContinuity;
0033 class Standard_DomainError;
0034 class Standard_OutOfRange;
0035 class LProp_NotDefined;
0036 class gp_Vec2d;
0037 class gp_Pnt2d;
0038 class gp_Dir2d;
0039 class Geom2dLProp_Curve2dTool;
0040 
0041 
0042 
0043 class Geom2dLProp_CLProps2d 
0044 {
0045 public:
0046 
0047   DEFINE_STANDARD_ALLOC
0048 
0049   
0050   //! Initializes the local properties of the curve <C>
0051   //! The current point and the derivatives are
0052   //! computed at the same time, which allows an
0053   //! optimization of the computation time.
0054   //! <N> indicates the maximum number of derivations to
0055   //! be done (0, 1, 2 or 3). For example, to compute
0056   //! only the tangent, N should be equal to 1.
0057   //! <Resolution> is the linear tolerance (it is used to test
0058   //! if a vector is null).
0059   Standard_EXPORT Geom2dLProp_CLProps2d(const Handle(Geom2d_Curve)& C, const Standard_Integer N, const Standard_Real Resolution);
0060   
0061   //! Same as previous constructor but here the parameter is
0062   //! set to the value <U>.
0063   //! All the computations done will be related to <C> and <U>.
0064   Standard_EXPORT Geom2dLProp_CLProps2d(const Handle(Geom2d_Curve)& C, const Standard_Real U, const Standard_Integer N, const Standard_Real Resolution);
0065   
0066   //! Same as previous constructor but here the parameter is
0067   //! set to the value <U> and the curve is set
0068   //! with SetCurve.
0069   //! the curve can have a empty constructor
0070   //! All the computations done will be related to <C> and <U>
0071   //! when the functions "set" will be done.
0072   Standard_EXPORT Geom2dLProp_CLProps2d(const Standard_Integer N, const Standard_Real Resolution);
0073   
0074   //! Initializes the local properties of the curve
0075   //! for the parameter value <U>.
0076   Standard_EXPORT void SetParameter (const Standard_Real U);
0077   
0078   //! Initializes the local properties of the curve
0079   //! for the new curve.
0080   Standard_EXPORT void SetCurve (const Handle(Geom2d_Curve)& C);
0081   
0082   //! Returns the Point.
0083   Standard_EXPORT const gp_Pnt2d& Value() const;
0084   
0085   //! Returns the first derivative.
0086   //! The derivative is computed if it has not been yet.
0087   Standard_EXPORT const gp_Vec2d& D1();
0088   
0089   //! Returns the second derivative.
0090   //! The derivative is computed if it has not been yet.
0091   Standard_EXPORT const gp_Vec2d& D2();
0092   
0093   //! Returns the third derivative.
0094   //! The derivative is computed if it has not been yet.
0095   Standard_EXPORT const gp_Vec2d& D3();
0096   
0097   //! Returns True if the tangent is defined.
0098   //! For example, the tangent is not defined if the
0099   //! three first derivatives are all null.
0100   Standard_EXPORT Standard_Boolean IsTangentDefined();
0101   
0102   //! output  the tangent direction <D>
0103   Standard_EXPORT void Tangent (gp_Dir2d& D);
0104   
0105   //! Returns the curvature.
0106   Standard_EXPORT Standard_Real Curvature();
0107   
0108   //! Returns the normal direction <N>.
0109   Standard_EXPORT void Normal (gp_Dir2d& N);
0110   
0111   //! Returns the centre of curvature <P>.
0112   Standard_EXPORT void CentreOfCurvature (gp_Pnt2d& P);
0113 
0114 
0115 
0116 
0117 protected:
0118 
0119 
0120 
0121 
0122 
0123 private:
0124 
0125 
0126 
0127   Handle(Geom2d_Curve) myCurve;
0128   Standard_Real myU;
0129   Standard_Integer myDerOrder;
0130   Standard_Real myCN;
0131   Standard_Real myLinTol;
0132   gp_Pnt2d myPnt;
0133   gp_Vec2d myDerivArr[3];
0134   gp_Dir2d myTangent;
0135   Standard_Real myCurvature;
0136   LProp_Status myTangentStatus;
0137   Standard_Integer mySignificantFirstDerivativeOrder;
0138 
0139 
0140 };
0141 
0142 
0143 
0144 
0145 
0146 
0147 
0148 #endif // _Geom2dLProp_CLProps2d_HeaderFile