]> Creatis software - creaMaracasVisu.git/commitdiff
Avoid troubles while fighting against Initialization List.
authorjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Mon, 15 Mar 2010 14:12:30 +0000 (14:12 +0000)
committerjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Mon, 15 Mar 2010 14:12:30 +0000 (14:12 +0000)
lib/maracasVisuLib/src/kernel/volume.cxx
lib/maracasVisuLib/src/kernel/volume.hxx

index f661e5dc219639e8206c45e2eaa3e1cd3918f501..8155ec3bc402e81826580337a012bb99d4cc4438 100644 (file)
@@ -3,8 +3,8 @@
   Program:   wxMaracas
   Module:    $RCSfile: volume.cxx,v $
   Language:  C++
-  Date:      $Date: 2009/05/14 13:54:43 $
-  Version:   $Revision: 1.5 $
+  Date:      $Date: 2010/03/15 14:12:30 $
+  Version:   $Revision: 1.6 $
 
   Copyright: (c) 2002, 2003
   License:
@@ -99,15 +99,15 @@ template< class TYPE >
 
 // -------------------------------------------------------------------------
 kVolume::kVolume( )
-    : _type( UCHAR ), _creator( SELF ),
-#ifdef KGFO_USE_VTK
-      _vtk( NULL ),
-#endif // KGFO_USE_VTK
-//#ifdef KGFO_USE_IDO
-//      _privateIdo( NULL ),
-//#endif // KGFO_USE_IDO
-      _raw( NULL ), _columns( NULL ),
+    : _type( UCHAR ), 
+      _creator( SELF ),
+      _raw( NULL ), 
+      _columns( NULL ),
       _images( NULL )
