summaryrefslogtreecommitdiff
path: root/inc/Extrema_GLocateExtCC.gxx
blob: 045bd217979b9fabf29e04deff643de39ab81e7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// File:	Extrema_GLocateExtCC.gxx
// Created:	Wed Jul  6 15:48:49 1994
// Author:	Laurent PAINNOT
//		<lpa@metrox>

#include Extrema_ELCC_hxx
#include Extrema_LocECC_hxx
#include <StdFail_NotDone.hxx>
#include <Extrema_POnCurv.hxx>
#include <Precision.hxx>

Extrema_GLocateExtCC::Extrema_GLocateExtCC (const Curve1&       C1,
					    const Curve2&       C2,
					    const Standard_Real U0,
					    const Standard_Real V0)
{

  Standard_Real TolU = C1.Resolution(Precision::Confusion());
  Standard_Real TolV = C2.Resolution(Precision::Confusion());
  Extrema_POnCurv P1, P2;

  // Non implemente pour l instant: l appel a Extrema_ELCC.


  Extrema_LocECC Xtrem(C1, C2,
		       U0, V0, TolU, TolV);	
  // Exploitation

  myDone = Xtrem.IsDone();
  if (Xtrem.IsDone()) {
    mySqDist = Xtrem.SquareDistance();
    Xtrem.Point(P1, P2);
    myPoint1 = P1;
    myPoint2 = P2;
  }

}




Standard_Boolean Extrema_GLocateExtCC::IsDone () const {

  return myDone;
}


Standard_Real Extrema_GLocateExtCC::SquareDistance() const {

  if (!myDone) { StdFail_NotDone::Raise(); }
  return mySqDist;
}



void Extrema_GLocateExtCC::Point (Extrema_POnCurv& P1, Extrema_POnCurv& P2) const {

  if (!myDone) { StdFail_NotDone::Raise(); }
  P1 = myPoint1;
  P2 = myPoint2;
}