]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Interface/Mesh.cxx
XML IO added. Workspace singleton added to simplify pipeline definition and execution.
[cpPlugins.git] / lib / cpPlugins / Interface / Mesh.cxx
index 8a184c92471917b24ec2747856b51fd0dfc8362d..94adb2bb163ae5f47da17ff9e62abb41d22d74c4 100644 (file)
@@ -1,72 +1,28 @@
 #include <cpPlugins/Interface/Mesh.h>
 
-#include <vtkMapper.h>
-
-#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
-{
-  return( "cpPlugins::Interface::Mesh" );
-}
+#include <vtkPolyData.h>
 
 // -------------------------------------------------------------------------
 void cpPlugins::Interface::Mesh::
-SetDataObject( itk::DataObject* dobj )
+SetVTK( vtkObject* mesh )
 {
-  this->Superclass::SetDataObject( dobj );
-  
-  // WARNING: Only 2 and 3 dimensions at this moment
-  using namespace cpPlugins::Extensions;
-  typedef DataStructures::QuadEdgeMesh< float, 2 >  _TF2;
-  typedef DataStructures::QuadEdgeMesh< double, 2 > _TD2;
-  typedef DataStructures::QuadEdgeMesh< float, 3 >  _TF3;
-  typedef DataStructures::QuadEdgeMesh< double, 3 > _TD3;
-
-  if     ( dynamic_cast< _TF2* >( dobj ) ) this->_Map< _TF2 >( );
-  else if( dynamic_cast< _TD2* >( dobj ) ) this->_Map< _TD2 >( );
-  else if( dynamic_cast< _TF3* >( dobj ) ) this->_Map< _TF3 >( );
-  else if( dynamic_cast< _TD3* >( dobj ) ) this->_Map< _TD3 >( );
+  if( dynamic_cast< vtkPolyData* >( mesh ) != NULL )
+    this->m_VTKObject = mesh;
+  else
+    this->m_VTKObject = NULL;
+  this->Modified( );
 }
-
 // -------------------------------------------------------------------------
-vtkMapper* cpPlugins::Interface::Mesh::
-GetVTKMapper( ) const
+cpPlugins::Interface::Mesh::
+Mesh( )
+  : Superclass( )
 {
-  return( this->m_Mapper );
 }
 
 // -------------------------------------------------------------------------
-template< class M >
-void cpPlugins::Interface::Mesh::
-_Map( )
+cpPlugins::Interface::Mesh::
+~Mesh( )
 {
-  typedef
-    cpPlugins::Extensions::Visualization::OpenGLMeshMapper< M >
-    _TMapper;
-
-  if( this->m_Mapper != NULL ) this->m_Mapper->Delete( );
-  M* mesh = dynamic_cast< M* >( this->Superclass::GetDataObject( ) );
-  _TMapper* mapper = _TMapper::New( );
-  mapper->SetInputData( mesh );
-  this->m_Mapper = mapper;
 }
 
 // eof - $RCSfile$