]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Interface/Mesh.hxx
MAC compilation issues solved... Now some tests please
[cpPlugins.git] / lib / cpPlugins / Interface / Mesh.hxx
index 5c5e5626c5b8690d3a502267b69a377f8ee3862d..16504f095a31d9ea9ee3be828fbbf9c907a73fec 100644 (file)
 #include <vtkPoints.h>
 #include <vtkPolyData.h>
 
-// -------------------------------------------------------------------------
-#define cpPlugins_Mesh_Import( N, T, D )                                \
-  cpPlugins_TEMPLATE_IMPORT(                                            \
-    2(class cpPlugins_Interface_EXPORT itk::N< T, D >)                  \
-    )
-
-// -------------------------------------------------------------------------
-
-#ifndef cpPlugins_Interface_EXPORTS
-
-cpPlugins_Mesh_Import( Mesh, float, 2 );
-cpPlugins_Mesh_Import( Mesh, double, 2 );
-cpPlugins_Mesh_Import( Mesh, float, 3 );
-cpPlugins_Mesh_Import( Mesh, double, 3 );
-cpPlugins_Mesh_Import( QuadEdgeMesh, float, 2 );
-cpPlugins_Mesh_Import( QuadEdgeMesh, double, 2 );
-cpPlugins_Mesh_Import( QuadEdgeMesh, float, 3 );
-cpPlugins_Mesh_Import( QuadEdgeMesh, double, 3 );
-
-#endif // cpPlugins_Interface_EXPORTS
-
 // -------------------------------------------------------------------------
 template< class M >
 void cpPlugins::Interface::Mesh::
-SetITK( M* mesh )
+_ITK_2_VTK( itk::LightObject* o )
 {
-  if( this->m_ITKObject.GetPointer( ) == mesh )
+  M* mesh = dynamic_cast< M* >( o );
+  if( mesh == NULL )
     return;
 
-  this->m_ITKObject = mesh;
-
   long numPoints = mesh->GetNumberOfPoints( );
   if( numPoints == 0 )
     return;
@@ -92,6 +70,27 @@ SetITK( M* mesh )
   this->Modified( );
 }
 
+// -------------------------------------------------------------------------
+#define cpPlugins_Mesh_Import( N, T, D )                                \
+  cpPlugins_TEMPLATE_IMPORT(                                            \
+    2(class cpPlugins_Interface_EXPORT itk::N< T, D >)                  \
+    )
+
+// -------------------------------------------------------------------------
+
+#ifndef cpPlugins_Interface_EXPORTS
+
+cpPlugins_Mesh_Import( Mesh, float, 2 );
+cpPlugins_Mesh_Import( Mesh, double, 2 );
+cpPlugins_Mesh_Import( Mesh, float, 3 );
+cpPlugins_Mesh_Import( Mesh, double, 3 );
+cpPlugins_Mesh_Import( QuadEdgeMesh, float, 2 );
+cpPlugins_Mesh_Import( QuadEdgeMesh, double, 2 );
+cpPlugins_Mesh_Import( QuadEdgeMesh, float, 3 );
+cpPlugins_Mesh_Import( QuadEdgeMesh, double, 3 );
+
+#endif // cpPlugins_Interface_EXPORTS
+
 #endif // __CPPLUGINS__INTERFACE__MESH__HXX__
 
 // eof - $RCSfile$