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_ExtPC_HeaderFile
0015 #define _BRepExtrema_ExtPC_HeaderFile
0016 
0017 #include <Extrema_ExtPC.hxx>
0018 #include <BRepAdaptor_Curve.hxx>
0019 #include <Standard_DefineAlloc.hxx>
0020 
0021 class TopoDS_Vertex;
0022 class TopoDS_Edge;
0023 
0024 
0025 class BRepExtrema_ExtPC
0026 {
0027  public:
0028 
0029   DEFINE_STANDARD_ALLOC
0030   
0031   BRepExtrema_ExtPC()
0032   {
0033   }
0034   //! It calculates all the distances. <br>
0035   Standard_EXPORT BRepExtrema_ExtPC(const TopoDS_Vertex& V,const TopoDS_Edge& E);
0036   
0037   Standard_EXPORT void Initialize(const TopoDS_Edge& E);
0038   //! An exception is raised if the fields have not been initialized. <br>
0039   Standard_EXPORT void Perform(const TopoDS_Vertex& V);
0040   //! True if the distances are found. <br>
0041   Standard_Boolean IsDone() const
0042   {
0043     return myExtPC.IsDone();
0044   }
0045   //! Returns the number of extremum distances. <br>
0046   Standard_Integer NbExt() const
0047   {
0048     return myExtPC.NbExt();
0049   }
0050   //! Returns True if the <N>th extremum distance is a minimum. <br>
0051   Standard_Boolean IsMin(const Standard_Integer N) const
0052   {
0053     return myExtPC.IsMin(N);
0054   }
0055   //! Returns the value of the <N>th extremum square distance. <br>
0056   Standard_Real SquareDistance(const Standard_Integer N) const
0057   {
0058     return myExtPC.SquareDistance(N);
0059   }
0060   //! Returns the parameter on the edge of the <N>th extremum distance. <br>
0061   Standard_Real Parameter(const Standard_Integer N) const
0062   {
0063     return myExtPC.Point(N).Parameter();
0064   }
0065   //! Returns the Point of the <N>th extremum distance. <br>
0066   gp_Pnt Point(const Standard_Integer N) const
0067   {
0068     return myExtPC.Point(N).Value();
0069   }
0070   //! if the curve is a trimmed curve, <br>
0071   //! dist1 is a square distance between <P> and the point <br>
0072   //! of parameter FirstParameter <pnt1> and <br>
0073   //! dist2 is a square distance between <P> and the point <br>
0074   //! of parameter LastParameter <pnt2>. <br>
0075   void TrimmedSquareDistances(Standard_Real& dist1,Standard_Real& dist2,gp_Pnt& pnt1,gp_Pnt& pnt2) const
0076   {
0077     myExtPC.TrimmedSquareDistances(dist1,dist2,pnt1,pnt2);
0078   }
0079 
0080  private:
0081 
0082   Extrema_ExtPC myExtPC;
0083   Handle(BRepAdaptor_Curve) myHC;
0084 };
0085 
0086 #endif