42cf5bc1 |
1 | // Created on: 1991-02-26 |
2 | // Created by: Isabelle GRIGNON |
3 | // Copyright (c) 1991-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
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. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _Extrema_PCLocFOfLocEPCOfLocateExtPC_HeaderFile |
18 | #define _Extrema_PCLocFOfLocEPCOfLocateExtPC_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <gp_Pnt.hxx> |
25 | #include <Standard_Address.hxx> |
26 | #include <Standard_Real.hxx> |
27 | #include <TColStd_SequenceOfReal.hxx> |
28 | #include <TColStd_SequenceOfInteger.hxx> |
5d88fd54 |
29 | #include <Extrema_SequenceOfPOnCurv.hxx> |
42cf5bc1 |
30 | #include <Standard_Boolean.hxx> |
31 | #include <Standard_Integer.hxx> |
32 | #include <math_FunctionWithDerivative.hxx> |
33 | class Standard_OutOfRange; |
34 | class Standard_TypeMismatch; |
35 | class Adaptor3d_Curve; |
36 | class Extrema_CurveTool; |
37 | class Extrema_POnCurv; |
38 | class gp_Pnt; |
39 | class gp_Vec; |
42cf5bc1 |
40 | |
41 | class Extrema_PCLocFOfLocEPCOfLocateExtPC : public math_FunctionWithDerivative |
42 | { |
43 | public: |
44 | |
45 | DEFINE_STANDARD_ALLOC |
46 | |
47 | |
48 | Standard_EXPORT Extrema_PCLocFOfLocEPCOfLocateExtPC(); |
49 | |
50 | Standard_EXPORT Extrema_PCLocFOfLocEPCOfLocateExtPC(const gp_Pnt& P, const Adaptor3d_Curve& C); |
51 | |
36b9ff75 |
52 | //! sets the field mycurve of the function. |
42cf5bc1 |
53 | Standard_EXPORT void Initialize (const Adaptor3d_Curve& C); |
54 | |
36b9ff75 |
55 | //! sets the field P of the function. |
42cf5bc1 |
56 | Standard_EXPORT void SetPoint (const gp_Pnt& P); |
57 | |
36b9ff75 |
58 | //! Calculation of F(U). |
79104795 |
59 | Standard_EXPORT Standard_Boolean Value (const Standard_Real U, Standard_Real& F) Standard_OVERRIDE; |
42cf5bc1 |
60 | |
36b9ff75 |
61 | //! Calculation of F'(U). |
79104795 |
62 | Standard_EXPORT Standard_Boolean Derivative (const Standard_Real U, Standard_Real& DF) Standard_OVERRIDE; |
42cf5bc1 |
63 | |
36b9ff75 |
64 | //! Calculation of F(U) and F'(U). |
79104795 |
65 | Standard_EXPORT Standard_Boolean Values (const Standard_Real U, Standard_Real& F, Standard_Real& DF) Standard_OVERRIDE; |
42cf5bc1 |
66 | |
36b9ff75 |
67 | //! Save the found extremum. |
42cf5bc1 |
68 | Standard_EXPORT virtual Standard_Integer GetStateNumber() Standard_OVERRIDE; |
69 | |
36b9ff75 |
70 | //! Return the nunber of found extrema. |
42cf5bc1 |
71 | Standard_EXPORT Standard_Integer NbExt() const; |
72 | |
36b9ff75 |
73 | //! Returns the Nth distance. |
42cf5bc1 |
74 | Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const; |
75 | |
36b9ff75 |
76 | //! Shows if the Nth distance is a minimum. |
42cf5bc1 |
77 | Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const; |
78 | |
36b9ff75 |
79 | //! Returns the Nth extremum. |
42cf5bc1 |
80 | Standard_EXPORT const Extrema_POnCurv& Point (const Standard_Integer N) const; |
81 | |
36b9ff75 |
82 | //! Determines boundaries of subinterval for find of root. |
42cf5bc1 |
83 | Standard_EXPORT void SubIntervalInitialize (const Standard_Real theUfirst, const Standard_Real theUlast); |
84 | |
36b9ff75 |
85 | //! Computes a Tol value. If 1st derivative of curve |
86 | //! |D1|<Tol, it is considered D1=0. |
42cf5bc1 |
87 | Standard_EXPORT Standard_Real SearchOfTolerance(); |
88 | |
89 | |
90 | |
91 | |
92 | protected: |
93 | |
94 | |
95 | |
96 | |
97 | |
98 | private: |
99 | |
100 | |
101 | |
102 | gp_Pnt myP; |
103 | Standard_Address myC; |
104 | Standard_Real myU; |
105 | gp_Pnt myPc; |
106 | Standard_Real myD1f; |
107 | TColStd_SequenceOfReal mySqDist; |
108 | TColStd_SequenceOfInteger myIsMin; |
5d88fd54 |
109 | Extrema_SequenceOfPOnCurv myPoint; |
42cf5bc1 |
110 | Standard_Boolean myPinit; |
111 | Standard_Boolean myCinit; |
112 | Standard_Boolean myD1Init; |
113 | Standard_Real myTol; |
114 | Standard_Integer myMaxDerivOrder; |
115 | Standard_Real myUinfium; |
116 | Standard_Real myUsupremum; |
117 | |
118 | |
119 | }; |
120 | |
121 | |
122 | |
123 | |
124 | |
125 | |
126 | |
127 | #endif // _Extrema_PCLocFOfLocEPCOfLocateExtPC_HeaderFile |