Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/BRepExtrema_ExtCC.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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