1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #ifndef _BRepExtrema_ExtCC_HeaderFile
15 #define _BRepExtrema_ExtCC_HeaderFile
17 #include <Extrema_ExtCC.hxx>
18 #include <BRepAdaptor_HCurve.hxx>
19 #include <Standard_DefineAlloc.hxx>
21 class BRepAdaptor_HCurve;
26 class BRepExtrema_ExtCC
32 Standard_EXPORT BRepExtrema_ExtCC()
35 //! It calculates all the distances. <br>
36 Standard_EXPORT BRepExtrema_ExtCC(const TopoDS_Edge& E1,const TopoDS_Edge& E2);
38 Standard_EXPORT void Initialize(const TopoDS_Edge& E2);
39 //! An exception is raised if the fields have not been initialized. <br>
40 Standard_EXPORT void Perform(const TopoDS_Edge& E1);
41 //! True if the distances are found. <br>
42 Standard_EXPORT Standard_Boolean IsDone() const
44 return myExtCC.IsDone();
46 //! Returns the number of extremum distances. <br>
47 Standard_EXPORT Standard_Integer NbExt() const
49 return myExtCC.NbExt();
51 //! Returns True if E1 and E2 are parallel. <br>
52 Standard_EXPORT Standard_Boolean IsParallel() const
54 return myExtCC.IsParallel();
56 //! Returns the value of the <N>th extremum square distance. <br>
57 Standard_EXPORT Standard_Real SquareDistance(const Standard_Integer N) const
59 return myExtCC.SquareDistance(N);
61 //! Returns the parameter on the first edge of the <N>th extremum distance. <br>
62 Standard_EXPORT Standard_Real ParameterOnE1(const Standard_Integer N) const;
63 //! Returns the Point of the <N>th extremum distance on the edge E1. <br>
64 Standard_EXPORT gp_Pnt PointOnE1(const Standard_Integer N) const;
65 //! Returns the parameter on the second edge of the <N>th extremum distance. <br>
66 Standard_EXPORT Standard_Real ParameterOnE2(const Standard_Integer N) const;
67 //! Returns the Point of the <N>th extremum distance on the edge E2. <br>
68 Standard_EXPORT gp_Pnt PointOnE2(const Standard_Integer N) const;
69 //! if the edges is a trimmed curve, <br>
70 //! dist11 is a square distance between the point on E1 <br>
71 //! of parameter FirstParameter and the point of <br>
72 //! parameter FirstParameter on E2. <br>
73 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;
77 Extrema_ExtCC myExtCC;
78 Handle(BRepAdaptor_HCurve) myHC;