0023934: Compiler warnings in MS VC++ 10
[occt.git] / src / Extrema / Extrema_GLocateExtCC2d.gxx
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
5 //
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.
10 //
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.
13 //
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.
20
21
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>
28
29
30 //=======================================================================
31 //function : Extrema_GLocateExtCC2d
32 //purpose  : 
33 //=======================================================================
34
35 Extrema_GLocateExtCC2d::Extrema_GLocateExtCC2d (const Curve1&       C1,
36                                                 const Curve2&       C2,
37                                                 const Standard_Real U0,
38                                                 const Standard_Real V0)
39 {
40   Standard_Real TolU = Tool1::Resolution(C1, Precision::Confusion());
41   Standard_Real TolV = Tool2::Resolution(C2, Precision::Confusion());
42   Extrema_POnCurv2d P1, P2;
43
44   // Non implemente pour l instant: l appel a Geom2dExtrema_ExtCC.
45
46
47   Extrema_LocECC2d Xtrem(C1, C2, U0, V0, TolU, TolV);   
48   // Exploitation
49
50   myDone = Xtrem.IsDone();
51   if (Xtrem.IsDone()) {
52     mySqDist = Xtrem.SquareDistance();
53     Xtrem.Point(P1, P2);
54     myPoint1 = P1;
55     myPoint2 = P2;
56   }
57
58 }
59
60
61
62
63 //=======================================================================
64 //function : IsDone
65 //purpose  : 
66 //=======================================================================
67
68 Standard_Boolean Extrema_GLocateExtCC2d::IsDone () const {
69
70   return myDone;
71 }
72
73
74 //=======================================================================
75 //function : Value
76 //purpose  : 
77 //=======================================================================
78
79 Standard_Real Extrema_GLocateExtCC2d::SquareDistance() const {
80
81   if (!myDone) { StdFail_NotDone::Raise(); }
82   return mySqDist;
83 }
84
85
86
87 //=======================================================================
88 //function : Point
89 //purpose  : 
90 //=======================================================================
91
92 void Extrema_GLocateExtCC2d::Point (Extrema_POnCurv2d& P1, 
93                                     Extrema_POnCurv2d& P2) const 
94 {
95   if (!myDone) { StdFail_NotDone::Raise(); }
96   P1 = myPoint1;
97   P2 = myPoint2;
98 }