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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _Extrema_FuncExtSS_HeaderFile
18 #define _Extrema_FuncExtSS_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
24 #include <TColStd_SequenceOfReal.hxx>
25 #include <Extrema_SequenceOfPOnSurf.hxx>
26 #include <math_FunctionSetWithDerivatives.hxx>
27 #include <math_Vector.hxx>
28 class Adaptor3d_Surface;
30 class Extrema_POnSurf;
33 //! Function to find extrema of the
34 //! distance between two surfaces.
35 class Extrema_FuncExtSS : public math_FunctionSetWithDerivatives
42 Standard_EXPORT Extrema_FuncExtSS();
44 Standard_EXPORT Extrema_FuncExtSS(const Adaptor3d_Surface& S1, const Adaptor3d_Surface& S2);
46 //! sets the field mysurf of the function.
47 Standard_EXPORT void Initialize (const Adaptor3d_Surface& S1, const Adaptor3d_Surface& S2);
49 Standard_EXPORT Standard_Integer NbVariables() const Standard_OVERRIDE;
51 Standard_EXPORT Standard_Integer NbEquations() const Standard_OVERRIDE;
53 //! Calculate Fi(U,V).
54 Standard_EXPORT Standard_Boolean Value (const math_Vector& UV, math_Vector& F) Standard_OVERRIDE;
56 //! Calculate Fi'(U,V).
57 Standard_EXPORT Standard_Boolean Derivatives (const math_Vector& UV, math_Matrix& DF) Standard_OVERRIDE;
59 //! Calculate Fi(U,V) and Fi'(U,V).
60 Standard_EXPORT Standard_Boolean Values (const math_Vector& UV, math_Vector& F, math_Matrix& DF) Standard_OVERRIDE;
62 //! Save the found extremum.
63 Standard_EXPORT virtual Standard_Integer GetStateNumber() Standard_OVERRIDE;
65 //! Return the number of found extrema.
66 Standard_EXPORT Standard_Integer NbExt() const;
68 //! Return the value of the Nth distance.
69 Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
71 //! Return the Nth extremum on S1.
72 Standard_EXPORT const Extrema_POnSurf& PointOnS1 (const Standard_Integer N) const;
74 //! Renvoie le Nieme extremum sur S2.
75 Standard_EXPORT const Extrema_POnSurf& PointOnS2 (const Standard_Integer N) const;
79 const Adaptor3d_Surface* myS1;
80 const Adaptor3d_Surface* myS2;
87 TColStd_SequenceOfReal mySqDist;
88 Extrema_SequenceOfPOnSurf myPoint1;
89 Extrema_SequenceOfPOnSurf myPoint2;
90 Standard_Boolean myS1init;
91 Standard_Boolean myS2init;
95 #endif // _Extrema_FuncExtSS_HeaderFile