]> Creatis software - cpPlugins.git/commitdiff
...
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Fri, 20 May 2016 22:59:49 +0000 (17:59 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Fri, 20 May 2016 22:59:49 +0000 (17:59 -0500)
appli/PipelineEditor/PipelineEditor.cxx
appli/PipelineEditor/PipelineEditor.ui
lib/cpExtensions/QT/SimpleMPRWidget.cxx
lib/cpExtensions/QT/SimpleMPRWidget.h

index 0f2d3fde2d6d5cf1efc60b1010b0f7ce59f01a2e..b61cd14cbc5155b9c2e830ac8b5a6b216893d3af 100644 (file)
@@ -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$
index 4a3e33008fb2a87186de75f91b44a6a919812bd9..3b92d742d7848825f2b0b3694a332f72f66b18bd 100644 (file)
      <x>0</x>
      <y>0</y>
      <width>800</width>
-     <height>27</height>
+     <height>22</height>
     </rect>
    </property>
    <widget class="QMenu" name="MenuFile">
     <addaction name="separator"/>
     <addaction name="ActionExit"/>
    </widget>
+   <widget class="QMenu" name="menu_View">
+    <property name="title">
+     <string>&amp;View</string>
+    </property>
+    <widget class="QMenu" name="menuBackgrounds">
+     <property name="title">
+      <string>Backgrounds</string>
+     </property>
+     <addaction name="ActionBackground3D"/>
+     <addaction name="ActionBackgroundMPR"/>
+    </widget>
+    <addaction name="menuBackgrounds"/>
+   </widget>
    <addaction name="MenuFile"/>
+   <addaction name="menu_View"/>
   </widget>
   <widget class="QStatusBar" name="statusbar"/>
   <action name="ActionOpenWorkspace">
     <string>E&amp;xit</string>
    </property>
   </action>
+  <action name="ActionBackgroundMPR">
+   <property name="text">
+    <string>MPR</string>
+   </property>
+  </action>
+  <action name="ActionBackground3D">
+   <property name="text">
+    <string>3D</string>
+   </property>
+  </action>
  </widget>
  <customwidgets>
   <customwidget>
index 73f3b76feb8584cba21d46915e7ab5ad6b47bc2e..0cede9d8e5f167a3207e92f922efe738561faea5 100644 (file)
@@ -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 )
index 149abb84184b45e28172178971a8e7b26fc4cae7..f6d90f094aba7120ba7d29370eb2fbb1a071b38e 100644 (file)
@@ -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 );