CommitLineData
42cf5bc1 1// Created on: 2002-08-02
2// Created by: Alexander KARTOMIN (akm)
4//
5// This file is part of Open CASCADE Technology software library.
6//
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.
12//
13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
15
18
19#include <Standard.hxx>
20#include <Standard_DefineAlloc.hxx>
21#include <Standard_Handle.hxx>
22
23#include <Standard_Real.hxx>
24#include <Standard_Integer.hxx>
25#include <gp_Pnt.hxx>
26#include <gp_Vec.hxx>
27#include <gp_Dir.hxx>
28#include <LProp_Status.hxx>
29#include <Standard_Boolean.hxx>
32class Standard_DomainError;
33class Standard_OutOfRange;
34class LProp_NotDefined;
35class gp_Vec;
36class gp_Pnt;
37class gp_Dir;
38class LProp3d_CurveTool;
39
40
41
42class LProp3d_CLProps
43{
44public:
45
46 DEFINE_STANDARD_ALLOC
47
48
36b9ff75 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).
42cf5bc1 58 Standard_EXPORT LProp3d_CLProps(const Handle(Adaptor3d_HCurve)& C, const Standard_Integer N, const Standard_Real Resolution);
59
36b9ff75 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>.
42cf5bc1 63 Standard_EXPORT LProp3d_CLProps(const Handle(Adaptor3d_HCurve)& C, const Standard_Real U, const Standard_Integer N, const Standard_Real Resolution);
64
36b9ff75 65 //! Same as previous constructor but here the parameter is
66 //! set to the value <U> and the curve is set
67 //! with SetCurve.
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.
42cf5bc1 71 Standard_EXPORT LProp3d_CLProps(const Standard_Integer N, const Standard_Real Resolution);
72
36b9ff75 73 //! Initializes the local properties of the curve
74 //! for the parameter value <U>.
42cf5bc1 75 Standard_EXPORT void SetParameter (const Standard_Real U);
76
36b9ff75 77 //! Initializes the local properties of the curve
78 //! for the new curve.
42cf5bc1 79 Standard_EXPORT void SetCurve (const Handle(Adaptor3d_HCurve)& C);
80
36b9ff75 81 //! Returns the Point.
42cf5bc1 82 Standard_EXPORT const gp_Pnt& Value() const;
83
36b9ff75 84 //! Returns the first derivative.
85 //! The derivative is computed if it has not been yet.
42cf5bc1 86 Standard_EXPORT const gp_Vec& D1();
87
36b9ff75 88 //! Returns the second derivative.
89 //! The derivative is computed if it has not been yet.
42cf5bc1 90 Standard_EXPORT const gp_Vec& D2();
91
36b9ff75 92 //! Returns the third derivative.
93 //! The derivative is computed if it has not been yet.
42cf5bc1 94 Standard_EXPORT const gp_Vec& D3();
95
36b9ff75 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.
42cf5bc1 99 Standard_EXPORT Standard_Boolean IsTangentDefined();
100
36b9ff75 101 //! output the tangent direction <D>
42cf5bc1 102 Standard_EXPORT void Tangent (gp_Dir& D);
103
36b9ff75 104 //! Returns the curvature.
42cf5bc1 105 Standard_EXPORT Standard_Real Curvature();
106
36b9ff75 107 //! Returns the normal direction <N>.
42cf5bc1 108 Standard_EXPORT void Normal (gp_Dir& N);
109
36b9ff75 110 //! Returns the centre of curvature <P>.
42cf5bc1 111 Standard_EXPORT void CentreOfCurvature (gp_Pnt& P);
112
113
114
115
116protected:
117
118
119
120
121
122private:
123
124
125
127 Standard_Real myU;
128 Standard_Integer myDerOrder;
129 Standard_Real myCN;
130 Standard_Real myLinTol;
131 gp_Pnt myPnt;
132 gp_Vec myDerivArr[3];
133 gp_Dir myTangent;
134 Standard_Real myCurvature;
135 LProp_Status myTangentStatus;
136 Standard_Integer mySignificantFirstDerivativeOrder;
137
138
139};
140
141
142
143
144
145
146