]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Interface/Mesh.cxx
Garbage collector added
[cpPlugins.git] / lib / cpPlugins / Interface / Mesh.cxx
index 8a184c92471917b24ec2747856b51fd0dfc8362d..9841f7e0c2bd3fd5cab159f4f08b1eae9e7d5230 100644 (file)
@@ -5,21 +5,6 @@
 #include <cpPlugins/Extensions/DataStructures/QuadEdgeMesh.h>
 #include <cpPlugins/Extensions/Visualization/OpenGLMeshMapper.h>
 
-// -------------------------------------------------------------------------
-cpPlugins::Interface::Mesh::
-Mesh( )
-  : Superclass( ),
-    m_Mapper( NULL )
-{
-}
-
-// -------------------------------------------------------------------------
-cpPlugins::Interface::Mesh::
-~Mesh( )
-{
-  if( this->m_Mapper != NULL ) this->m_Mapper->Delete( );
-}
-
 // -------------------------------------------------------------------------
 std::string cpPlugins::Interface::Mesh::
 GetClassName( ) const
@@ -29,11 +14,11 @@ GetClassName( ) const
 
 // -------------------------------------------------------------------------
 void cpPlugins::Interface::Mesh::
-SetDataObject( itk::DataObject* dobj )
+SetRealDataObject( itk::DataObject* dobj )
 {
-  this->Superclass::SetDataObject( dobj );
-  
-  // WARNING: Only 2 and 3 dimensions at this moment
+  this->Superclass::SetRealDataObject( dobj );
+
+  // NOTE: Only 2 and 3 dimensions at this moment
   using namespace cpPlugins::Extensions;
   typedef DataStructures::QuadEdgeMesh< float, 2 >  _TF2;
   typedef DataStructures::QuadEdgeMesh< double, 2 > _TD2;
@@ -53,6 +38,21 @@ GetVTKMapper( ) const
   return( this->m_Mapper );
 }
 
+// -------------------------------------------------------------------------
+cpPlugins::Interface::Mesh::
+Mesh( )
+  : Superclass( ),
+    m_Mapper( NULL )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::Mesh::
+~Mesh( )
+{
+  if( this->m_Mapper != NULL ) this->m_Mapper->Delete( );
+}
+
 // -------------------------------------------------------------------------
 template< class M >
 void cpPlugins::Interface::Mesh::
@@ -63,7 +63,7 @@ _Map( )
     _TMapper;
 
   if( this->m_Mapper != NULL ) this->m_Mapper->Delete( );
-  M* mesh = dynamic_cast< M* >( this->Superclass::GetDataObject( ) );
+  M* mesh = dynamic_cast< M* >( this->Superclass::GetRealDataObject( ) );
   _TMapper* mapper = _TMapper::New( );
   mapper->SetInputData( mesh );
   this->m_Mapper = mapper;