]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Interface/Mesh.cxx
Merge branch 'master' of ssh://git.creatis.insa-lyon.fr/cpPlugins
[cpPlugins.git] / lib / cpPlugins / Interface / Mesh.cxx
index c052e6a5a245a2a56993bbec01194632ad628cc1..8507a4b52a2e0f385b3b60c306a0d4428e1afc5a 100644 (file)
@@ -4,37 +4,29 @@
 
 // -------------------------------------------------------------------------
 void cpPlugins::Interface::Mesh::
-SetITKDataObject( itk::DataObject* o )
+SetVTKMesh( vtkPolyData* mesh )
 {
-  // TODO: conversion!!!
-  std::cout << "Mesh: SetITKDataObject " << std::endl;
-  std::exit( 1 );
-}
+  this->m_VTKObject = mesh;
 
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::Mesh::
-SetVTKDataObject( vtkDataObject* o )
-{
-  if( dynamic_cast< vtkPolyData* >( o ) != NULL )
-  {
-    this->m_VTKObject = o;
+  this->m_Mapper = vtkSmartPointer< vtkPolyDataMapper >::New( );
+  this->m_Actor = vtkSmartPointer< vtkActor >::New( );
 
-    // TODO: conversion!!!
-  }
-  else
-    this->m_VTKObject = NULL;
+  this->m_Mapper->SetInputData( mesh );
+  this->m_Actor->SetMapper( this->m_Mapper );
+
+  this->Modified( );
 }
 
 // -------------------------------------------------------------------------
 vtkPolyData* cpPlugins::Interface::Mesh::
-GetVTKPolyData( )
+GetVTKMesh( )
 {
   return( dynamic_cast< vtkPolyData* >( this->m_VTKObject.GetPointer( ) ) );
 }
 
 // -------------------------------------------------------------------------
 const vtkPolyData* cpPlugins::Interface::Mesh::
-GetVTKPolyData( ) const
+GetVTKMesh( ) const
 {
   return(
     dynamic_cast< const vtkPolyData* >( this->m_VTKObject.GetPointer( ) )
@@ -42,45 +34,31 @@ GetVTKPolyData( ) const
 }
 
 // -------------------------------------------------------------------------
-cpPlugins::Interface::Mesh::
-Mesh( )
-  : Superclass( )
+vtkActor* cpPlugins::Interface::Mesh::
+GetVTKActor( )
 {
-  this->m_ClassName = "cpPlugins::Interface::Mesh";
-  this->m_ClassCategory = "BasicObject";
+  return( this->m_Actor );
 }
 
 // -------------------------------------------------------------------------
-cpPlugins::Interface::Mesh::
-~Mesh( )
+const vtkActor* cpPlugins::Interface::Mesh::
+GetVTKActor( ) const
 {
+  return( this->m_Actor );
 }
 
 // -------------------------------------------------------------------------
-template< unsigned int D >
-void cpPlugins::Interface::Mesh::
-_ITK_2_VTK_0( itk::DataObject* o )
-{
-}
-
-// -------------------------------------------------------------------------
-template< class P, unsigned int D >
-void cpPlugins::Interface::Mesh::
-_ITK_2_VTK_1( itk::DataObject* o )
-{
-}
-
-// -------------------------------------------------------------------------
-template< unsigned int D >
-void cpPlugins::Interface::Mesh::
-_VTK_2_ITK_0( itk::DataObject* o )
+cpPlugins::Interface::Mesh::
+Mesh( )
+  : Superclass( )
 {
+  this->m_ClassName = "cpPlugins::Interface::Mesh";
+  this->m_ClassCategory = "BasicObject";
 }
 
 // -------------------------------------------------------------------------
-template< class P, unsigned int D >
-void cpPlugins::Interface::Mesh::
-_VTK_2_ITK_1( itk::DataObject* o )
+cpPlugins::Interface::Mesh::
+~Mesh( )
 {
 }