X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FInterface%2FMesh.cxx;h=8507a4b52a2e0f385b3b60c306a0d4428e1afc5a;hb=a3f2018cdd92e865082fed86673f10207c21ec51;hp=55114dd5ee26966471f3b4d52972e93d9737babd;hpb=7c7bc497af96e7b5845be9a2fc277036ec752be9;p=cpPlugins.git diff --git a/lib/cpPlugins/Interface/Mesh.cxx b/lib/cpPlugins/Interface/Mesh.cxx index 55114dd..8507a4b 100644 --- a/lib/cpPlugins/Interface/Mesh.cxx +++ b/lib/cpPlugins/Interface/Mesh.cxx @@ -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$