Salome HOME
code revision
authorasl <asl@opencascade.com>
Thu, 15 Oct 2015 06:51:11 +0000 (09:51 +0300)
committerasl <asl@opencascade.com>
Thu, 15 Oct 2015 06:51:11 +0000 (09:51 +0300)
check_copyright.py
src/HYDROData/HYDROData_Document.cxx
src/HYDROData/HYDROData_IInterpolator.cxx
src/HYDROData/HYDROData_IProfilesInterpolator.cxx
src/HYDROData/HYDROData_ImmersibleZone.cxx
src/HYDROData/HYDROData_Iterator.cxx
src/HYDROData/HYDROData_Lambert93.cxx
src/HYDROData/HYDROData_LinearInterpolator.cxx
src/HYDROData/HYDROData_NaturalObject.cxx

index 2f4e3cc2e632d6638f5b84cf5c862d27fad97fef..b306ea217dc8a08e81fa7427fc0c3c409a60ee2a 100644 (file)
@@ -34,3 +34,4 @@ def check_folder( theFolder ):
 check_folder( 'src/HYDROData' )
 check_folder( 'src/HYDROGUI' )
 check_folder( 'src/HYDROPy' )
+check_folder( 'src/HYDRO_tests' )
index 55912ca6dc1cac3fb48044bc26e75200a27996f4..0cf4c403258ebc2c8dffdbf4913aca7922b66b57 100644 (file)
@@ -866,4 +866,4 @@ NCollection_Sequence<TCollection_AsciiString> HYDROData_Document::GetInterpolato
   }
 
   return aNames;
-}
\ No newline at end of file
+}
index 9bb77827898d78d9af3e1132d427d02e8dc99752..80e11a20c3b83c155fb2a561f5312a3bad5f783f 100644 (file)
@@ -28,8 +28,7 @@ HYDROData_IInterpolator::~HYDROData_IInterpolator()
 {
 }
 
-void HYDROData_IInterpolator::SetAltitudeObject( 
-  const Handle(HYDROData_IAltitudeObject)& theAltitude )
+void HYDROData_IInterpolator::SetAltitudeObject( const Handle(HYDROData_IAltitudeObject)& theAltitude )
 {
   myAltitudeObject = theAltitude;
 }
@@ -39,8 +38,7 @@ Handle(HYDROData_IAltitudeObject) HYDROData_IInterpolator::GetAltitudeObject() c
   return myAltitudeObject;
 }
 
-double HYDROData_IInterpolator::GetAltitudeForPoint( 
-  const double theCoordX, const double theCoordY ) const
+double HYDROData_IInterpolator::GetAltitudeForPoint( const double theCoordX, const double theCoordY ) const
 {
   return myAltitudeObject.IsNull() ? HYDROData_IAltitudeObject::GetInvalidAltitude() :
          myAltitudeObject->GetAltitudeForPoint( gp_XY( theCoordX, theCoordY ) );
index 93fc87afbc6e06119621cbc08e1b2f33b1acae8f..05cb3729bbffd10a1a1289eee6ad8a62ac00e712 100644 (file)
@@ -191,4 +191,4 @@ NCollection_Sequence<gp_XYZ> HYDROData_IProfilesInterpolator::GetPoints( const s
   }
 
   return aProfilePoints;
-}
\ No newline at end of file
+}
index aaed241896322b9f66bbbcacfeaa4c58f9906a61..3e54c04522af296092e76e4a16e5da8f1cd54b70 100644 (file)
@@ -264,5 +264,3 @@ void HYDROData_ImmersibleZone::RemovePolyline()
   ClearReferenceObjects( DataTag_Polyline );
   SetToUpdate( true );
 }
-
-
index 210975044d9f29a662671d24f64e7200b99628ea..c835f51f0252dc39bbe5ae7dd742417516385992 100644 (file)
@@ -154,7 +154,7 @@ Handle(HYDROData_Entity) HYDROData_Iterator::Object( const TDF_Label& theLabel )
     case KIND_OBSTACLE_ALTITUDE:  aResult = new HYDROData_ObstacleAltitude();     break;
     case KIND_STRICKLER_TABLE:    aResult = new HYDROData_StricklerTable();       break;
     case KIND_LAND_COVER:         aResult = new HYDROData_LandCover();            break;
