Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-18 08:38:58

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 class BRepExtrema_ExtPF
0028 {
0029 public:
0030   DEFINE_STANDARD_ALLOC
0031 
0032   BRepExtrema_ExtPF() {}
0033 
0034   //! It calculates all the distances. <br>
0035   Standard_EXPORT BRepExtrema_ExtPF(const TopoDS_Vertex&  TheVertex,
0036                                     const TopoDS_Face&    TheFace,
0037                                     const Extrema_ExtFlag TheFlag = Extrema_ExtFlag_MINMAX,
0038                                     const Extrema_ExtAlgo TheAlgo = Extrema_ExtAlgo_Grad);
0039 
0040   Standard_EXPORT void Initialize(const TopoDS_Face&    TheFace,
0041                                   const Extrema_ExtFlag TheFlag = Extrema_ExtFlag_MINMAX,
0042                                   const Extrema_ExtAlgo TheAlgo = Extrema_ExtAlgo_Grad);
0043 
0044   //! An exception is raised if the fields have not been initialized. <br>
0045   //! Be careful: this method uses the Face only for classify not for the fields. <br>
0046   Standard_EXPORT void Perform(const TopoDS_Vertex& TheVertex, const TopoDS_Face& TheFace);
0047 
0048   //! True if the distances are found. <br>
0049   Standard_Boolean IsDone() const { return myExtPS.IsDone(); }
0050 
0051   //! Returns the number of extremum distances. <br>
0052   Standard_Integer NbExt() const { return myPoints.Length(); }
0053 
0054   //! Returns the value of the <N>th extremum square distance. <br>
0055   Standard_Real SquareDistance(const Standard_Integer N) const { return mySqDist.Value(N); }
0056 
0057   //! Returns the parameters on the Face of the <N>th extremum distance. <br>
0058   void Parameter(const Standard_Integer N, Standard_Real& U, Standard_Real& V) const
0059   {
0060     myPoints.Value(N).Parameter(U, V);
0061   }
0062 
0063   //! Returns the Point of the <N>th extremum distance. <br>
0064   gp_Pnt Point(const Standard_Integer N) const { return myPoints.Value(N).Value(); }
0065 
0066   void SetFlag(const Extrema_ExtFlag F) { myExtPS.SetFlag(F); }
0067 
0068   void SetAlgo(const Extrema_ExtAlgo A) { myExtPS.SetAlgo(A); }
0069 
0070 private:
0071   Extrema_ExtPS             myExtPS;
0072   TColStd_SequenceOfReal    mySqDist;
0073   Extrema_SequenceOfPOnSurf myPoints;
0074   BRepAdaptor_Surface       mySurf;
0075 };
0076 
0077 #endif