0031687: Draw Harness, ViewerTest - extend command vrenderparams with option updating...
[occt.git] / src / Extrema / Extrema_FuncExtSS.hxx
1 // Created on: 1996-01-09
2 // Created by: Laurent PAINNOT
3 // Copyright (c) 1996-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_FuncExtSS_HeaderFile
18 #define _Extrema_FuncExtSS_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <Adaptor3d_SurfacePtr.hxx>
25 #include <gp_Pnt.hxx>
26 #include <Standard_Real.hxx>
27 #include <TColStd_SequenceOfReal.hxx>
28 #include <Extrema_SequenceOfPOnSurf.hxx>
29 #include <Standard_Boolean.hxx>
30 #include <math_FunctionSetWithDerivatives.hxx>
31 #include <Standard_Integer.hxx>
32 #include <math_Vector.hxx>
33 class Standard_OutOfRange;
34 class Adaptor3d_Surface;
35 class math_Matrix;
36 class Extrema_POnSurf;
37
38
39 //! Function to find extrema of the
40 //! distance between two surfaces.
41 class Extrema_FuncExtSS  : public math_FunctionSetWithDerivatives
42 {
43 public:
44
45   DEFINE_STANDARD_ALLOC
46
47   
48   Standard_EXPORT Extrema_FuncExtSS();
49   
50   Standard_EXPORT Extrema_FuncExtSS(const Adaptor3d_Surface& S1, const Adaptor3d_Surface& S2);
51   
52   //! sets the field mysurf of the function.
53   Standard_EXPORT void Initialize (const Adaptor3d_Surface& S1, const Adaptor3d_Surface& S2);
54   
55   Standard_EXPORT Standard_Integer NbVariables() const Standard_OVERRIDE;
56   
57   Standard_EXPORT Standard_Integer NbEquations() const Standard_OVERRIDE;
58   
59   //! Calculate Fi(U,V).
60   Standard_EXPORT Standard_Boolean Value (const math_Vector& UV, math_Vector& F) Standard_OVERRIDE;
61   
62   //! Calculate Fi'(U,V).
63   Standard_EXPORT Standard_Boolean Derivatives (const math_Vector& UV, math_Matrix& DF) Standard_OVERRIDE;
64   
65   //! Calculate Fi(U,V) and Fi'(U,V).
66   Standard_EXPORT Standard_Boolean Values (const math_Vector& UV, math_Vector& F, math_Matrix& DF) Standard_OVERRIDE;
67   
68   //! Save the found extremum.
69   Standard_EXPORT virtual Standard_Integer GetStateNumber() Standard_OVERRIDE;
70   
71   //! Return the number of found extrema.
72   Standard_EXPORT Standard_Integer NbExt() const;
73   
74   //! Return the value of the Nth distance.
75   Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
76   
77   //! Return the Nth extremum on S1.
78   Standard_EXPORT const Extrema_POnSurf& PointOnS1 (const Standard_Integer N) const;
79   
80   //! Renvoie le Nieme extremum sur S2.
81   Standard_EXPORT const Extrema_POnSurf& PointOnS2 (const Standard_Integer N) const;
82
83
84
85
86 protected:
87
88
89
90
91
92 private:
93
94   
95   Standard_EXPORT Adaptor3d_SurfacePtr Bidon() const;
96
97
98   Adaptor3d_SurfacePtr myS1;
99   Adaptor3d_SurfacePtr myS2;
100   gp_Pnt myP1;
101   gp_Pnt myP2;
102   Standard_Real myU1;
103   Standard_Real myV1;
104   Standard_Real myU2;
105   Standard_Real myV2;
106   TColStd_SequenceOfReal mySqDist;
107   Extrema_SequenceOfPOnSurf myPoint1;
108   Extrema_SequenceOfPOnSurf myPoint2;
109   Standard_Boolean myS1init;
110   Standard_Boolean myS2init;
111
112
113 };
114
115
116
117
118
119
120
121 #endif // _Extrema_FuncExtSS_HeaderFile