]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/QT/ConfigurationChooser.cxx
yet another refactoring
[cpPlugins.git] / lib / cpExtensions / QT / ConfigurationChooser.cxx
diff --git a/lib/cpExtensions/QT/ConfigurationChooser.cxx b/lib/cpExtensions/QT/ConfigurationChooser.cxx
new file mode 100644 (file)
index 0000000..00c121b
--- /dev/null
@@ -0,0 +1,51 @@
+#include <cpExtensions/QT/ConfigurationChooser.h>
+#include <cpExtensions/QT/ui_ConfigurationChooser.h>
+#include <cpExtensions/QT/ActorsWidgetInterface.h>
+#include <cpExtensions/QT/WindowLevelImageConfiguration.h>
+
+// -------------------------------------------------------------------------
+cpExtensions::QT::ConfigurationChooser::
+ConfigurationChooser( QWidget* parent, Qt::WindowFlags f )
+  : Superclass( parent, f ),
+    m_UI( new Ui::ConfigurationChooser ),
+    m_Data( NULL )
+{
+  this->m_UI->setupUi( this );
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::QT::ConfigurationChooser::
+~ConfigurationChooser( )
+{
+  delete this->m_UI;
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::ConfigurationChooser::
+setData( ActorsWidgetInterface* data )
+{
+  this->m_Data = data;
+  if( this->m_Data != NULL )
+  {
+    auto actors = this->m_Data->GetActorsNames( );
+    for( auto n = actors.begin( ); n != actors.end( ); ++n )
+    {
+      if( this->m_Data->IsWindowLevelImageActor( *n ) )
+      {
+        auto wl_wdg = new WindowLevelImageConfiguration( this );
+        wl_wdg->setData( data, *n );
+        this->m_UI->Configurations->addTab( wl_wdg, n->c_str( ) );
+      }
+      else if( this->m_Data->IsLUTImageActor( *n ) )
+      {
+      }
+      else if( this->m_Data->Is3DActor( *n ) )
+      {
+      } // fi
+
+    } // rof
+
+  } // fi
+}
+
+// eof - $RCSfile$