-    case KIND_LAND_COVER_MAP:     aResult = new HYDROData_LandCoverMap();            break;
+    case KIND_LAND_COVER_MAP:     aResult = new HYDROData_LandCoverMap();         break;
     default:                                                                      break;
   }
 
index 8a5d64fe1d5c14e5e71a977de3d6301262f8b5b2..c7cc478fce7434a89d412c8b1f567511d676a8f1 100755 (executable)
 //
 
 #include <HYDROData_Lambert93.h>
-
 #include <math.h>
 
-
-
 // Standard values
-
 const double PI = 3.14159265;
 
-
-
 // Base values of the Lambert-93
-
 const double a = 6378137;               //  m  -- le demi-grand axe
-
 const double f = 1.0 / 298.257222101;   // l'aplatissement
-
-
-
 const double phi_1_deg = 44;            // deg -- le premier parallèle d'échelle
-
 const double phi_2_deg = 49;            // deg -- le deuxième parallèle d'échell
-
-
-
 const double lambda_0_deg = 3;          // deg -- la longitude d'origine donnée par le méridien central de Greenwich
-
 const double phi_0_deg = 46.5;          // deg -- la latitude d'origine 
-
-
-
 const double X_0 = 700000;              //  m  -- la coordonnée à l'origine
-
 const double Y_0 = 6600000;             //  m  -- la coordonnée à l'origine 
 
-
-
 // Derived values of the Lambert-93
-
 const double b = a * ( 1 - f );         //  m  -- le demi-petit axe
-
 const double e = sqrt( a*a - b*b ) / a; // l'excentricité
 
-
-
 const double phi_0 = HYDROData_Lambert93::toRad( phi_0_deg );
-
 const double phi_1 = HYDROData_Lambert93::toRad( phi_1_deg );
-
 const double phi_2 = HYDROData_Lambert93::toRad( phi_2_deg );
-
 const double lambda_0 = HYDROData_Lambert93::toRad( lambda_0_deg );
 
-
-
-
-
 double cot( double x )
-
 {
-
   return cos( x ) / sin( x );
-
 }
 
-
-
 double ln( double x )
-
 {
-
   return log( x );
-
 }
 
-
-
 const double s1 = sin( phi_1 );
-
 const double s2 = sin( phi_2 );
-
 const double c1 = cos( phi_1 );
-
 const double c2 = cos( phi_2 );
 
-
-
 const double n1 = ln( c2/c1 ) + 1.0/2.0 * ln( (1-e*e*s1*s1)/(1-e*e*s2*s2) );
-
 const double n2 = tan( phi_1 / 2 + PI/4 ) * pow( 1-e*s1, e/2 ) * pow( 1+e*s2, e/2 );
-
 const double n3 = tan( phi_2 / 2 + PI/4 ) * pow( 1+e*s1, e/2 ) * pow( 1-e*s2, e/2 );
-
 const double n = n1 / ( ln( n2/n3 ) );
 
-
-
 const double p1 = a * c1 / ( n * sqrt( 1-e*e*s1*s1 ) );
-
 const double p2 = tan( phi_1 / 2 + PI / 4 );
-
 const double p3 = pow( (1-e*s1)/(1+e*s1), e/2 );
-
 const double p_0 = p1 * pow( p2*p3, n );
 
-
-
 double HYDROData_Lambert93::toRad( double theDeg )
-
 {
-
   return theDeg * PI / 180.0;
-
 }
 
-
-
 double HYDROData_Lambert93::toDeg( double theRad )
-
 {
-
   return theRad / PI * 180.0;
-
 }
 
-
-
 double HYDROData_Lambert93::calc_rho( double phi )
-
 {
-
   double c1 = cot( phi/2 + PI/4 );
-
   double c2 = ( 1 + e * sin( phi ) ) / ( 1 - e * sin( phi ) );
-
   double rho = p_0 * pow( c1 * pow( c2, e/2 ), n );
-
   return rho;
-
 }
 
-
-
 void HYDROData_Lambert93::toXY( double theLatitudeDeg, double theLongitudeDeg,
-
                                 double& theX, double& theY )
