Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
0013 
0014 #ifndef _BRepExtrema_ExtPF_HeaderFile
0015 #define _BRepExtrema_ExtPF_HeaderFile
0016 
0017 #include <Extrema_ExtPS.hxx>
0018 #include <TColStd_SequenceOfReal.hxx>
0019 #include <Extrema_SequenceOfPOnSurf.hxx>
0020 #include <BRepAdaptor_Surface.hxx>
0021 #include <Extrema_ExtFlag.hxx>
0022 #include <Extrema_ExtAlgo.hxx>
0023 
0024 class TopoDS_Vertex;
0025 class TopoDS_Face;
0026 
0027 
0028 class BRepExtrema_ExtPF
0029 {
0030  public:
0031 
0032   DEFINE_STANDARD_ALLOC
0033 
0034   BRepExtrema_ExtPF()
0035   {}
0036   //! It calculates all the distances. <br>
0037   Standard_EXPORT BRepExtrema_ExtPF(const TopoDS_Vertex& TheVertex,const TopoDS_Face& TheFace,
0038                                     const Extrema_ExtFlag TheFlag = Extrema_ExtFlag_MINMAX,
0039                                     const Extrema_ExtAlgo TheAlgo = Extrema_ExtAlgo_Grad);
0040   
0041   Standard_EXPORT void Initialize(const TopoDS_Face& TheFace,
0042                                   const Extrema_ExtFlag TheFlag = Extrema_ExtFlag_MINMAX,
0043                                   const Extrema_ExtAlgo TheAlgo = Extrema_ExtAlgo_Grad);
0044 
0045   //! An exception is raised if the fields have not been initialized. <br>
0046   //! Be careful: this method uses the Face only for classify not for the fields. <br>
0047   Standard_EXPORT void Perform(const TopoDS_Vertex& TheVertex,const TopoDS_Face& TheFace);
0048   //! True if the distances are found. <br>
0049   Standard_Boolean IsDone() const
0050   {
0051     return myExtPS.IsDone();
0052   }
0053   //! Returns the number of extremum distances. <br>
0054   Standard_Integer NbExt() const
0055   {
0056     return myPoints.Length();
0057   }
0058   //! Returns the value of the <N>th extremum square distance. <br>
0059   Standard_Real SquareDistance(const Standard_Integer N) const
0060   {
0061     return mySqDist.Value(N);
0062   }
0063   //! Returns the parameters on the Face of the <N>th extremum distance. <br>
0064   void Parameter(const Standard_Integer N,Standard_Real& U,Standard_Real& V) const
0065   {
0066     myPoints.Value(N).Parameter(U, V);
0067   }
0068   //! Returns the Point of the <N>th extremum distance. <br>
0069   gp_Pnt Point(const Standard_Integer N) const
0070   {
0071     return myPoints.Value(N).Value();
0072   }
0073 
0074   void SetFlag(const Extrema_ExtFlag F)
0075   {
0076     myExtPS.SetFlag(F);
0077   }
0078 
0079   void SetAlgo(const Extrema_ExtAlgo A)
0080   {
0081     myExtPS.SetAlgo(A);
0082   }
0083 
0084  private:
0085 
0086   Extrema_ExtPS myExtPS;
0087   TColStd_SequenceOfReal mySqDist;
0088   Extrema_SequenceOfPOnSurf myPoints;
0089   BRepAdaptor_Surface mySurf;
0090 };
0091 
0092 #endif