Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1994-02-01
0002 // Created by: Laurent PAINNOT
0003 // Copyright (c) 1994-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 _Extrema_ExtPS_HeaderFile
0018 #define _Extrema_ExtPS_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Extrema_ExtPElS.hxx>
0025 #include <Extrema_GenExtPS.hxx>
0026 #include <Extrema_SequenceOfPOnSurf.hxx>
0027 #include <gp_Pnt.hxx>
0028 #include <TColStd_SequenceOfReal.hxx>
0029 #include <GeomAbs_SurfaceType.hxx>
0030 #include <Extrema_ExtFlag.hxx>
0031 #include <Extrema_ExtAlgo.hxx>
0032 #include <Standard_Integer.hxx>
0033 class Extrema_ExtPExtS;
0034 class Extrema_ExtPRevS;
0035 class Adaptor3d_Surface;
0036 class Extrema_POnSurf;
0037 
0038 
0039 //! It calculates all the extremum distances
0040 //! between a point and a surface.
0041 //! These distances can be minimum or maximum.
0042 class Extrema_ExtPS 
0043 {
0044 public:
0045 
0046   DEFINE_STANDARD_ALLOC
0047 
0048   
0049   Standard_EXPORT Extrema_ExtPS();
0050   
0051   //! It calculates all the distances.
0052   //! NbU and NbV are used to locate the close points
0053   //! to find the zeros. They must be great enough
0054   //! such that if there is N extrema, there will
0055   //! be N extrema between P and the grid.
0056   //! TolU et TolV are used to determine the conditions
0057   //! to stop the iterations; at the iteration number n:
0058   //! (Un - Un-1) < TolU and (Vn - Vn-1) < TolV .
0059   Standard_EXPORT Extrema_ExtPS(const gp_Pnt& P, const Adaptor3d_Surface& S, const Standard_Real TolU, const Standard_Real TolV, const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX, const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad);
0060   
0061   //! It calculates all the distances.
0062   //! NbU and NbV are used to locate the close points
0063   //! to find the zeros. They must be great enough
0064   //! such that if there is N extrema, there will
0065   //! be N extrema between P and the grid.
0066   //! TolU et TolV are used to determine the conditions
0067   //! to stop the iterations; at the iteration number n:
0068   //! (Un - Un-1) < TolU and (Vn - Vn-1) < TolV .
0069   Standard_EXPORT Extrema_ExtPS(const gp_Pnt& P, const Adaptor3d_Surface& S, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real Vinf, const Standard_Real Vsup, const Standard_Real TolU, const Standard_Real TolV, const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX, const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad);
0070   
0071   //! Initializes the fields of the algorithm.
0072   Standard_EXPORT void Initialize (const Adaptor3d_Surface& S, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real Vinf, const Standard_Real Vsup, const Standard_Real TolU, const Standard_Real TolV);
0073   
0074   //! Computes the distances.
0075   //! An exception is raised if the fieds have not been
0076   //! initialized.
0077   Standard_EXPORT void Perform (const gp_Pnt& P);
0078   
0079   //! Returns True if the distances are found.
0080   Standard_EXPORT Standard_Boolean IsDone() const;
0081   
0082   //! Returns the number of extremum distances.
0083   Standard_EXPORT Standard_Integer NbExt() const;
0084   
0085   //! Returns the value of the Nth resulting square distance.
0086   Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
0087   
0088   //! Returns the point of the Nth resulting distance.
0089   Standard_EXPORT const Extrema_POnSurf& Point (const Standard_Integer N) const;
0090   
0091   //! if the surface is a trimmed surface,
0092   //! dUfVf is a square distance between <P> and the point
0093   //! of parameter FirstUParameter and FirstVParameter <PUfVf>.
0094   //! dUfVl is a square distance between <P> and the point
0095   //! of parameter FirstUParameter and LastVParameter <PUfVl>.
0096   //! dUlVf is a square distance between <P> and the point
0097   //! of parameter LastUParameter and FirstVParameter <PUlVf>.
0098   //! dUlVl is a square distance between <P> and the point
0099   //! of parameter LastUParameter and LastVParameter <PUlVl>.
0100   Standard_EXPORT void TrimmedSquareDistances (Standard_Real& dUfVf, Standard_Real& dUfVl, Standard_Real& dUlVf, Standard_Real& dUlVl, gp_Pnt& PUfVf, gp_Pnt& PUfVl, gp_Pnt& PUlVf, gp_Pnt& PUlVl) const;
0101   
0102   Standard_EXPORT void SetFlag (const Extrema_ExtFlag F);
0103   
0104   Standard_EXPORT void SetAlgo (const Extrema_ExtAlgo A);
0105 
0106 private:
0107   
0108   Standard_EXPORT void TreatSolution (const Extrema_POnSurf& PS, const Standard_Real Val);
0109 
0110 private:
0111 
0112   const Adaptor3d_Surface* myS;
0113   Standard_Boolean myDone;
0114   Extrema_ExtPElS myExtPElS;
0115   Extrema_GenExtPS myExtPS;
0116   Extrema_SequenceOfPOnSurf myPoints;
0117   Standard_Real myuinf;
0118   Standard_Real myusup;
0119   Standard_Real myvinf;
0120   Standard_Real myvsup;
0121   Standard_Real mytolu;
0122   Standard_Real mytolv;
0123   Standard_Real d11;
0124   Standard_Real d12;
0125   Standard_Real d21;
0126   Standard_Real d22;
0127   gp_Pnt P11;
0128   gp_Pnt P12;
0129   gp_Pnt P21;
0130   gp_Pnt P22;
0131   TColStd_SequenceOfReal mySqDist;
0132   GeomAbs_SurfaceType mytype;
0133   Handle(Extrema_ExtPExtS) myExtPExtS;
0134   Handle(Extrema_ExtPRevS) myExtPRevS;
0135 
0136 };
0137 
0138 #endif // _Extrema_ExtPS_HeaderFile