algorithm_widget.h

Go to the documentation of this file.
00001 //--------------------------------------------------
00011 //---------------------------------------------------
00012 #ifndef IMEDGINEALGORITHM_WIDGET_H
00013 #define IMEDGINEALGORITHM_WIDGET_H
00014 
00015 #include "../global/global_definitions.h"
00016 #include "../algorithms/algorithm_definition.h"
00017 #include "../algorithms/algorithm_config.h"
00018 
00019 #include <QWidget>
00020 #include <vector>
00021 #include <utility>
00022 
00023 class QGridLayout;
00024 class QComboBox;
00025 class QSpacerItem;
00026 class QPushButton;
00027 class QLabel;
00028 
00029 namespace imedgine 
00030 {
00031   //--------------------------------------------------
00043   //--------------------------------------------------
00044 
00045   class AlgorithmWidget : public QWidget
00046   {
00047     Q_OBJECT
00048   public:
00049 
00050     //--------------------------------------------------
00056     AlgorithmWidget(algorithm_name_container_type list_of_algorithms, 
00057                     QWidget* parent = 0, Qt::WFlags f = 0);
00058 
00059     //--------------------------------------------------
00062 
00063     ~AlgorithmWidget();
00064     
00065   public slots:
00066 
00067     //--------------------------------------------------
00073     
00074     void okPressed();
00075     
00076     //--------------------------------------------------
00082     
00083     void datasetChanged(dataset_key_type const& dataset_name); 
00084   signals:
00085     
00086     //--------------------------------------------------
00094      
00095     void notifyNewDatasetGeneration(
00096       std::vector<std::pair<dataset_key_type, dataset_type> >
00097       const& dataset_keys_and_types);
00098 
00099   private slots:
00100 
00101     //--------------------------------------------------
00105     void algorithmChosen(const QString& chosen_algorithm);
00106 
00107     //--------------------------------------------------
00111     void inputDatasetSelected(const QString& selected_dataset);
00112 
00113     
00114   private:
00115 
00116     typedef std::map<std::string, InputDatasetAttributes> 
00117         dataset_name_to_attributes_map_type;
00118     typedef std::map<std::string, std::pair<dataset_key_type,dataset_part_type> > dropdown_value_to_dataset_info_map_type;
00119 
00120     //--------------------------------------------------
00123     
00124     void setupUi();
00125 
00126     //--------------------------------------------------
00129     
00130     void initializeConnections();
00131     
00132     //--------------------------------------------------
00137     
00138     void removeConfigurationThings();
00139 
00140     //--------------------------------------------------
00146 
00147     void addDatasetsToDropdown(QComboBox* box, std::string name);
00148 
00149 
00150     //--------------------------------------------------
00159     
00160     void setSliceTypeForVolumeType(dataset_type& volume_type);
00161 
00162     QGridLayout* base_layout_;
00163     QGridLayout* configuration_layout_;
00164     QGridLayout* selector_layout_;
00165     QGridLayout* configuration_widget_layout_;
00166     
00167     QComboBox* algorithm_selector_;
00168     QSpacerItem* spacer_item_;
00169     QPushButton* ok_button_;
00170     QPushButton* cancel_button_;
00171     ConfigWidget* config_widget_;
00172     
00173     AlgorithmDefinition::already_set_datasets_type already_set_datasets_;
00174     AlgorithmConfig::algorithm_definition_pointer_type definition_;
00175     
00176     std::vector<std::pair<QLabel*,QComboBox*> >label_with_drop_down_vector_;
00177     dataset_name_to_attributes_map_type input_dataset_attributes_;
00178     dropdown_value_to_dataset_info_map_type dataset_value_to_info_;
00179      
00180 
00181   };
00182 }
00183 
00184 #endif

Generated on Sun Aug 13 18:19:39 2006 for iMEDgine by  doxygen 1.4.6