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>
22 #include <Standard_Handle.hxx>
24 #include <Adaptor3d_SurfacePtr.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;
36 class Extrema_POnSurf;
39 //! Function to find extrema of the
40 //! distance between two surfaces.
41 class Extrema_FuncExtSS : public math_FunctionSetWithDerivatives
48 Standard_EXPORT Extrema_FuncExtSS();
50 Standard_EXPORT Extrema_FuncExtSS(const Adaptor3d_Surface& S1, const Adaptor3d_Surface& S2);
52 //! sets the field mysurf of the function.
53 Standard_EXPORT void Initialize (const Adaptor3d_Surface& S1, const Adaptor3d_Surface& S2);
55 Standard_EXPORT Standard_Integer NbVariables() const Standard_OVERRIDE;
57 Standard_EXPORT Standard_Integer NbEquations() const Standard_OVERRIDE;
59 //! Calculate Fi(U,V).
60 Standard_EXPORT Standard_Boolean Value (const math_Vector& UV, math_Vector& F) Standard_OVERRIDE;
62 //! Calculate Fi'(U,V).
63 Standard_EXPORT Standard_Boolean Derivatives (const math_Vector& UV, math_Matrix& DF) Standard_OVERRIDE;
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;
68 //! Save the found extremum.
69 Standard_EXPORT virtual Standard_Integer GetStateNumber() Standard_OVERRIDE;
71 //! Return the number of found extrema.
72 Standard_EXPORT Standard_Integer NbExt() const;
74 //! Return the value of the Nth distance.
75 Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
77 //! Return the Nth extremum on S1.
78 Standard_EXPORT const Extrema_POnSurf& PointOnS1 (const Standard_Integer N) const;
80 //! Renvoie le Nieme extremum sur S2.
81 Standard_EXPORT const Extrema_POnSurf& PointOnS2 (const Standard_Integer N) const;
95 Standard_EXPORT Adaptor3d_SurfacePtr Bidon() const;
98 Adaptor3d_SurfacePtr myS1;
99 Adaptor3d_SurfacePtr myS2;
106 TColStd_SequenceOfReal mySqDist;
107 Extrema_SequenceOfPOnSurf myPoint1;
108 Extrema_SequenceOfPOnSurf myPoint2;
109 Standard_Boolean myS1init;
110 Standard_Boolean myS2init;
121 #endif // _Extrema_FuncExtSS_HeaderFile