0030520: VIS - IVtkTools_ShapePicker::GetPickPosition() returns incorrect point
[occt.git] / src / HLRBRep / HLRBRep_PCLocFOfTheLocateExtPCOfTheProjPCurOfCInter.hxx
1 // Created on: 1992-10-14
2 // Created by: Christophe MARION
3 // Copyright (c) 1992-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 _HLRBRep_PCLocFOfTheLocateExtPCOfTheProjPCurOfCInter_HeaderFile
18 #define _HLRBRep_PCLocFOfTheLocateExtPCOfTheProjPCurOfCInter_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <gp_Pnt2d.hxx>
25 #include <Standard_Address.hxx>
26 #include <Standard_Real.hxx>
27 #include <TColStd_SequenceOfReal.hxx>
28 #include <TColStd_SequenceOfInteger.hxx>
29 #include <Extrema_SequenceOfPOnCurv2d.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 HLRBRep_CurveTool;
36 class Extrema_POnCurv2d;
37 class gp_Pnt2d;
38 class gp_Vec2d;
39
40 class HLRBRep_PCLocFOfTheLocateExtPCOfTheProjPCurOfCInter  : public math_FunctionWithDerivative
41 {
42 public:
43
44   DEFINE_STANDARD_ALLOC
45
46   
47   Standard_EXPORT HLRBRep_PCLocFOfTheLocateExtPCOfTheProjPCurOfCInter();
48   
49   Standard_EXPORT HLRBRep_PCLocFOfTheLocateExtPCOfTheProjPCurOfCInter(const gp_Pnt2d& P, const Standard_Address& C);
50   
51   //! sets the field mycurve of the function.
52   Standard_EXPORT void Initialize (const Standard_Address& C);
53   
54   //! sets the field P of the function.
55   Standard_EXPORT void SetPoint (const gp_Pnt2d& P);
56   
57   //! Calculation of F(U).
58   Standard_EXPORT Standard_Boolean Value (const Standard_Real U, Standard_Real& F) Standard_OVERRIDE;
59   
60   //! Calculation of F'(U).
61   Standard_EXPORT Standard_Boolean Derivative (const Standard_Real U, Standard_Real& DF) Standard_OVERRIDE;
62   
63   //! Calculation of F(U) and F'(U).
64   Standard_EXPORT Standard_Boolean Values (const Standard_Real U, Standard_Real& F, Standard_Real& DF) Standard_OVERRIDE;
65   
66   //! Save the found extremum.
67   Standard_EXPORT virtual Standard_Integer GetStateNumber() Standard_OVERRIDE;
68   
69   //! Return the nunber of found extrema.
70   Standard_EXPORT Standard_Integer NbExt() const;
71   
72   //! Returns the Nth distance.
73   Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
74   
75   //! Shows if the Nth distance is a minimum.
76   Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const;
77   
78   //! Returns the Nth extremum.
79   Standard_EXPORT const Extrema_POnCurv2d& Point (const Standard_Integer N) const;
80   
81   //! Determines boundaries of subinterval for find of root.
82   Standard_EXPORT void SubIntervalInitialize (const Standard_Real theUfirst, const Standard_Real theUlast);
83   
84   //! Computes a Tol value. If 1st derivative of curve
85   //! |D1|<Tol, it is considered D1=0.
86   Standard_EXPORT Standard_Real SearchOfTolerance();
87
88
89
90
91 protected:
92
93
94
95
96
97 private:
98
99
100
101   gp_Pnt2d myP;
102   Standard_Address myC;
103   Standard_Real myU;
104   gp_Pnt2d myPc;
105   Standard_Real myD1f;
106   TColStd_SequenceOfReal mySqDist;
107   TColStd_SequenceOfInteger myIsMin;
108   Extrema_SequenceOfPOnCurv2d myPoint;
109   Standard_Boolean myPinit;
110   Standard_Boolean myCinit;
111   Standard_Boolean myD1Init;
112   Standard_Real myTol;
113   Standard_Integer myMaxDerivOrder;
114   Standard_Real myUinfium;
115   Standard_Real myUsupremum;
116
117
118 };
119
120
121
122
123
124
125
126 #endif // _HLRBRep_PCLocFOfTheLocateExtPCOfTheProjPCurOfCInter_HeaderFile