1 // Created on: 2002-08-02
2 // Created by: Alexander KARTOMIN (akm)
3 // Copyright (c) 2002-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _LProp3d_CLProps_HeaderFile
17 #define _LProp3d_CLProps_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_DefineAlloc.hxx>
21 #include <Standard_Handle.hxx>
23 #include <Standard_Real.hxx>
24 #include <Standard_Integer.hxx>
28 #include <LProp_Status.hxx>
29 #include <Standard_Boolean.hxx>
30 class Adaptor3d_HCurve;
31 class LProp_BadContinuity;
32 class Standard_DomainError;
33 class Standard_OutOfRange;
34 class LProp_NotDefined;
38 class LProp3d_CurveTool;
49 //! Initializes the local properties of the curve <C>
50 //! The current point and the derivatives are
51 //! computed at the same time, which allows an
52 //! optimization of the computation time.
53 //! <N> indicates the maximum number of derivations to
54 //! be done (0, 1, 2 or 3). For example, to compute
55 //! only the tangent, N should be equal to 1.
56 //! <Resolution> is the linear tolerance (it is used to test
57 //! if a vector is null).
58 Standard_EXPORT LProp3d_CLProps(const Handle(Adaptor3d_HCurve)& C, const Standard_Integer N, const Standard_Real Resolution);
60 //! Same as previous constructor but here the parameter is
61 //! set to the value <U>.
62 //! All the computations done will be related to <C> and <U>.
63 Standard_EXPORT LProp3d_CLProps(const Handle(Adaptor3d_HCurve)& C, const Standard_Real U, const Standard_Integer N, const Standard_Real Resolution);
65 //! Same as previous constructor but here the parameter is
66 //! set to the value <U> and the curve is set
68 //! the curve can have a empty constructor
69 //! All the computations done will be related to <C> and <U>
70 //! when the functions "set" will be done.
71 Standard_EXPORT LProp3d_CLProps(const Standard_Integer N, const Standard_Real Resolution);
73 //! Initializes the local properties of the curve
74 //! for the parameter value <U>.
75 Standard_EXPORT void SetParameter (const Standard_Real U);
77 //! Initializes the local properties of the curve
78 //! for the new curve.
79 Standard_EXPORT void SetCurve (const Handle(Adaptor3d_HCurve)& C);
81 //! Returns the Point.
82 Standard_EXPORT const gp_Pnt& Value() const;
84 //! Returns the first derivative.
85 //! The derivative is computed if it has not been yet.
86 Standard_EXPORT const gp_Vec& D1();
88 //! Returns the second derivative.
89 //! The derivative is computed if it has not been yet.
90 Standard_EXPORT const gp_Vec& D2();
92 //! Returns the third derivative.
93 //! The derivative is computed if it has not been yet.
94 Standard_EXPORT const gp_Vec& D3();
96 //! Returns True if the tangent is defined.
97 //! For example, the tangent is not defined if the
98 //! three first derivatives are all null.
99 Standard_EXPORT Standard_Boolean IsTangentDefined();
101 //! output the tangent direction <D>
102 Standard_EXPORT void Tangent (gp_Dir& D);
104 //! Returns the curvature.
105 Standard_EXPORT Standard_Real Curvature();
107 //! Returns the normal direction <N>.
108 Standard_EXPORT void Normal (gp_Dir& N);
110 //! Returns the centre of curvature <P>.
111 Standard_EXPORT void CentreOfCurvature (gp_Pnt& P);
126 Handle(Adaptor3d_HCurve) myCurve;
128 Standard_Integer myDerOrder;
130 Standard_Real myLinTol;
132 gp_Vec myDerivArr[3];
134 Standard_Real myCurvature;
135 LProp_Status myTangentStatus;
136 Standard_Integer mySignificantFirstDerivativeOrder;
147 #endif // _LProp3d_CLProps_HeaderFile