From: Leonardo Florez-Valencia Date: Tue, 3 Nov 2015 00:05:15 +0000 (-0500) Subject: Double click widget integrated with segmentation and deformation filters. X-Git-Tag: v0.1~308 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=106a56bfe6a48067380089ffd61a518e40d77933;p=cpPlugins.git Double click widget integrated with segmentation and deformation filters. --- diff --git a/lib/cpPlugins/Interface/ParametersQtDialog.cxx b/lib/cpPlugins/Interface/ParametersQtDialog.cxx index 0891a2b..3cea961 100644 --- a/lib/cpPlugins/Interface/ParametersQtDialog.cxx +++ b/lib/cpPlugins/Interface/ParametersQtDialog.cxx @@ -6,11 +6,7 @@ #include -#include -#include -#include -#include -#include +#include #include #include @@ -24,8 +20,7 @@ cpPlugins::Interface::ParametersQtDialog:: ParametersQtDialog( QWidget* parent, Qt::WindowFlags f ) : QDialog( parent, f ), m_Parameters( NULL ), - m_IsModal( false ), - m_Interactor( NULL ) + m_IsModal( false ) { this->m_Title = new QLabel( this ); this->m_Title->setText( "Parameters dialog title" ); @@ -43,9 +38,6 @@ cpPlugins::Interface::ParametersQtDialog:: delete this->m_Title; delete this->m_ToolsLayout; delete this->m_MainLayout; - - for( unsigned int i = 0; i < this->m_Widgets.size( ); ++i ) - this->m_Widgets[ i ]->Delete( ); } // ------------------------------------------------------------------------- @@ -65,9 +57,9 @@ getParameters( ) const // ------------------------------------------------------------------------- void cpPlugins::Interface::ParametersQtDialog:: -setInteractor( vtkRenderWindowInteractor* interactor ) +addInteractor( vtkRenderWindowInteractor* interactor ) { - this->m_Interactor = interactor; + this->m_Interactors.insert( interactor ); } // ------------------------------------------------------------------------- @@ -139,26 +131,22 @@ setParameters( Parameters* parameters ) } else if( pt == Parameters::Point || pt == Parameters::Index ) { - if( this->m_Interactor != NULL ) + auto iIt = this->m_Interactors.begin( ); + for( ; iIt != this->m_Interactors.end( ); ++iIt ) { - // Create a point widget and its representation - vtkSmartPointer< vtkPointHandleRepresentation3D > handle = - vtkSmartPointer< vtkPointHandleRepresentation3D >::New( ); - handle->GetProperty( )->SetColor( 1, 0, 0 ); - vtkSmartPointer< vtkSeedRepresentation > rep = - vtkSmartPointer< vtkSeedRepresentation >::New( ); - rep->SetHandleRepresentation( handle ); - - cpExtensions::Interaction::SeedWidget* widget = - cpExtensions::Interaction::SeedWidget::New( ); - widget->SetInteractor( this->m_Interactor ); - widget->SetRepresentation( rep ); - widget->On( ); - - this->m_Widgets.push_back( widget ); - this->m_IsModal = false; + TStyle* style = + dynamic_cast< TStyle* >( ( *iIt )->GetInteractorStyle( ) ); + std::cout << "ACA VOY --> " << style << std::endl; - } // fi + } // rof + this->m_IsModal = false; + + /* + if( this->m_Interactor != NULL ) + { + + } // fi + */ } // fi diff --git a/lib/cpPlugins/Interface/ParametersQtDialog.h b/lib/cpPlugins/Interface/ParametersQtDialog.h index 365ec9c..9e9b73a 100644 --- a/lib/cpPlugins/Interface/ParametersQtDialog.h +++ b/lib/cpPlugins/Interface/ParametersQtDialog.h @@ -7,15 +7,15 @@ #include #include +#include -#include +#include #include #include #include #include -class vtkAbstractWidget; class vtkRenderWindowInteractor; namespace cpPlugins @@ -29,13 +29,16 @@ namespace cpPlugins { Q_OBJECT; + public: + typedef cpExtensions::Interaction::ImageInteractorStyle TStyle; + public: ParametersQtDialog( QWidget* parent = 0, Qt::WindowFlags f = 0 ); virtual ~ParametersQtDialog( ); bool IsModal( ) const; Parameters* getParameters( ) const; - void setInteractor( vtkRenderWindowInteractor* interactor ); + void addInteractor( vtkRenderWindowInteractor* interactor ); bool setParameters( Parameters* parameters ); void setTitle( const std::string& title ); @@ -50,8 +53,7 @@ namespace cpPlugins QVBoxLayout* m_ToolsLayout; bool m_IsModal; - vtkRenderWindowInteractor* m_Interactor; - std::vector< vtkAbstractWidget* > m_Widgets; + std::set< vtkRenderWindowInteractor* > m_Interactors; }; } // ecapseman