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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
// File: Extrema_GLocateExtCC2d.gxx
// Created: Wed Jul 6 15:53:42 1994
// Author: Laurent PAINNOT
// <lpa@metrox>
#include Extrema_ELCC2d_hxx
#include Extrema_LocECC2d_hxx
#include <GeomAbs_CurveType.hxx>
#include <StdFail_NotDone.hxx>
#include <Extrema_POnCurv2d.hxx>
#include <Precision.hxx>
//=======================================================================
//function : Extrema_GLocateExtCC2d
//purpose :
//=======================================================================
Extrema_GLocateExtCC2d::Extrema_GLocateExtCC2d (const Curve1& C1,
const Curve2& C2,
const Standard_Real U0,
const Standard_Real V0)
{
Standard_Real TolU = Tool1::Resolution(C1, Precision::Confusion());
Standard_Real TolV = Tool2::Resolution(C2, Precision::Confusion());
Extrema_POnCurv2d P1, P2;
// Non implemente pour l instant: l appel a Geom2dExtrema_ExtCC.
Extrema_LocECC2d 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;
}
}
//=======================================================================
//function : IsDone
//purpose :
//=======================================================================
Standard_Boolean Extrema_GLocateExtCC2d::IsDone () const {
return myDone;
}
//=======================================================================
//function : Value
//purpose :
//=======================================================================
Standard_Real Extrema_GLocateExtCC2d::SquareDistance() const {
if (!myDone) { StdFail_NotDone::Raise(); }
return mySqDist;
}
//=======================================================================
//function : Point
//purpose :
//=======================================================================
void Extrema_GLocateExtCC2d::Point (Extrema_POnCurv2d& P1,
Extrema_POnCurv2d& P2) const
{
if (!myDone) { StdFail_NotDone::Raise(); }
P1 = myPoint1;
P2 = myPoint2;
}
|