Salome HOME
Bug #487: dump/load script - problem with obstacle.
[modules/hydro.git] / src / HYDROData / HYDROData_Lambert93.cxx
index 504eab764b89d5bf1a41452834b9b648d01186ee..88390eb872a75824bad42173679c1521b955a1a4 100755 (executable)
@@ -332,3 +332,53 @@ void HYDROData_Lambert93::toGeo( double theX, double theY,
 
 }
 
+void HYDROData_Lambert93::DMSToDeg( int theDeg,
+                                    int theMin,
+                                    double theSec,
+                                    double& theDegOut )
+{
+  double aCoef = theDeg > 0 ? 1.0 : -1.0;
+
+  theDegOut = (double)theDeg;
+  theDegOut += aCoef * ( (double)theMin ) / 60.0;
+  theDegOut += aCoef * theSec / 3600.0;
+}
+
+void HYDROData_Lambert93::DMSToSec( int theDeg,
+                                    int theMin,
+                                    double theSec,
+                                    double& theSecOut )
+{
+  double aCoef = theDeg > 0 ? 1.0 : -1.0;
+
+  theSecOut = theDeg * 3600.0;
+  theSecOut += aCoef * theMin * 60.0;
+  theSecOut += aCoef * theSec;
+}
+
+void HYDROData_Lambert93::degToDMS( double theDegIn,
+                                    int& theDeg,
+                                    int& theMin,
+                                    double& theSec )
+{
+  theDeg = int( theDegIn );
+
+  double aRemainder = fabs( theDegIn - theDeg ) * 60.0;
+  theMin = int( aRemainder );
+
+  aRemainder = ( aRemainder - theMin ) * 60.0;
+  theSec = aRemainder;
+}
+
+void HYDROData_Lambert93::secToDMS( double theSecIn,
+                                    int& theDeg,
+                                    int& theMin,
+                                    double& theSec )
+{
+  theDeg = int( theSecIn / 3600.0 );
+
+  double aRemainder = fabs( theSecIn - theDeg * 3600.0 );
+  theMin = int( aRemainder / 60.0 );
+
+  theSec = fabs( aRemainder - theMin * 60.0 );
+}