]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/DataObject.cxx
Actors updated
[cpPlugins.git] / lib / cpPlugins / DataObject.cxx
index 9fd054d8a7f2b07b64b454ad6a54d237d971a859..e51ddaf5fd6d354605076015edc080f7a54a4cc2 100644 (file)
@@ -5,7 +5,7 @@
 #include <itkDataObject.h>
 #include <vtkImageData.h>
 #include <vtkPolyData.h>
-#include <vtkRenderWindow.h>
+#include <vtkProp.h>
 
 // -------------------------------------------------------------------------
 cpPlugins::ProcessObject* cpPlugins::DataObject::
@@ -86,22 +86,42 @@ CreateQtDialog( )
 
 // -------------------------------------------------------------------------
 vtkProp* cpPlugins::DataObject::
-CreateVTKActor( )
+GetVTKActor( )
 {
-  return( NULL );
+  if( this->m_Actor == NULL )
+    this->_CreateVTKActor( );
+  return( this->m_Actor );
+}
+
+// -------------------------------------------------------------------------
+const vtkProp* cpPlugins::DataObject::
+GetVTKActor( ) const
+{
+  if( this->m_Actor == NULL )
+    this->_CreateVTKActor( );
+  return( this->m_Actor );
 }
 
 // -------------------------------------------------------------------------
 cpPlugins::DataObject::
 DataObject( )
   : Superclass( ),
-    m_Source( NULL )
+    m_Source( NULL ),
+    m_Actor( NULL )
 {
 }
 
 // -------------------------------------------------------------------------
 cpPlugins::DataObject::
 ~DataObject( )
+{
+  if( this->m_Actor != NULL )
+    this->m_Actor->Delete( );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::DataObject::
+_CreateVTKActor( ) const
 {
 }