From b2bb173d0feca93ca889a80280a1f5d2a87de402 Mon Sep 17 00:00:00 2001 From: Leonardo Florez-Valencia Date: Fri, 20 May 2016 17:59:49 -0500 Subject: [PATCH] ... --- appli/PipelineEditor/PipelineEditor.cxx | 44 +++++++++++++------------ appli/PipelineEditor/PipelineEditor.ui | 26 ++++++++++++++- lib/cpExtensions/QT/SimpleMPRWidget.cxx | 11 +++++++ lib/cpExtensions/QT/SimpleMPRWidget.h | 2 ++ 4 files changed, 61 insertions(+), 22 deletions(-) diff --git a/appli/PipelineEditor/PipelineEditor.cxx b/appli/PipelineEditor/PipelineEditor.cxx index 0f2d3fd..b61cd14 100644 --- a/appli/PipelineEditor/PipelineEditor.cxx +++ b/appli/PipelineEditor/PipelineEditor.cxx @@ -123,20 +123,20 @@ _HideFilterOutput( const std::string& filter_name, const std::string& output_name ) { - /* // Get output - auto filter = this->m_Workspace.GetFilter( filter_name ); - if( filter != NULL ) - { - auto output = filter->GetOutputData( output_name ); - if( output != NULL ) - { - std::string data_name = output_name + "@" + filter_name; - this->m_UI->Viewer->HideData( data_name ); + /* TODO + auto filter = this->m_Workspace.GetFilter( filter_name ); + if( filter != NULL ) + { + auto output = filter->GetOutputData( output_name ); + if( output != NULL ) + { + std::string data_name = output_name + "@" + filter_name; + this->m_UI->Viewer->HideData( data_name ); - } // fi + } // fi - } // fi + } // fi */ } @@ -146,22 +146,25 @@ _PropertiesFilterOutput( const std::string& filter_name, const std::string& output_name ) { - /* // Get output auto filter = this->m_Workspace.GetFilter( filter_name ); if( filter != NULL ) { - auto output = filter->GetOutputData( output_name ); + auto output = filter->GetOutputData< vtkPolyData >( output_name ); if( output != NULL ) { - std::string data_name = output_name + "@" + filter_name; - auto prop = this->m_UI->Viewer->GetProp( data_name ); + auto actor = this->m_UI->Viewer->GetActor( output ); + if( actor != NULL ) + { + cpExtensions::QT::PropertyWidget* wdg = + new cpExtensions::QT::PropertyWidget( NULL ); + wdg->SetProp( actor ); + wdg->SetRenderWindow( + this->m_UI->Viewer->GetInteractor( 3 )->GetRenderWindow( ) + ); + wdg->show( ); - cpExtensions::QT::PropertyWidget* wdg = - new cpExtensions::QT::PropertyWidget( NULL ); - wdg->SetProp( prop ); - wdg->SetRenderWindow( this->m_UI->Viewer->GetInteractor( 3 )->GetRenderWindow( ) ); - wdg->show( ); + } // fi } else QMessageBox::critical( @@ -171,7 +174,6 @@ _PropertiesFilterOutput( ); } // fi - */ } // eof - $RCSfile$ diff --git a/appli/PipelineEditor/PipelineEditor.ui b/appli/PipelineEditor/PipelineEditor.ui index 4a3e330..3b92d74 100644 --- a/appli/PipelineEditor/PipelineEditor.ui +++ b/appli/PipelineEditor/PipelineEditor.ui @@ -162,7 +162,7 @@ 0 0 800 - 27 + 22 @@ -180,7 +180,21 @@ + + + &View + + + + Backgrounds + + + + + + + @@ -198,6 +212,16 @@ E&xit + + + MPR + + + + + 3D + + diff --git a/lib/cpExtensions/QT/SimpleMPRWidget.cxx b/lib/cpExtensions/QT/SimpleMPRWidget.cxx index 73f3b76..0cede9d 100644 --- a/lib/cpExtensions/QT/SimpleMPRWidget.cxx +++ b/lib/cpExtensions/QT/SimpleMPRWidget.cxx @@ -149,6 +149,17 @@ GetInteractor( unsigned int i ) return( NULL ); } +// ------------------------------------------------------------------------- +vtkActor* cpExtensions::QT::SimpleMPRWidget:: +GetActor( vtkPolyData* mesh ) +{ + auto i = this->m_PolyDatas.find( mesh ); + if( i != this->m_PolyDatas.end( ) ) + return( i->second.Actor.GetPointer( ) ); + else + return( NULL ); +} + // ------------------------------------------------------------------------- void cpExtensions::QT::SimpleMPRWidget:: _SyncBottom( int a, int b ) diff --git a/lib/cpExtensions/QT/SimpleMPRWidget.h b/lib/cpExtensions/QT/SimpleMPRWidget.h index 149abb8..f6d90f0 100644 --- a/lib/cpExtensions/QT/SimpleMPRWidget.h +++ b/lib/cpExtensions/QT/SimpleMPRWidget.h @@ -101,6 +101,8 @@ namespace cpExtensions // Visual objects vtkRenderWindowInteractor* GetInteractor( unsigned int i ); + vtkActor* GetActor( vtkPolyData* mesh ); + private slots: void _SyncBottom( int a, int b ); void _SyncTop( int a, int b ); -- 2.47.1