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> |
29 | #include <Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC.hxx> |
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; |
40 | class Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC; |
41 | class Extrema_SequenceNodeOfSeqPCOfPCLocFOfLocEPCOfLocateExtPC; |
42 | |
43 | |
44 | |
45 | class Extrema_PCLocFOfLocEPCOfLocateExtPC : public math_FunctionWithDerivative |
46 | { |
47 | public: |
48 | |
49 | DEFINE_STANDARD_ALLOC |
50 | |
51 | |
52 | Standard_EXPORT Extrema_PCLocFOfLocEPCOfLocateExtPC(); |
53 | |
54 | Standard_EXPORT Extrema_PCLocFOfLocEPCOfLocateExtPC(const gp_Pnt& P, const Adaptor3d_Curve& C); |
55 | |
36b9ff75 |
56 | //! sets the field mycurve of the function. |
42cf5bc1 |
57 | Standard_EXPORT void Initialize (const Adaptor3d_Curve& C); |
58 | |
36b9ff75 |
59 | //! sets the field P of the function. |
42cf5bc1 |
60 | Standard_EXPORT void SetPoint (const gp_Pnt& P); |
61 | |
36b9ff75 |
62 | //! Calculation of F(U). |
42cf5bc1 |
63 | Standard_EXPORT Standard_Boolean Value (const Standard_Real U, Standard_Real& F); |
64 | |
36b9ff75 |
65 | //! Calculation of F'(U). |
42cf5bc1 |
66 | Standard_EXPORT Standard_Boolean Derivative (const Standard_Real U, Standard_Real& DF); |
67 | |
36b9ff75 |
68 | //! Calculation of F(U) and F'(U). |
42cf5bc1 |
69 | Standard_EXPORT Standard_Boolean Values (const Standard_Real U, Standard_Real& F, Standard_Real& DF); |
70 | |
36b9ff75 |
71 | //! Save the found extremum. |
42cf5bc1 |
72 | Standard_EXPORT virtual Standard_Integer GetStateNumber() Standard_OVERRIDE; |
73 | |
36b9ff75 |
74 | //! Return the nunber of found extrema. |
42cf5bc1 |
75 | Standard_EXPORT Standard_Integer NbExt() const; |
76 | |
36b9ff75 |
77 | //! Returns the Nth distance. |
42cf5bc1 |
78 | Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const; |
79 | |
36b9ff75 |
80 | //! Shows if the Nth distance is a minimum. |
42cf5bc1 |
81 | Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const; |
82 | |
36b9ff75 |
83 | //! Returns the Nth extremum. |
42cf5bc1 |
84 | Standard_EXPORT const Extrema_POnCurv& Point (const Standard_Integer N) const; |
85 | |
36b9ff75 |
86 | //! Determines boundaries of subinterval for find of root. |
42cf5bc1 |
87 | Standard_EXPORT void SubIntervalInitialize (const Standard_Real theUfirst, const Standard_Real theUlast); |
88 | |
36b9ff75 |
89 | //! Computes a Tol value. If 1st derivative of curve |
90 | //! |D1|<Tol, it is considered D1=0. |
42cf5bc1 |
91 | Standard_EXPORT Standard_Real SearchOfTolerance(); |
92 | |
93 | |
94 | |
95 | |
96 | protected: |
97 | |
98 | |
99 | |
100 | |
101 | |
102 | private: |
103 | |
104 | |
105 | |
106 | gp_Pnt myP; |
107 | Standard_Address myC; |
108 | Standard_Real myU; |
109 | gp_Pnt myPc; |
110 | Standard_Real myD1f; |
111 | TColStd_SequenceOfReal mySqDist; |
112 | TColStd_SequenceOfInteger myIsMin; |
113 | Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC myPoint; |
114 | Standard_Boolean myPinit; |
115 | Standard_Boolean myCinit; |
116 | Standard_Boolean myD1Init; |
117 | Standard_Real myTol; |
118 | Standard_Integer myMaxDerivOrder; |
119 | Standard_Real myUinfium; |
120 | Standard_Real myUsupremum; |
121 | |
122 | |
123 | }; |
124 | |
125 | |
126 | |
127 | |
128 | |
129 | |
130 | |
131 | #endif // _Extrema_PCLocFOfLocEPCOfLocateExtPC_HeaderFile |