0024096: Eliminate compiler warning C4505 in MSVC++ with warning level 4
[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 #ifdef DEB
41   GeomAbs_CurveType type1 = Tool1::GetType(C1);
42   GeomAbs_CurveType type2 = Tool2::GetType(C2);
43 #else
44   Tool1::GetType(C1);
45   Tool2::GetType(C2);
46 #endif
47   Standard_Real TolU = Tool1::Resolution(C1, Precision::Confusion());
48   Standard_Real TolV = Tool2::Resolution(C2, Precision::Confusion());
49   Extrema_POnCurv2d P1, P2;
50
51   // Non implemente pour l instant: l appel a Geom2dExtrema_ExtCC.
52
53
54   Extrema_LocECC2d Xtrem(C1, C2, U0, V0, TolU, TolV);   
55   // Exploitation
56
57   myDone = Xtrem.IsDone();
58   if (Xtrem.IsDone()) {
59     mySqDist = Xtrem.SquareDistance();
60     Xtrem.Point(P1, P2);
61     myPoint1 = P1;
62     myPoint2 = P2;
63   }
64
65 }
66
67
68
69
70 //=======================================================================
71 //function : IsDone
72 //purpose  : 
73 //=======================================================================
74
75 Standard_Boolean Extrema_GLocateExtCC2d::IsDone () const {
76
77   return myDone;
78 }
79
80
81 //=======================================================================
82 //function : Value
83 //purpose  : 
84 //=======================================================================
85
86 Standard_Real Extrema_GLocateExtCC2d::SquareDistance() const {
87
88   if (!myDone) { StdFail_NotDone::Raise(); }
89   return mySqDist;
90 }
91
92
93
94 //=======================================================================
95 //function : Point
96 //purpose  : 
97 //=======================================================================
98
99 void Extrema_GLocateExtCC2d::Point (Extrema_POnCurv2d& P1, 
100                                     Extrema_POnCurv2d& P2) const 
101 {
102   if (!myDone) { StdFail_NotDone::Raise(); }
103   P1 = myPoint1;
104   P2 = myPoint2;
105 }