0029915: Porting to VC 2017 : Regressions in Modeling Algorithms on VC 2017
[occt.git] / src / Extrema / Extrema_GenLocateExtPS.hxx
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
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_GenLocateExtPS_HeaderFile
18 #define _Extrema_GenLocateExtPS_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22
23 #include <Standard_Boolean.hxx>
24 #include <Standard_Real.hxx>
25 #include <Extrema_POnSurf.hxx>
26 class Standard_DomainError;
27 class StdFail_NotDone;
28 class gp_Pnt;
29 class Adaptor3d_Surface;
30 class Extrema_POnSurf;
31
32
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 
37 {
38 public:
39
40   DEFINE_STANDARD_ALLOC
41
42   //! Constructor.
43   Standard_EXPORT Extrema_GenLocateExtPS(const Adaptor3d_Surface& theS,
44                                          const Standard_Real theTolU = Precision::PConfusion(),
45                                          const Standard_Real theTolV = Precision::PConfusion());
46   
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);
56   
57   //! Returns True if the distance is found.
58   Standard_EXPORT Standard_Boolean IsDone() const;
59   
60   //! Returns the value of the extremum square distance.
61   Standard_EXPORT Standard_Real SquareDistance() const;
62   
63   //! Returns the point of the extremum distance.
64   Standard_EXPORT const Extrema_POnSurf& Point() const;
65
66 private:
67
68   const Extrema_GenLocateExtPS& operator=(const Extrema_GenLocateExtPS&);
69   Extrema_GenLocateExtPS(const Extrema_GenLocateExtPS&);
70
71   // Input.
72   const Adaptor3d_Surface& mySurf;
73   Standard_Real myTolU, myTolV;
74
75   // State.
76   Standard_Boolean myDone;
77
78   // Result.
79   Standard_Real mySqDist;
80   Extrema_POnSurf myPoint;
81
82
83 };
84
85
86
87
88
89
90
91 #endif // _Extrema_GenLocateExtPS_HeaderFile