-
 {
-
   double phi = toRad( theLatitudeDeg );
-
   double lambda = toRad( theLongitudeDeg );
 
-
-
   double rho = calc_rho( phi );
-
   double rho_0 = calc_rho( phi_0 );
-
   double theta = n * ( lambda - lambda_0 );
 
-
-
   theX = X_0 + rho * sin( theta );
-
   theY = Y_0 + rho_0 - rho * cos( theta );
-
 }
 
-
-
 double arctan( double x )
-
 {
-
   return atan( x );
-
 }
 
-
-
 typedef double (*FUNC)( double );
 
 double solve( FUNC f, double c, double x1, double x2, double eps )
-
 {
-
   double f1 = f( x1 ) - c;
-
   double f2 = f( x2 ) - c;
-
   while( fabs( x1 - x2 ) > eps )
-
   {
-
     double x = ( x1 + x2 ) / 2;
-
     double fx = f( x ) - c;
-
     bool b1 = f1>=0;
-
     bool b2 = f2>=0;
-
     bool b = fx>=0;
-
     if( b==b1 )
-
     {
-
       x1 = x;
-
       f1 = fx;
-
     }
-
     else
-
     {
-
       x2 = x;
-
       f2 = fx;
-
     }
-
   }
-
   return ( x1 + x2 ) / 2;
-
 }
 
-
-
 double F( double phi )
-
 {
-
   double f1 = tan( phi/2 + PI/4 );
-
   double f2 = ( 1 - e*sin(phi) ) / ( 1 + e*sin(phi) );
-
   return f1 * pow( f2, e/2 );
-
 }
 
-
-
 double Finv( double x, double eps )
-
 {
-
   return solve( F, x, 0, PI/2-eps, eps );
-
 }
 
-
-
 double HYDROData_Lambert93::calc_phi_inv( double rho, double eps )
-
 {
-
   double x = pow( p_0 / rho, 1/n );
-
   double phi = Finv( x, eps );
-
   return phi;
-
 }
 
-
-
 double HYDROData_Lambert93::calc_phi_ign( double rho, double eps )
-
 {
-
   double x = p_0 / rho;
-
   double y = pow( x, 1/n );
-
   double phi_i_1, phi_i = 2*arctan( y ) - PI/2;
-
   while( true )
-
   {
-
     phi_i_1 = phi_i;
-
     double z = y * pow( ( 1 + e*sin(phi_i_1) ) / ( 1 - e*sin(phi_i_1) ), e/2 );
-
     phi_i = 2*arctan( pow( x, 1/n ) * z ) - PI/2;
-
     if( fabs( phi_i - phi_i_1 ) < eps )
-
       return phi_i;
-
   }
-
   return -1;
-
 }
 
-
-
 void HYDROData_Lambert93::toGeo( double theX, double theY,
-
-                       double& theLatitudeDeg, double& theLongitudeDeg,
-
-                       double theEps )
-
+                                 double& theLatitudeDeg, double& theLongitudeDeg,
+                                 double theEps )
 {
-
   double rho_0 = calc_rho( phi_0 );
-
   double rho = sqrt( pow( theX - X_0, 2 ) + pow( Y_0 - theY + rho_0, 2 ) );
-
   double theta = 2 * arctan( ( theX - X_0 ) / ( Y_0 - theY + rho_0 + rho ) );
 
-
-
   double lambda = theta / n + lambda_0;
-
   double phi = calc_phi_inv( rho, theEps );
 
-
-
   theLatitudeDeg = toDeg( phi );
-
   theLongitudeDeg = toDeg( lambda );
-
 }
 
 void HYDROData_Lambert93::DMSToDeg( int theDeg,
index 8a383ced5daff05aa13fb8f38b5d3ad80fe074bc..aea863d188b14afb8b845cee2a97b1018660e788 100644 (file)
@@ -104,4 +104,4 @@ void HYDROData_LinearInterpolator::Calculate()
   }
 
   SetErrorCode( aStatus );
-}
\ No newline at end of file
+}
index fb7e9314c7dee1b01c4286769e0aa48462a08d73..a9cac71de16e69a04d9790f8de12c7c9109bc9f6 100644 (file)
@@ -29,5 +29,3 @@ HYDROData_NaturalObject::HYDROData_NaturalObject()
 HYDROData_NaturalObject::~HYDROData_NaturalObject()
 {
 }
-
-