]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/kernel/marDynData.cpp
creaButtonContainer: Documentation updates :) :). If you turns on the documentation...
[creaMaracasVisu.git] / lib / maracasVisuLib / src / kernel / marDynData.cpp
index 067f800eb3a426741408a6410469f1ab0abd8fdb..bc2cd137827a74ef3e43768bcacd812075e249a2 100644 (file)
@@ -3,8 +3,8 @@
   Program:   wxMaracas
   Module:    $RCSfile: marDynData.cpp,v $
   Language:  C++
-  Date:      $Date: 2008/10/31 16:32:55 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2010/04/20 16:11:40 $
+  Version:   $Revision: 1.3 $
 
   Copyright: (c) 2002, 2003
   License:
@@ -147,8 +147,8 @@ void marDynData::copyFrom( const marObject& from )
 bool marDynData::save( std::ofstream& os )
 {
     void* data = _volume->getData1D( );
-    uint dims[ 3 ];
-    ulong dSize = _volume->getRawSizeInBytes( );
+    uint32_t dims[ 3 ];
+    ulong dSize = _volume->getRawSizeInBytes( );  // How many bytes for a 'ulong'? // JPR
     double sizes[ 3 ];
     kVolume::Type type = _volume->getType( );
 
@@ -159,7 +159,7 @@ bool marDynData::save( std::ofstream& os )
     sizes[ 1 ] = _volume->getYsize( );
     sizes[ 2 ] = _volume->getZsize( );
 
-    os.write( ( const char* )dims, 3 * sizeof( uint ) );
+    os.write( ( const char* )dims, 3 * sizeof( uint32_t ) );
     os.write( ( const char* )sizes, 3 * sizeof( double ) );
     os.write( ( const char* )&type, sizeof( kVolume::Type ) );
     os.write( ( const char* )&dSize, sizeof( ulong ) );
@@ -171,19 +171,19 @@ bool marDynData::save( std::ofstream& os )
 // -------------------------------------------------------------------------
 bool marDynData::load( std::ifstream& is )
 {
-    uchar* data;
-    uint dims[ 3 ];
+    uint8_t* data;
+    uint32_t dims[ 3 ];
     ulong dSize;
     double sizes[ 3 ];
     kVolume::Type type;
 
     reset( );
 
-    is.read( ( char* )dims, 3 * sizeof( uint ) );
+    is.read( ( char* )dims, 3 * sizeof( uint32_t ) );
     is.read( ( char* )sizes, 3 * sizeof( double ) );
     is.read( ( char* )&type, sizeof( kVolume::Type ) );
     is.read( ( char* )&dSize, sizeof( ulong ) );
-    data = new uchar[ dSize ];
+    data = new uint8_t[ dSize ];
     is.read( ( char* )data, dSize );
        
     _volume = new kVolume( type, dims, sizes, ( void* )data );