Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-17 08:35:15

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