00001
00002
00003
00004
00005 #ifndef BALL_VIEW_DIALOGS_DOCKDIALOG_H
00006 #define BALL_VIEW_DIALOGS_DOCKDIALOG_H
00007
00008 #ifndef BALL_COMMON_GLOBAL_H
00009 # include <BALL/COMMON/global.h>
00010 #endif
00011
00012 #ifndef BALL_VIEW_KERNEL_PREFERENCESENTRY_H
00013 # include <BALL/VIEW/KERNEL/preferencesEntry.h>
00014 #endif
00015
00016 #ifndef BALL_MOLMEC_COMMON_RADIUSRULEPROCESSOR_H
00017 # include <BALL/MOLMEC/COMMON/radiusRuleProcessor.h>
00018 #endif
00019
00020 #ifndef BALL_MOLMEC_COMMON_CHARGERULEPROCESSOR_H
00021 # include <BALL/MOLMEC/COMMON/chargeRuleProcessor.h>
00022 #endif
00023
00024 #ifndef BALL_STRUCTURE_DEFAULTPROCESSORS_H
00025 # include <BALL/STRUCTURE/defaultProcessors.h>
00026 #endif
00027
00028 #ifndef BALL_DATATYPE_OPTIONS_H
00029 # include <BALL/DATATYPE/options.h>
00030 #endif
00031
00032 #ifdef BALL_COMPILER_MSVC
00033 # include <BALL/VIEW/UIC/ui_dockDialog.h>
00034 #else
00035 # include <BALL/VIEW/UIC/dockDialogData.h>
00036 #endif
00037
00038
00039 namespace BALL
00040 {
00041 class INIFile;
00042 class System;
00043 class Options;
00044
00045 namespace VIEW
00046 {
00047 class DockingController;
00048
00049
00056 class BALL_VIEW_EXPORT DockDialog :
00057 public QDialog,
00058 public Ui_DockDialogData,
00059 public PreferencesEntry
00060 {
00061 Q_OBJECT
00062
00063 public:
00064
00068
00079 DockDialog(QWidget* parent = 0, const char* name = "DockDialog");
00080
00083 virtual ~DockDialog();
00085
00089
00092 const DockDialog& operator =(const DockDialog& dock_dialog);
00094
00098
00103 void setSystems(System* system1, System* system2);
00104
00107 System* getSystem1();
00108
00111 System* getSystem2();
00112
00115 Options& getAlgorithmOptions();
00116
00119 Options& getScoringOptions();
00120
00123 void isRedock(bool is_redock);
00124
00130
00131 void addAlgorithm(const QString& name, const int algorithm, QDialog* dialog);
00132
00138
00139 void addScoringFunction(const QString& name, const int score_func, QDialog* dialog=0);
00140
00147 virtual void initializeWidget();
00148
00155 virtual void fetchPreferences(INIFile& file);
00156
00162 virtual void writePreferences(INIFile& file);
00163
00164
00167 void reset();
00169
00170 public slots:
00171
00176 bool exec();
00177
00181 void resetPressed();
00182
00188 void okPressed();
00189
00193 void cancelPressed();
00194
00198 void algAdvancedPressed();
00199
00203 void scoringAdvancedPressed();
00204
00208 void partner1Chosen();
00209
00213 void partner2Chosen();
00214
00218 void scoringFuncChosen();
00219
00223 void algorithmChosen();
00224
00228 void browseChargesData();
00229
00233 void browseChargesRules();
00234
00238 void browseRadiiData();
00239
00243 void browseRadiiRules();
00244
00245
00246 protected:
00247
00251 void applyValues_();
00252
00255 bool applyProcessors_();
00256
00259 void selectFile_(QLineEdit& lineedit);
00260
00264 void fillSystemComboboxes_();
00265
00273 void fetchPreferences_(INIFile& file, const String& entry, const QString& default_value);
00274
00279 void swapValues_();
00280
00281
00282 private:
00283
00288 DockDialog(const DockDialog& dock_dialog);
00289
00292 bool is_redock_;
00293
00298 bool has_changed_;
00299
00303 HashMap<int, QDialog*> algorithm_dialogs_;
00304
00308 HashMap<int, QDialog*> scoring_dialogs_;
00309
00313 HashMap<int, vector<int> > allowed_sf_;
00314
00317 vector<System*> loaded_systems_;
00318
00321 System* docking_partner1_;
00322
00325 System* docking_partner2_;
00326
00329 Options algorithm_opt_, scoring_opt_;
00330
00336 vector<QString> backup_;
00337
00340 RadiusRuleProcessor radius_rule_processor_;
00341 ChargeRuleProcessor charge_rule_processor_;
00342 AssignRadiusProcessor radius_processor_;
00343 AssignChargeProcessor charge_processor_;
00344 };
00345
00346 }
00347 }
00348 #endif