]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Interface/Mesh.cxx
median filter added
[cpPlugins.git] / lib / cpPlugins / Interface / Mesh.cxx
index 55114dd5ee26966471f3b4d52972e93d9737babd..8507a4b52a2e0f385b3b60c306a0d4428e1afc5a 100644 (file)
@@ -7,6 +7,13 @@ void cpPlugins::Interface::Mesh::
 SetVTKMesh( vtkPolyData* mesh )
 {
   this->m_VTKObject = mesh;
+
+  this->m_Mapper = vtkSmartPointer< vtkPolyDataMapper >::New( );
+  this->m_Actor = vtkSmartPointer< vtkActor >::New( );
+
+  this->m_Mapper->SetInputData( mesh );
+  this->m_Actor->SetMapper( this->m_Mapper );
+
   this->Modified( );
 }
 
@@ -26,45 +33,19 @@ GetVTKMesh( ) const
     );
 }
 
-/*
-void cpPlugins::Interface::Mesh::
-SetITKDataObject( itk::DataObject* o )
-{
-  // TODO: conversion!!!
-  std::cout << "Mesh: SetITKDataObject " << std::endl;
-  std::exit( 1 );
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::Mesh::
-SetVTKDataObject( vtkDataObject* o )
-{
-  if( dynamic_cast< vtkPolyData* >( o ) != NULL )
-  {
-    this->m_VTKObject = o;
-
-    // TODO: conversion!!!
-  }
-  else
-    this->m_VTKObject = NULL;
-}
-
 // -------------------------------------------------------------------------
-vtkPolyData* cpPlugins::Interface::Mesh::
-GetVTKPolyData( )
+vtkActor* cpPlugins::Interface::Mesh::
+GetVTKActor( )
 {
-  return( dynamic_cast< vtkPolyData* >( this->m_VTKObject.GetPointer( ) ) );
+  return( this->m_Actor );
 }
 
 // -------------------------------------------------------------------------
-const vtkPolyData* cpPlugins::Interface::Mesh::
-GetVTKPolyData( ) const
+const vtkActor* cpPlugins::Interface::Mesh::
+GetVTKActor( ) const
 {
-  return(
-    dynamic_cast< const vtkPolyData* >( this->m_VTKObject.GetPointer( ) )
-    );
+  return( this->m_Actor );
 }
-*/
 
 // -------------------------------------------------------------------------
 cpPlugins::Interface::Mesh::
@@ -81,34 +62,4 @@ cpPlugins::Interface::Mesh::
 {
 }
 
-// -------------------------------------------------------------------------
-/* TODO
-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 )
-{
-}
-
-// -------------------------------------------------------------------------
-template< class P, unsigned int D >
-void cpPlugins::Interface::Mesh::
-_VTK_2_ITK_1( itk::DataObject* o )
-{
-}
-*/
-
 // eof - $RCSfile$