X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FInterface%2FMesh.hxx;h=16504f095a31d9ea9ee3be828fbbf9c907a73fec;hb=6ffc11d77924d6ab7e94db95d41105982ac73e00;hp=5c5e5626c5b8690d3a502267b69a377f8ee3862d;hpb=706ab4caa20c5027cbbe5e6ace379529f6f99c64;p=cpPlugins.git diff --git a/lib/cpPlugins/Interface/Mesh.hxx b/lib/cpPlugins/Interface/Mesh.hxx index 5c5e562..16504f0 100644 --- a/lib/cpPlugins/Interface/Mesh.hxx +++ b/lib/cpPlugins/Interface/Mesh.hxx @@ -11,37 +11,15 @@ #include #include -// ------------------------------------------------------------------------- -#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$