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_ExtCC_HeaderFile
0015 #define _BRepExtrema_ExtCC_HeaderFile
0016 
0017 #include <Extrema_ExtCC.hxx>
0018 #include <BRepAdaptor_Curve.hxx>
0019 #include <Standard_DefineAlloc.hxx>
0020 
0021 class TopoDS_Edge;
0022 class gp_Pnt;
0023 
0024 class BRepExtrema_ExtCC
0025 {
0026  public:
0027 
0028   DEFINE_STANDARD_ALLOC
0029   
0030   BRepExtrema_ExtCC ()
0031   {
0032   }
0033   //! It calculates all the distances. <br>
0034   Standard_EXPORT BRepExtrema_ExtCC(const TopoDS_Edge& E1,const TopoDS_Edge& E2);
0035 
0036   Standard_EXPORT void Initialize(const TopoDS_Edge& E2);
0037   //! An exception is raised if the fields have not been initialized. <br>
0038   Standard_EXPORT void Perform(const TopoDS_Edge& E1);
0039   //! True if the distances are found. <br>
0040   Standard_Boolean IsDone() const
0041   {
0042     return myExtCC.IsDone();
0043   }
0044   //! Returns the number of extremum distances. <br>
0045   Standard_Integer NbExt() const
0046   {
0047     return myExtCC.NbExt();
0048   }
0049   //! Returns True if E1 and E2 are parallel. <br>
0050   Standard_Boolean IsParallel() const
0051   {
0052     return myExtCC.IsParallel();
0053   }
0054   //! Returns the value of the <N>th extremum square distance. <br>
0055   Standard_Real SquareDistance(const Standard_Integer N) const
0056   {
0057     return myExtCC.SquareDistance(N);
0058   }
0059   //! Returns the parameter on the first edge of the <N>th extremum distance. <br>
0060   Standard_EXPORT Standard_Real ParameterOnE1(const Standard_Integer N) const;
0061   //! Returns the Point of the <N>th extremum distance on the edge E1. <br>
0062   Standard_EXPORT gp_Pnt PointOnE1(const Standard_Integer N) const;
0063   //! Returns the parameter on the second edge of the <N>th extremum distance. <br>
0064   Standard_EXPORT Standard_Real ParameterOnE2(const Standard_Integer N) const;
0065   //! Returns the Point of the <N>th extremum distance on the edge E2. <br>
0066   Standard_EXPORT gp_Pnt PointOnE2(const Standard_Integer N) const;
0067   //! if the edges is a trimmed curve, <br>
0068   //! dist11 is a square distance between the point on E1 <br>
0069   //! of parameter FirstParameter and the point of <br>
0070   //! parameter FirstParameter on E2. <br>
0071   Standard_EXPORT void TrimmedSquareDistances(Standard_Real& dist11,Standard_Real& distP12,Standard_Real& distP21,Standard_Real& distP22,gp_Pnt& P11,gp_Pnt& P12,gp_Pnt& P21,gp_Pnt& P22) const;
0072 
0073  private:
0074 
0075   Extrema_ExtCC myExtCC;
0076   Handle(BRepAdaptor_Curve) myHC;
0077 };
0078 
0079 #endif