0029069: Samples - handle UNICODE filenames within C++/CLI CSharp sample
[occt.git] / src / Extrema / Extrema_EPCOfELPCOfLocateExtPC.hxx
CommitLineData
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_EPCOfELPCOfLocateExtPC_HeaderFile
18#define _Extrema_EPCOfELPCOfLocateExtPC_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_DefineAlloc.hxx>
22#include <Standard_Handle.hxx>
23
24#include <Standard_Boolean.hxx>
25#include <Standard_Integer.hxx>
26#include <Standard_Real.hxx>
27#include <Extrema_PCFOfEPCOfELPCOfLocateExtPC.hxx>
28class StdFail_NotDone;
29class Standard_OutOfRange;
30class Standard_TypeMismatch;
31class Adaptor3d_Curve;
32class Extrema_CurveTool;
33class Extrema_POnCurv;
34class gp_Pnt;
35class gp_Vec;
36class Extrema_PCFOfEPCOfELPCOfLocateExtPC;
42cf5bc1 37
38class Extrema_EPCOfELPCOfLocateExtPC
39{
40public:
41
42 DEFINE_STANDARD_ALLOC
43
44
45 Standard_EXPORT Extrema_EPCOfELPCOfLocateExtPC();
46
36b9ff75 47 //! It calculates all the distances.
48 //! The function F(u)=distance(P,C(u)) has an extremum
49 //! when g(u)=dF/du=0. The algorithm searchs all the
50 //! zeros inside the definition range of the curve.
51 //! NbU is used to locate the close points to
52 //! find the zeros.
53 //! Tol and TolU are used to decide to stop the
54 //! iterations according to the following condition:
55 //! if n is the number of iterations,
56 //! abs(Un-Un-1) < TolU and abs(F(Un)-F(Un-1)) < Tol.
42cf5bc1 57 Standard_EXPORT Extrema_EPCOfELPCOfLocateExtPC(const gp_Pnt& P, const Adaptor3d_Curve& C, const Standard_Integer NbU, const Standard_Real TolU, const Standard_Real TolF);
58
36b9ff75 59 //! It calculates all the distances.
60 //! The function F(u)=distance(P,C(u)) has an extremum
61 //! when g(u)=dF/du=0. The algorithm searchs all the
62 //! zeros inside the definition range of the curve.
63 //! NbU is used to locate the close points to
64 //! find the zeros.
65 //! Zeros are searched between umin and usup.
66 //! Tol and TolU are used to decide to stop the
67 //! iterations according to the following condition:
68 //! if n is the number of iterations,
69 //! abs(Un-Un-1) < TolU and abs(F(Un)-F(Un-1)) < Tol.
42cf5bc1 70 Standard_EXPORT Extrema_EPCOfELPCOfLocateExtPC(const gp_Pnt& P, const Adaptor3d_Curve& C, const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF);
71
36b9ff75 72 //! sets the fields of the algorithm.
42cf5bc1 73 Standard_EXPORT void Initialize (const Adaptor3d_Curve& C, const Standard_Integer NbU, const Standard_Real TolU, const Standard_Real TolF);
74
36b9ff75 75 //! sets the fields of the algorithm.
42cf5bc1 76 Standard_EXPORT void Initialize (const Adaptor3d_Curve& C, const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF);
77
36b9ff75 78 //! sets the fields of the algorithm.
42cf5bc1 79 Standard_EXPORT void Initialize (const Adaptor3d_Curve& C);
80
36b9ff75 81 //! sets the fields of the algorithm.
42cf5bc1 82 Standard_EXPORT void Initialize (const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF);
83
36b9ff75 84 //! the algorithm is done with the point P.
85 //! An exception is raised if the fields have not
86 //! been initialized.
42cf5bc1 87 Standard_EXPORT void Perform (const gp_Pnt& P);
88
36b9ff75 89 //! True if the distances are found.
42cf5bc1 90 Standard_EXPORT Standard_Boolean IsDone() const;
91
36b9ff75 92 //! Returns the number of extremum distances.
42cf5bc1 93 Standard_EXPORT Standard_Integer NbExt() const;
94
36b9ff75 95 //! Returns the value of the Nth extremum square distance.
42cf5bc1 96 Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
97
36b9ff75 98 //! Returns True if the Nth extremum distance is a
99 //! minimum.
42cf5bc1 100 Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const;
101
36b9ff75 102 //! Returns the point of the Nth extremum distance.
42cf5bc1 103 Standard_EXPORT const Extrema_POnCurv& Point (const Standard_Integer N) const;
104
105
106
107
108protected:
109
110
111
112
113
114private:
115
116
117
118 Standard_Boolean myDone;
119 Standard_Boolean myInit;
120 Standard_Integer mynbsample;
121 Standard_Real myumin;
122 Standard_Real myusup;
123 Standard_Real mytolu;
124 Standard_Real mytolF;
125 Extrema_PCFOfEPCOfELPCOfLocateExtPC myF;
126
127
128};
129
130
131
132
133
134
135
136#endif // _Extrema_EPCOfELPCOfLocateExtPC_HeaderFile