1 // Created on: 1994-07-06
2 // Created by: Laurent PAINNOT
3 // Copyright (c) 1994-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and / or modify it
9 // under the terms of the GNU Lesser General Public version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include Extrema_ELCC2d_hxx
18 #include Extrema_LocECC2d_hxx
19 #include <GeomAbs_CurveType.hxx>
20 #include <StdFail_NotDone.hxx>
21 #include <Extrema_POnCurv2d.hxx>
22 #include <Precision.hxx>
25 //=======================================================================
26 //function : Extrema_GLocateExtCC2d
28 //=======================================================================
30 Extrema_GLocateExtCC2d::Extrema_GLocateExtCC2d (const Curve1& C1,
32 const Standard_Real U0,
33 const Standard_Real V0)
35 Standard_Real TolU = Tool1::Resolution(C1, Precision::Confusion());
36 Standard_Real TolV = Tool2::Resolution(C2, Precision::Confusion());
37 Extrema_POnCurv2d P1, P2;
39 // Non implemente pour l instant: l appel a Geom2dExtrema_ExtCC.
42 Extrema_LocECC2d Xtrem(C1, C2, U0, V0, TolU, TolV);
45 myDone = Xtrem.IsDone();
47 mySqDist = Xtrem.SquareDistance();
58 //=======================================================================
61 //=======================================================================
63 Standard_Boolean Extrema_GLocateExtCC2d::IsDone () const {
69 //=======================================================================
72 //=======================================================================
74 Standard_Real Extrema_GLocateExtCC2d::SquareDistance() const {
76 if (!myDone) { StdFail_NotDone::Raise(); }
82 //=======================================================================
85 //=======================================================================
87 void Extrema_GLocateExtCC2d::Point (Extrema_POnCurv2d& P1,
88 Extrema_POnCurv2d& P2) const
90 if (!myDone) { StdFail_NotDone::Raise(); }