Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:52

0001 // Created on: 1992-10-14
0002 // Created by: Christophe MARION
0003 // Copyright (c) 1992-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _HLRBRep_TheLocateExtPCOfTheProjPCurOfCInter_HeaderFile
0018 #define _HLRBRep_TheLocateExtPCOfTheProjPCurOfCInter_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Boolean.hxx>
0025 #include <HLRBRep_PCLocFOfTheLocateExtPCOfTheProjPCurOfCInter.hxx>
0026 class Standard_DomainError;
0027 class Standard_TypeMismatch;
0028 class StdFail_NotDone;
0029 class HLRBRep_CurveTool;
0030 class Extrema_POnCurv2d;
0031 class gp_Pnt2d;
0032 class gp_Vec2d;
0033 class HLRBRep_PCLocFOfTheLocateExtPCOfTheProjPCurOfCInter;
0034 
0035 class HLRBRep_TheLocateExtPCOfTheProjPCurOfCInter 
0036 {
0037 public:
0038 
0039   DEFINE_STANDARD_ALLOC
0040 
0041   Standard_EXPORT HLRBRep_TheLocateExtPCOfTheProjPCurOfCInter();
0042 
0043   //! Calculates the distance with a close point.
0044   //! The close point is defined by the parameter value U0.
0045   //! The function F(u)=distance(P,C(u)) has an extremum when g(u)=dF/du=0.
0046   //! The algorithm searches a zero near the close point.
0047   //! TolU is used to decide to stop the iterations.
0048   //! At the nth iteration, the criteria is:
0049   //! abs(Un - Un-1) < TolU.
0050   Standard_EXPORT HLRBRep_TheLocateExtPCOfTheProjPCurOfCInter(const gp_Pnt2d& P, const Standard_Address& C, const Standard_Real U0, const Standard_Real TolU);
0051   
0052   //! Calculates the distance with a close point.
0053   //! The close point is defined by the parameter value U0.
0054   //! The function F(u)=distance(P,C(u)) has an extremum when g(u)=dF/du=0.
0055   //! The algorithm searches a zero near the close point.
0056   //! Zeros are searched between Umin and Usup.
0057   //! TolU is used to decide to stop the iterations.
0058   //! At the nth iteration, the criteria is:
0059   //! abs(Un - Un-1) < TolU.
0060   Standard_EXPORT HLRBRep_TheLocateExtPCOfTheProjPCurOfCInter(const gp_Pnt2d& P, const Standard_Address& C, const Standard_Real U0, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU);
0061   
0062   //! sets the fields of the algorithm.
0063   Standard_EXPORT void Initialize (const Standard_Address& C, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU);
0064   
0065   //! the algorithm is done with the point P.
0066   //! An exception is raised if the fields have not
0067   //! been initialized.
0068   Standard_EXPORT void Perform (const gp_Pnt2d& P, const Standard_Real U0);
0069   
0070   //! Returns True if the distance is found.
0071   Standard_EXPORT Standard_Boolean IsDone() const;
0072   
0073   //! Returns the value of the extremum square distance.
0074   Standard_EXPORT Standard_Real SquareDistance() const;
0075   
0076   //! Returns True if the extremum distance is a minimum.
0077   Standard_EXPORT Standard_Boolean IsMin() const;
0078   
0079   //! Returns the point of the extremum distance.
0080   Standard_EXPORT const Extrema_POnCurv2d& Point() const;
0081 
0082 private:
0083 
0084   Standard_Boolean myDone;
0085   Standard_Real mytolU;
0086   Standard_Real myumin;
0087   Standard_Real myusup;
0088   HLRBRep_PCLocFOfTheLocateExtPCOfTheProjPCurOfCInter myF;
0089 
0090 };
0091 
0092 #endif // _HLRBRep_TheLocateExtPCOfTheProjPCurOfCInter_HeaderFile