+#ifdef KGFO_USE_VTK
+                  ,
+      _vtk( NULL )      
+#endif // KGFO_USE_VTK      
 {
     _dims[ CX ] = 1; _dims[ CY ] = 1; _dims[ CZ ] = 1;
     _sizes[ CX ] = 1; _sizes[ CY ] = 1; _sizes[ CZ ] = 1;
@@ -120,15 +120,15 @@ kVolume::kVolume( Type type,
                  uint xdim, uint ydim, uint zdim,
                  double xsize, double ysize, double zsize,
                  void* data )
-    : _type( type ), _creator( SELF ),
-#ifdef KGFO_USE_VTK
-      _vtk( NULL ),
-#endif // KGFO_USE_VTK
-//#ifdef KGFO_USE_IDO
-//      _privateIdo( NULL ),
-//#endif // KGFO_USE_IDO
-      _raw( NULL ), _columns( NULL ),
+    : _type( type ), 
+      _creator( SELF ),
+      _raw( NULL ), 
+      _columns( NULL ),
       _images( NULL )
+#ifdef KGFO_USE_VTK
+                    ,
+      _vtk( NULL )
+#endif // KGFO_USE_VTK      
 {
     _dims[ CX ] = xdim; _dims[ CY ] = ydim; _dims[ CZ ] = zdim;
     _sizes[ CX ] = xsize; _sizes[ CY ] = ysize; _sizes[ CZ ] = zsize;
@@ -148,15 +148,15 @@ kVolume::kVolume( Type type,
                  const uint *dims,
                  const double *sizes,
                  void* data )
-    : _type( type ), _creator( SELF ),
-#ifdef KGFO_USE_VTK
-      _vtk( NULL ),
-#endif // KGFO_USE_VTK
-//#ifdef KGFO_USE_IDO
-//      _privateIdo( NULL ),
-//#endif // KGFO_USE_IDO
+    : _type( type ), 
+      _creator( SELF ),
       _raw( NULL ), _columns( NULL ),
       _images( NULL )
+#ifdef KGFO_USE_VTK
+                   ,
+      _vtk( NULL )
+#endif // KGFO_USE_VTK      
+      
 {
     memcpy( _dims, dims, 3 * sizeof( uint ) );
     memcpy( _sizes, sizes, 3 * sizeof( double ) );
@@ -173,15 +173,16 @@ kVolume::kVolume( Type type,
 
 // -------------------------------------------------------------------------
 kVolume::kVolume( const kVolume& org )
-    : _type( UCHAR ), _creator( SELF ),
-#ifdef KGFO_USE_VTK
-      _vtk( NULL ),
-#endif // KGFO_USE_VTK
-//#ifdef KGFO_USE_IDO
-//      _privateIdo( NULL ),
-//#endif // KGFO_USE_IDO
-      _raw( NULL ), _columns( NULL ),
+    : _type( UCHAR ), 
+      _creator( SELF ),
+      _raw( NULL ), 
+      _columns( NULL ),
       _images( NULL )
+#ifdef KGFO_USE_VTK
+                   ,
+      _vtk( NULL )
+#endif // KGFO_USE_VTK      
+  
 {
     copyFrom( org );
 }
@@ -809,49 +810,32 @@ void kVolume::buildIndex( )
 void kVolume::deallocate( )
 {
 #ifdef KGFO_USE_VTK
-
     if( _vtk ) _vtk->Delete();
     _vtk = NULL;
-
 #endif // KGFO_USE_VTK
-
-//#ifdef KGFO_USE_IDO
-
-//    if( _creator == SELF || _creator == VTK ) {
-
-//     delete[] _privateIdo;
-//     _privateIdo = NULL;
-       
-//    } // fi
-
-//#else
-
     delete[] ( uchar* )_images;
-
-//#endif // KGFO_USE_IDO
-
     if( _raw && _creator == SELF )
 
 //EED purify 12/sept/2006
 //     delete[] ( uchar* )_raw;
 
-       free ( _raw );
+    free ( _raw );
 
-    _creator   = SELF;
-    _raw               = NULL;
-    _columns   = NULL;
-    _images            = NULL;
+    _creator = SELF;
+    _raw     = NULL;
+    _columns = NULL;
+    _images  = NULL;
 }
 
 #ifdef KGFO_USE_VTK
 
 // -------------------------------------------------------------------------
 kVolume::kVolume( vtkImageData* org )
-    : _raw( 0 ), _columns( 0 ), _images( 0 ),
+    :
       _creator( VTK ),
-//#ifdef KGFO_USE_IDO
-//      _privateIdo( NULL ),
-//#endif // KGFO_USE_IDO
+      _raw( 0 ), 
+      _columns( 0 ), 
+      _images( 0 ),
       _vtk( 0 )
 {
     //int i, j, k, y;
@@ -913,11 +897,11 @@ void kVolume::copyFrom( vtkImageData* org )
 
 //#endif // KGFO_USE_IDO
 
-    _vtk               = NULL;
-    _raw               = NULL;
-    _columns   = NULL;
-    _images            = NULL;
-    _creator   = SELF;
+    _vtk     = NULL;
+    _raw     = NULL;
+    _columns = NULL;
+    _images  = NULL;
+    _creator = SELF;
 
     switch( org->GetScalarType( ) ) {
 
index 57b9253a830edc23d5a95b2c33cd37ca8b380590..31d20f664d293874ca1ba816e970964a3cd7a0aa 100644 (file)
@@ -3,8 +3,8 @@
   Program:   wxMaracas
   Module:    $RCSfile: volume.hxx,v $
   Language:  C++
-  Date:      $Date: 2009/05/14 13:54:43 $
-  Version:   $Revision: 1.5 $
+  Date:      $Date: 2010/03/15 14:12:30 $
+  Version:   $Revision: 1.6 $
 
   Copyright: (c) 2002, 2003
   License:
 #include "marTypes.h"
 #include <string>
 
-//#ifdef KGFO_USE_IDO
-//extern "C"
-//{
-//#include <idvol.h>
-//};
-//#endif // KGFO_USE_IDO
-
 #ifdef KGFO_USE_VTK
 #include <vtkImageData.h>
 #endif // KGFO_USE_VTK
@@ -50,11 +43,6 @@ class creaMaracasVisu_EXPORT kVolume
     static const vtkIdType VTKTypes[];
 
 #endif // KGFO_USE_VTK
-//#ifdef KGFO_USE_IDO
-//
-//    static const int IDOTypes[];
-//
-//#endif // KGFO_USE_IDO
 
     public:
 
@@ -196,62 +184,6 @@ class creaMaracasVisu_EXPORT kVolume
 
 #endif // KGFO_USE_VTK
 
-
-//#ifdef KGFO_USE_IDO
-
-//    public:
-//
-//    kVolume( PPPVOLUME org );
-//
-//    kVolume& operator=( PPPVOLUME org );
-//    void copyFrom( PPPVOLUME org ); 
-//
-//    PPPVOLUME castIdo( ) const
-//    {
-//     return( ( PPPVOLUME )( &_privateIdo[ 1 ] ) );
-//    }
-//    operator PPPVOLUME( ) const
-//    {
-//     return( ( PPPVOLUME )( &_privateIdo[ 1 ] ) );
-//    }
-//    operator PPPVOLUME_CHAR( ) const
-//    {
-//     return( ( PPPVOLUME_CHAR )( &_privateIdo[ 1 ] ) );
-//    }
-//    operator PPPVOLUME_FLOAT( ) const
-//    {
-//     return( ( PPPVOLUME_FLOAT )( &_privateIdo[ 1 ] ) );
-//    }
-//    operator PPPVOLUME_DOUBLE( ) const
-//    {
-//     return( ( PPPVOLUME_DOUBLE )( &_privateIdo[ 1 ] ) );
-//    }
-//    operator PPPVOLUME_LONG( ) const
-//    {
-//     return( ( PPPVOLUME_LONG )( &_privateIdo[ 1 ] ) );
-//    }
-//    operator PPPVOLUME_SHORT( ) const
-//    {
-//     return( ( PPPVOLUME_SHORT )( &_privateIdo[ 1 ] ) );
-//    }
-//    operator PPPVOLUME_UCHAR( ) const
-//    {
-//     return( ( PPPVOLUME_UCHAR )( &_privateIdo[ 1 ] ) );
-//    }
-//    operator PPPVOLUME_ULONG( ) const
-//    {
-//     return( ( PPPVOLUME_ULONG )( &_privateIdo[ 1 ] ) );
-//    }
-//    operator PPPVOLUME_USHORT( ) const
-//    {
-//     return( ( PPPVOLUME_USHORT )( &_privateIdo[ 1 ] ) );
-//    }
-//     
-//    protected:
-//
-//    PRIVATE_VOLUME* _privateIdo;
-//
-//#endif // KGFO_USE_IDO
 };
 
 #endif // KGFO__VOLUME__HXX