1 // Created on: 1994-02-24
2 // Created by: Laurent BOURESCHE
3 // Copyright (c) 1994-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 _BRepLProp_CLProps_HeaderFile
18 #define _BRepLProp_CLProps_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
23 #include <BRepAdaptor_Curve.hxx>
27 #include <LProp_Status.hxx>
28 class LProp_BadContinuity;
29 class Standard_DomainError;
30 class Standard_OutOfRange;
31 class LProp_NotDefined;
32 class BRepAdaptor_Curve;
36 class BRepLProp_CurveTool;
40 class BRepLProp_CLProps
47 //! Initializes the local properties of the curve <C>
48 //! The current point and the derivatives are
49 //! computed at the same time, which allows an
50 //! optimization of the computation time.
51 //! <N> indicates the maximum number of derivations to
52 //! be done (0, 1, 2 or 3). For example, to compute
53 //! only the tangent, N should be equal to 1.
54 //! <Resolution> is the linear tolerance (it is used to test
55 //! if a vector is null).
56 Standard_EXPORT BRepLProp_CLProps(const BRepAdaptor_Curve& C, const Standard_Integer N, const Standard_Real Resolution);
58 //! Same as previous constructor but here the parameter is
59 //! set to the value <U>.
60 //! All the computations done will be related to <C> and <U>.
61 Standard_EXPORT BRepLProp_CLProps(const BRepAdaptor_Curve& C, const Standard_Real U, const Standard_Integer N, const Standard_Real Resolution);
63 //! Same as previous constructor but here the parameter is
64 //! set to the value <U> and the curve is set
66 //! the curve can have a empty constructor
67 //! All the computations done will be related to <C> and <U>
68 //! when the functions "set" will be done.
69 Standard_EXPORT BRepLProp_CLProps(const Standard_Integer N, const Standard_Real Resolution);
71 //! Initializes the local properties of the curve
72 //! for the parameter value <U>.
73 Standard_EXPORT void SetParameter (const Standard_Real U);
75 //! Initializes the local properties of the curve
76 //! for the new curve.
77 Standard_EXPORT void SetCurve (const BRepAdaptor_Curve& C);
79 //! Returns the Point.
80 Standard_EXPORT const gp_Pnt& Value() const;
82 //! Returns the first derivative.
83 //! The derivative is computed if it has not been yet.
84 Standard_EXPORT const gp_Vec& D1();
86 //! Returns the second derivative.
87 //! The derivative is computed if it has not been yet.
88 Standard_EXPORT const gp_Vec& D2();
90 //! Returns the third derivative.
91 //! The derivative is computed if it has not been yet.
92 Standard_EXPORT const gp_Vec& D3();
94 //! Returns True if the tangent is defined.
95 //! For example, the tangent is not defined if the
96 //! three first derivatives are all null.
97 Standard_EXPORT Standard_Boolean IsTangentDefined();
99 //! output the tangent direction <D>
100 Standard_EXPORT void Tangent (gp_Dir& D);
102 //! Returns the curvature.
103 Standard_EXPORT Standard_Real Curvature();
105 //! Returns the normal direction <N>.
106 Standard_EXPORT void Normal (gp_Dir& N);
108 //! Returns the centre of curvature <P>.
109 Standard_EXPORT void CentreOfCurvature (gp_Pnt& P);
124 BRepAdaptor_Curve myCurve;
126 Standard_Integer myDerOrder;
128 Standard_Real myLinTol;
130 gp_Vec myDerivArr[3];
132 Standard_Real myCurvature;
133 LProp_Status myTangentStatus;
134 Standard_Integer mySignificantFirstDerivativeOrder;
145 #endif // _BRepLProp_CLProps_HeaderFile