42cf5bc1 |
1 | // Created on: 2002-08-02 |
2 | // Created by: Alexander KARTOMIN (akm) |
3 | // Copyright (c) 2002-2014 OPEN CASCADE SAS |
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 | |
16 | #ifndef _LProp3d_CLProps_HeaderFile |
17 | #define _LProp3d_CLProps_HeaderFile |
18 | |
c22b52d6 |
19 | #include <Adaptor3d_Curve.hxx> |
42cf5bc1 |
20 | #include <gp_Pnt.hxx> |
21 | #include <gp_Vec.hxx> |
22 | #include <gp_Dir.hxx> |
23 | #include <LProp_Status.hxx> |
c22b52d6 |
24 | |
42cf5bc1 |
25 | class LProp_BadContinuity; |
26 | class Standard_DomainError; |
27 | class Standard_OutOfRange; |
28 | class LProp_NotDefined; |
29 | class gp_Vec; |
30 | class gp_Pnt; |
31 | class gp_Dir; |
32 | class LProp3d_CurveTool; |
33 | |
34 | |
35 | |
36 | class LProp3d_CLProps |
37 | { |
38 | public: |
39 | |
40 | DEFINE_STANDARD_ALLOC |
41 | |
42 | |
36b9ff75 |
43 | //! Initializes the local properties of the curve <C> |
44 | //! The current point and the derivatives are |
45 | //! computed at the same time, which allows an |
46 | //! optimization of the computation time. |
47 | //! <N> indicates the maximum number of derivations to |
48 | //! be done (0, 1, 2 or 3). For example, to compute |
49 | //! only the tangent, N should be equal to 1. |
50 | //! <Resolution> is the linear tolerance (it is used to test |
51 | //! if a vector is null). |
c22b52d6 |
52 | Standard_EXPORT LProp3d_CLProps(const Handle(Adaptor3d_Curve)& C, const Standard_Integer N, const Standard_Real Resolution); |
42cf5bc1 |
53 | |
36b9ff75 |
54 | //! Same as previous constructor but here the parameter is |
55 | //! set to the value <U>. |
56 | //! All the computations done will be related to <C> and <U>. |
c22b52d6 |
57 | Standard_EXPORT LProp3d_CLProps(const Handle(Adaptor3d_Curve)& C, const Standard_Real U, const Standard_Integer N, const Standard_Real Resolution); |
42cf5bc1 |
58 | |
36b9ff75 |
59 | //! Same as previous constructor but here the parameter is |
60 | //! set to the value <U> and the curve is set |
61 | //! with SetCurve. |
62 | //! the curve can have a empty constructor |
63 | //! All the computations done will be related to <C> and <U> |
64 | //! when the functions "set" will be done. |
42cf5bc1 |
65 | Standard_EXPORT LProp3d_CLProps(const Standard_Integer N, const Standard_Real Resolution); |
66 | |
36b9ff75 |
67 | //! Initializes the local properties of the curve |
68 | //! for the parameter value <U>. |
42cf5bc1 |
69 | Standard_EXPORT void SetParameter (const Standard_Real U); |
70 | |
36b9ff75 |
71 | //! Initializes the local properties of the curve |
72 | //! for the new curve. |
c22b52d6 |
73 | Standard_EXPORT void SetCurve (const Handle(Adaptor3d_Curve)& C); |
42cf5bc1 |
74 | |
36b9ff75 |
75 | //! Returns the Point. |
42cf5bc1 |
76 | Standard_EXPORT const gp_Pnt& Value() const; |
77 | |
36b9ff75 |
78 | //! Returns the first derivative. |
79 | //! The derivative is computed if it has not been yet. |
42cf5bc1 |
80 | Standard_EXPORT const gp_Vec& D1(); |
81 | |
36b9ff75 |
82 | //! Returns the second derivative. |
83 | //! The derivative is computed if it has not been yet. |
42cf5bc1 |
84 | Standard_EXPORT const gp_Vec& D2(); |
85 | |
36b9ff75 |
86 | //! Returns the third derivative. |
87 | //! The derivative is computed if it has not been yet. |
42cf5bc1 |
88 | Standard_EXPORT const gp_Vec& D3(); |
89 | |
36b9ff75 |
90 | //! Returns True if the tangent is defined. |
91 | //! For example, the tangent is not defined if the |
92 | //! three first derivatives are all null. |
42cf5bc1 |
93 | Standard_EXPORT Standard_Boolean IsTangentDefined(); |
94 | |
36b9ff75 |
95 | //! output the tangent direction <D> |
42cf5bc1 |
96 | Standard_EXPORT void Tangent (gp_Dir& D); |
97 | |
36b9ff75 |
98 | //! Returns the curvature. |
42cf5bc1 |
99 | Standard_EXPORT Standard_Real Curvature(); |
100 | |
36b9ff75 |
101 | //! Returns the normal direction <N>. |
42cf5bc1 |
102 | Standard_EXPORT void Normal (gp_Dir& N); |
103 | |
36b9ff75 |
104 | //! Returns the centre of curvature <P>. |
42cf5bc1 |
105 | Standard_EXPORT void CentreOfCurvature (gp_Pnt& P); |
106 | |
107 | |
108 | |
109 | |
110 | protected: |
111 | |
112 | |
113 | |
114 | |
115 | |
116 | private: |
117 | |
118 | |
119 | |
c22b52d6 |
120 | Handle(Adaptor3d_Curve) myCurve; |
42cf5bc1 |
121 | Standard_Real myU; |
122 | Standard_Integer myDerOrder; |
123 | Standard_Real myCN; |
124 | Standard_Real myLinTol; |
125 | gp_Pnt myPnt; |
126 | gp_Vec myDerivArr[3]; |
127 | gp_Dir myTangent; |
128 | Standard_Real myCurvature; |
129 | LProp_Status myTangentStatus; |
130 | Standard_Integer mySignificantFirstDerivativeOrder; |
131 | |
132 | |
133 | }; |
134 | |
135 | |
136 | |
137 | |
138 | |
139 | |
140 | |
141 | #endif // _LProp3d_CLProps_HeaderFile |