1 // Created on: 1995-07-18
2 // Created by: Modelistation
3 // Copyright (c) 1995-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_GenLocateExtPS_HeaderFile
18 #define _Extrema_GenLocateExtPS_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
23 #include <Standard_Boolean.hxx>
24 #include <Standard_Real.hxx>
25 #include <Extrema_POnSurf.hxx>
26 class Standard_DomainError;
27 class StdFail_NotDone;
29 class Adaptor3d_Surface;
30 class Extrema_POnSurf;
33 //! With a close point, it calculates the distance
34 //! between a point and a surface.
35 //! Criteria type is defined in "Perform" method.
36 class Extrema_GenLocateExtPS
43 Standard_EXPORT Extrema_GenLocateExtPS(const Adaptor3d_Surface& theS,
44 const Standard_Real theTolU = Precision::PConfusion(),
45 const Standard_Real theTolV = Precision::PConfusion());
47 //! Calculates the extrema between the point and the surface using a close point.
48 //! The close point is defined by the parameter values theU0 and theV0.
49 //! Type of the algorithm depends on the isDistanceCriteria flag.
50 //! If flag value is false - normal projection criteria will be used.
51 //! If flag value is true - distance criteria will be used.
52 Standard_EXPORT void Perform(const gp_Pnt& theP,
53 const Standard_Real theU0,
54 const Standard_Real theV0,
55 const Standard_Boolean isDistanceCriteria = Standard_False);
57 //! Returns True if the distance is found.
58 Standard_EXPORT Standard_Boolean IsDone() const;
60 //! Returns the value of the extremum square distance.
61 Standard_EXPORT Standard_Real SquareDistance() const;
63 //! Returns the point of the extremum distance.
64 Standard_EXPORT const Extrema_POnSurf& Point() const;
68 const Extrema_GenLocateExtPS& operator=(const Extrema_GenLocateExtPS&);
69 Extrema_GenLocateExtPS(const Extrema_GenLocateExtPS&);
72 const Adaptor3d_Surface& mySurf;
73 Standard_Real myTolU, myTolV;
76 Standard_Boolean myDone;
79 Standard_Real mySqDist;
80 Extrema_POnSurf myPoint;
91 #endif // _Extrema_GenLocateExtPS_HeaderFile