1 // Created on: 1994-07-06
2 // Created by: Laurent PAINNOT
3 // Copyright (c) 1994-1999 Matra Datavision
4 // Copyright (c) 1999-2012 OPEN CASCADE SAS
6 // The content of this file is subject to the Open CASCADE Technology Public
7 // License Version 6.5 (the "License"). You may not use the content of this file
8 // except in compliance with the License. Please obtain a copy of the License
9 // at http://www.opencascade.org and read it completely before using this file.
11 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 // The Original Code and all software distributed under the License is
15 // distributed on an "AS IS" basis, without warranty of any kind, and the
16 // Initial Developer hereby disclaims all such warranties, including without
17 // limitation, any warranties of merchantability, fitness for a particular
18 // purpose or non-infringement. Please see the License for the specific terms
19 // and conditions governing the rights and limitations under the License.
22 #include Extrema_ELCC2d_hxx
23 #include Extrema_LocECC2d_hxx
24 #include <GeomAbs_CurveType.hxx>
25 #include <StdFail_NotDone.hxx>
26 #include <Extrema_POnCurv2d.hxx>
27 #include <Precision.hxx>
30 //=======================================================================
31 //function : Extrema_GLocateExtCC2d
33 //=======================================================================
35 Extrema_GLocateExtCC2d::Extrema_GLocateExtCC2d (const Curve1& C1,
37 const Standard_Real U0,
38 const Standard_Real V0)
41 GeomAbs_CurveType type1 = Tool1::GetType(C1);
42 GeomAbs_CurveType type2 = Tool2::GetType(C2);
47 Standard_Real TolU = Tool1::Resolution(C1, Precision::Confusion());
48 Standard_Real TolV = Tool2::Resolution(C2, Precision::Confusion());
49 Extrema_POnCurv2d P1, P2;
51 // Non implemente pour l instant: l appel a Geom2dExtrema_ExtCC.
54 Extrema_LocECC2d Xtrem(C1, C2, U0, V0, TolU, TolV);
57 myDone = Xtrem.IsDone();
59 mySqDist = Xtrem.SquareDistance();
70 //=======================================================================
73 //=======================================================================
75 Standard_Boolean Extrema_GLocateExtCC2d::IsDone () const {
81 //=======================================================================
84 //=======================================================================
86 Standard_Real Extrema_GLocateExtCC2d::SquareDistance() const {
88 if (!myDone) { StdFail_NotDone::Raise(); }
94 //=======================================================================
97 //=======================================================================
99 void Extrema_GLocateExtCC2d::Point (Extrema_POnCurv2d& P1,
100 Extrema_POnCurv2d& P2) const
102 if (!myDone) { StdFail_NotDone::Raise(); }