0029069: Samples - handle UNICODE filenames within C++/CLI CSharp sample
[occt.git] / src / Extrema / Extrema_ECC.hxx
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_ECC_HeaderFile
18 #define _Extrema_ECC_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_Real.hxx>
26 #include <math_Vector.hxx>
27 #include <TColStd_SequenceOfReal.hxx>
28 #include <Standard_Address.hxx>
29 #include <TColgp_HArray1OfPnt.hxx>
30 #include <Standard_Integer.hxx>
31 class StdFail_InfiniteSolutions;
32 class StdFail_NotDone;
33 class Standard_OutOfRange;
34 class Adaptor3d_Curve;
35 class Extrema_CurveTool;
36 class Extrema_POnCurv;
37 class gp_Pnt;
38 class gp_Vec;
39
40
41
42 class Extrema_ECC 
43 {
44 public:
45
46   DEFINE_STANDARD_ALLOC
47
48   
49   //! Calculates all the distances as above
50   //! between Uinf and Usup for C1 and  between Vinf and Vsup
51   //! for C2.
52   Standard_EXPORT Extrema_ECC();
53   
54   //! It calculates all the distances.
55   //! The function F(u,v)=distance(C1(u),C2(v)) has an
56   //! extremum when gradient(f)=0. The algorithm uses
57   //! Evtushenko's global optimization solver.
58   Standard_EXPORT Extrema_ECC(const Adaptor3d_Curve& C1, const Adaptor3d_Curve& C2);
59   
60   //! Calculates all the distances as above
61   //! between Uinf and Usup for C1 and  between Vinf and Vsup
62   //! for C2.
63   Standard_EXPORT Extrema_ECC(const Adaptor3d_Curve& C1, const Adaptor3d_Curve& C2, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real Vinf, const Standard_Real Vsup);
64   
65   //! Set params in case of empty constructor is usage.
66   Standard_EXPORT void SetParams (const Adaptor3d_Curve& C1, const Adaptor3d_Curve& C2, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real Vinf, const Standard_Real Vsup);
67   
68   Standard_EXPORT void SetTolerance (const Standard_Real Tol);
69
70   //! Set flag for single extrema computation. Works on parametric solver only.
71   Standard_EXPORT void SetSingleSolutionFlag (const Standard_Boolean theSingleSolutionFlag);
72
73   //! Get flag for single extrema computation. Works on parametric solver only.
74   Standard_EXPORT Standard_Boolean GetSingleSolutionFlag () const;
75
76   //! Performs calculations.
77   Standard_EXPORT void Perform();
78   
79   //! Returns True if the distances are found.
80   Standard_EXPORT Standard_Boolean IsDone() const;
81   
82   //! Returns state of myParallel flag.
83   Standard_EXPORT Standard_Boolean IsParallel() const;
84   
85   //! Returns the number of extremum distances.
86   Standard_EXPORT Standard_Integer NbExt() const;
87   
88   //! Returns the value of the Nth square extremum distance.
89   Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N = 1) const;
90   
91   //! Returns the points of the Nth extremum distance.
92   //! P1 is on the first curve, P2 on the second one.
93   Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnCurv& P1, Extrema_POnCurv& P2) const;
94
95
96
97
98 protected:
99
100
101
102
103
104 private:
105
106
107   Standard_Boolean myIsFindSingleSolution; // Default value is false.
108   Standard_Boolean myParallel;
109   Standard_Real myCurveMinTol;
110   math_Vector myLowBorder;
111   math_Vector myUppBorder;
112   TColStd_SequenceOfReal myPoints1;
113   TColStd_SequenceOfReal myPoints2;
114   Standard_Address myC[2];
115   Standard_Boolean myDone;
116
117
118 };
119
120
121
122
123
124
125
126 #endif // _Extrema_ECC_HeaderFile