00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision: -1 $ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 #ifndef QMITK_FUNCTIONALITYCOMPONENTCONTAINER_H 00019 #define QMITK_FUNCTIONALITYCOMPONENTCONTAINER_H 00020 00021 #include "QmitkBaseFunctionalityComponent.h" 00022 #include "QmitkExtExports.h" 00023 00024 #include <qwidget.h> 00025 #include <qstackedwidget.h> 00026 #include <qpushbutton.h> 00027 #include <qstring.h> 00028 #include <qobject.h> 00029 #include <mitkDataNode.h> 00030 #include <qlayout.h> 00031 #include <qlabel.h> 00032 #include "ui_QmitkFunctionalityComponentContainerControls.h" 00033 00034 #include <QmitkStdMultiWidget.h> 00035 00036 00037 00056 class QmitkExt_EXPORT QmitkFunctionalityComponentContainer : public QmitkBaseFunctionalityComponent 00057 { 00058 Q_OBJECT 00059 00060 public: 00061 00062 00063 00064 /*************** CONSTRUCTOR ***************/ 00066 QmitkFunctionalityComponentContainer(QObject *parent=0, const char * parentName = 0, bool updateSelector = true, bool showSelector = true); 00067 00068 /*************** DESTRUCTOR ***************/ 00070 virtual ~QmitkFunctionalityComponentContainer(); 00071 00072 /*************** CREATE ***************/ 00076 virtual void CreateConnections(); 00077 00081 virtual void CreateQtPartControl(QWidget *parent, mitk::DataStorage::Pointer dataStorage); 00082 00084 void CreateNavigationButtons(); 00085 00087 //void CreateWizardTextLabel(); 00088 00090 void SetWizardText(const QString & text); 00091 // 00093 //void ChooseWizardText(int page); 00094 00096 Ui::QmitkFunctionalityComponentContainerGUI* GetFunctionalityComponentContainerGUI(); 00097 00098 00099 00100 00101 /*************** SET AND GET ***************/ 00102 00104 virtual void SetDataStorage(mitk::DataStorage::Pointer dataStorage); 00105 00107 virtual mitk::DataStorage::Pointer GetDataStorage(); 00108 00110 virtual void SetComponentName(QString name); 00111 00113 virtual QString GetComponentName(); 00114 00116 QWidget* GetGUI(); 00117 00118 virtual QmitkDataStorageComboBox * GetTreeNodeSelector(); 00119 00121 virtual void SetSelectorVisibility(bool visibility); 00122 00123 QmitkStdMultiWidget * GetMultiWidget(); 00124 00126 virtual QGroupBox * GetContentContainer(); 00127 00129 virtual QGroupBox * GetMainCheckBoxContainer(); 00130 00132 virtual void SetShowTreeNodeSelector(bool show); 00133 00134 00136 virtual QGroupBox* GetImageContent(); 00137 00138 00140 virtual mitk::Image* GetParentMitkImage(); 00141 00143 QPushButton* GetNextButton(); 00144 00146 QPushButton* GetBackButton(); 00147 00148 /*************** ADD COMPONENTS ***************/ 00149 00151 virtual void AddComponent(QmitkFunctionalityComponentContainer* componentContainer); 00152 00154 virtual void AddComponent(QmitkFunctionalityComponentContainer* componentContainer, QString label, int stackPage); 00155 00156 /*************** TREE CHANGED ( ) ***************/ 00157 virtual void TreeChanged(const itk::EventObject & treeChangedEvent); 00158 00159 00160 /*************** (DE)ACTIVATED ***************/ 00161 00163 virtual void Activated(); 00164 00166 virtual void Deactivated(); 00167 00169 bool m_UpdateSelector; 00170 00172 bool m_ShowSelector; 00173 00175 void ImageSelected(const mitk::DataNode* item); 00176 00177 protected slots: 00178 00179 00180 public slots: 00181 00183 virtual void SetContentContainerVisibility(bool); 00184 00185 /*************** TREE CHANGED ( ) ***************/ 00186 // /** \brief The TreeChanged-slot-method updates the TreeNodeSelector if the datatree changes. */ 00187 virtual void TreeChanged(); 00188 00189 /*************** OHTER METHODS ***************/ 00190 virtual void DataStorageChanged(mitk::DataStorage::Pointer ds); 00191 00192 00193 00194 //void NextButtonPressed(); 00195 //void BackButtonPressed(); 00196 00197 protected: 00198 00200 //std::vector<std::list<QmitkBaseFunctionalityComponent*>> m_WidgetStackAddedChildList; 00201 00203 virtual void UpdateDataTreeComboBoxes(); 00204 00205 /*************** ATTRIBUTES ***************/ 00207 unsigned long m_ObserverTag; 00208 00210 QWidget* m_GUI; 00211 00212 // /*! 00213 //* image selected in MainSelector 00214 //*/ 00215 //mitk::Image* m_ParentMitkImage; 00216 00217 00219 //* iterator on current image 00220 //*/ 00221 //mitk::DataTreeIteratorClone m_ParentMitkImageIterator; 00222 00224 bool m_Active; 00225 00227 QmitkDataStorageComboBox * m_SelectedItem; 00228 00230 mitk::DataStorage::Pointer m_DataStorage; 00231 00232 00233 private: 00234 00235 /*************** ATTRIBUTES ***************/ 00237 Ui::QmitkFunctionalityComponentContainerGUI * m_FunctionalityComponentContainerGUI; 00238 00239 00241 QObject *m_Parent; 00242 00244 QString m_ComponentName; 00245 00246 // QmitkStdMultiWidget * m_MultiWidget; 00247 // QmitkFunctionalityComponentContainerGUI * m_GUI; 00248 00250 QSpacerItem* m_Spacer; 00251 00252 QmitkStdMultiWidget *m_MulitWidget; 00253 00254 QPushButton* m_BackButton; 00255 QPushButton* m_NextButton; 00256 int m_MaximumWidgedStackSize; 00257 }; 00258 00259 #endif 00260