1 // Created on: 1992-10-14
2 // Created by: Christophe MARION
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _HLRBRep_CLProps_HeaderFile
18 #define _HLRBRep_CLProps_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Real.hxx>
25 #include <Standard_Integer.hxx>
26 #include <gp_Pnt2d.hxx>
27 #include <gp_Vec2d.hxx>
28 #include <gp_Dir2d.hxx>
29 #include <LProp_Status.hxx>
30 #include <Standard_Boolean.hxx>
31 class LProp_BadContinuity;
32 class Standard_DomainError;
33 class Standard_OutOfRange;
34 class LProp_NotDefined;
38 class HLRBRep_CLPropsATool;
50 //! Initializes the local properties of the curve <C>
51 //! The current point and the derivatives are
52 //! computed at the same time, which allows an
53 //! optimization of the computation time.
54 //! <N> indicates the maximum number of derivations to
55 //! be done (0, 1, 2 or 3). For example, to compute
56 //! only the tangent, N should be equal to 1.
57 //! <Resolution> is the linear tolerance (it is used to test
58 //! if a vector is null).
59 Standard_EXPORT HLRBRep_CLProps(const HLRBRep_Curve*& C, const Standard_Integer N, const Standard_Real Resolution);
61 //! Same as previous constructor but here the parameter is
62 //! set to the value <U>.
63 //! All the computations done will be related to <C> and <U>.
64 Standard_EXPORT HLRBRep_CLProps(const HLRBRep_Curve*& C, const Standard_Real U, const Standard_Integer N, const Standard_Real Resolution);
66 //! Same as previous constructor but here the parameter is
67 //! set to the value <U> and the curve is set
69 //! the curve can have a empty constructor
70 //! All the computations done will be related to <C> and <U>
71 //! when the functions "set" will be done.
72 Standard_EXPORT HLRBRep_CLProps(const Standard_Integer N, const Standard_Real Resolution);
74 //! Initializes the local properties of the curve
75 //! for the parameter value <U>.
76 Standard_EXPORT void SetParameter (const Standard_Real U);
78 //! Initializes the local properties of the curve
79 //! for the new curve.
80 Standard_EXPORT void SetCurve (const HLRBRep_Curve*& C);
82 //! Returns the Point.
83 Standard_EXPORT const gp_Pnt2d& Value() const;
85 //! Returns the first derivative.
86 //! The derivative is computed if it has not been yet.
87 Standard_EXPORT const gp_Vec2d& D1();
89 //! Returns the second derivative.
90 //! The derivative is computed if it has not been yet.
91 Standard_EXPORT const gp_Vec2d& D2();
93 //! Returns the third derivative.
94 //! The derivative is computed if it has not been yet.
95 Standard_EXPORT const gp_Vec2d& D3();
97 //! Returns True if the tangent is defined.
98 //! For example, the tangent is not defined if the
99 //! three first derivatives are all null.
100 Standard_EXPORT Standard_Boolean IsTangentDefined();
102 //! output the tangent direction <D>
103 Standard_EXPORT void Tangent (gp_Dir2d& D);
105 //! Returns the curvature.
106 Standard_EXPORT Standard_Real Curvature();
108 //! Returns the normal direction <N>.
109 Standard_EXPORT void Normal (gp_Dir2d& N);
111 //! Returns the centre of curvature <P>.
112 Standard_EXPORT void CentreOfCurvature (gp_Pnt2d& P);
127 const HLRBRep_Curve* myCurve;
129 Standard_Integer myDerOrder;
131 Standard_Real myLinTol;
133 gp_Vec2d myDerivArr[3];
135 Standard_Real myCurvature;
136 LProp_Status myTangentStatus;
137 Standard_Integer mySignificantFirstDerivativeOrder;
148 #endif // _HLRBRep_CLProps_HeaderFile