]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/DataObject.cxx
Windows compilation is broken.
[cpPlugins.git] / lib / cpPlugins / DataObject.cxx
index 06c10df303507912a221779baa13299e5ac0171a..ebfb8b224a7176f4564600347b4d831fa2de7572 100644 (file)
@@ -1,9 +1,11 @@
 #include <cpPlugins/DataObject.h>
 
 #include <cpPlugins/ProcessObject.h>
+#include <cpPlugins/DataObjectVisualizationQtDialog.h>
 #include <itkDataObject.h>
 #include <vtkImageData.h>
 #include <vtkPolyData.h>
+#include <vtkRenderWindow.h>
 
 // -------------------------------------------------------------------------
 cpPlugins::ProcessObject* cpPlugins::DataObject::
@@ -64,6 +66,87 @@ DisconnectFromPipeline( )
   this->Modified( );
 }
 
+// -------------------------------------------------------------------------
+cpPlugins::DataObjectVisualizationQtDialog* cpPlugins::DataObject::
+CreateQtDialog( )
+{
+#ifdef cpPlugins_QT4
+  DataObjectVisualizationQtDialog* dlg = NULL;
+  if( QApplication::instance( ) != NULL )
+  {
+    dlg = new DataObjectVisualizationQtDialog( );
+    dlg->setDataObject( this );
+
+  } // fi
+  return( dlg );
+#else // cpPlugins_QT4  
+  return( NULL );
+#endif // cpPlugins_QT4
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::DataObject::
+AddVTKActor( vtkProp* actor, vtkRenderer* renderer )
+{
+  if( actor != NULL && renderer != NULL )
+  {
+    TDataView v;
+    v.Actor = actor;
+    v.Renderer = renderer;
+    this->m_Actors.insert( v );
+    this->Modified( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::DataObject::
+ClearVTKActors( )
+{
+  this->m_Actors.clear( );
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::DataObject::
+RenderVTKActors( )
+{
+  for( auto i = this->m_Actors.begin( ); i != this->m_Actors.end( ); ++i )
+    i->Renderer->GetRenderWindow( )->Render( );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::DataObject::TDataViews::
+iterator cpPlugins::DataObject::
+BeginVTKActors( )
+{
+  return( this->m_Actors.begin( ) );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::DataObject::TDataViews::
+iterator cpPlugins::DataObject::
+EndVTKActors( )
+{
+  return( this->m_Actors.end( ) );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::DataObject::TDataViews::
+const_iterator cpPlugins::DataObject::
+BeginVTKActors( ) const
+{
+  return( this->m_Actors.begin( ) );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::DataObject::TDataViews::
+const_iterator cpPlugins::DataObject::
+EndVTKActors( ) const
+{
+  return( this->m_Actors.end( ) );
+}
+
 // -------------------------------------------------------------------------
 cpPlugins::DataObject::
 DataObject( )