]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Interface/Mesh.cxx
Generic gaussian model estimator added
[cpPlugins.git] / lib / cpPlugins / Interface / Mesh.cxx
index 3bcb5afaa043e06f650bd07746055cad3578b101..9841f7e0c2bd3fd5cab159f4f08b1eae9e7d5230 100644 (file)
@@ -2,23 +2,8 @@
 
 #include <vtkMapper.h>
 
-#include <cpPlugins/Extensions/QuadEdgeMesh.h>
-#include <cpPlugins/Extensions/OpenGLMeshMapper.h>
-
-// -------------------------------------------------------------------------
-cpPlugins::Interface::Mesh::
-Mesh( )
-  : Superclass( ),
-    m_Mapper( NULL )
-{
-}
-
-// -------------------------------------------------------------------------
-cpPlugins::Interface::Mesh::
-~Mesh( )
-{
-  if( this->m_Mapper != NULL ) this->m_Mapper->Delete( );
-}
+#include <cpPlugins/Extensions/DataStructures/QuadEdgeMesh.h>
+#include <cpPlugins/Extensions/Visualization/OpenGLMeshMapper.h>
 
 // -------------------------------------------------------------------------
 std::string cpPlugins::Interface::Mesh::
@@ -29,15 +14,16 @@ GetClassName( ) const
 
 // -------------------------------------------------------------------------
 void cpPlugins::Interface::Mesh::
-SetDataObject( itk::DataObject* dobj )
+SetRealDataObject( itk::DataObject* dobj )
 {
-  this->Superclass::SetDataObject( dobj );
-  
-  // WARNING: Only 2 and 3 dimensions at this moment
-  typedef cpPlugins::Extensions::QuadEdgeMesh< float, 2 >  _TF2;
-  typedef cpPlugins::Extensions::QuadEdgeMesh< double, 2 > _TD2;
-  typedef cpPlugins::Extensions::QuadEdgeMesh< float, 3 >  _TF3;
-  typedef cpPlugins::Extensions::QuadEdgeMesh< double, 3 > _TD3;
+  this->Superclass::SetRealDataObject( dobj );
+
+  // NOTE: 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 >( );
@@ -52,15 +38,32 @@ GetVTKMapper( ) const
   return( this->m_Mapper );
 }
 
+// -------------------------------------------------------------------------
+cpPlugins::Interface::Mesh::
+Mesh( )
+  : Superclass( ),
+    m_Mapper( NULL )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::Mesh::
+~Mesh( )
+{
+  if( this->m_Mapper != NULL ) this->m_Mapper->Delete( );
+}
+
 // -------------------------------------------------------------------------
 template< class M >
 void cpPlugins::Interface::Mesh::
 _Map( )
 {
-  typedef cpPlugins::Extensions::OpenGLMeshMapper< M > _TMapper;
+  typedef
+    cpPlugins::Extensions::Visualization::OpenGLMeshMapper< M >
+    _TMapper;
 
   if( this->m_Mapper != NULL ) this->m_Mapper->Delete( );
-  M* mesh = dynamic_cast< M* >( this->Superclass::GetDataObject( ) );
+  M* mesh = dynamic_cast< M* >( this->Superclass::GetRealDataObject( ) );
   _TMapper* mapper = _TMapper::New( );
   mapper->SetInputData( mesh );
   this->m_Mapper = mapper;