BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
dockDialog.h
Go to the documentation of this file.
1 //
2 // -*- Mode: C++; tab-width: 2; -*-
3 // vi: set ts=2:
4 //
5 
6 #ifndef BALL_VIEW_DIALOGS_DOCKDIALOG_H
7 #define BALL_VIEW_DIALOGS_DOCKDIALOG_H
8 
9 #ifndef BALL_COMMON_GLOBAL_H
10 # include <BALL/COMMON/global.h>
11 #endif
12 
13 #ifndef BALL_VIEW_KERNEL_PREFERENCESENTRY_H
15 #endif
16 
17 #ifndef BALL_MOLMEC_COMMON_RADIUSRULEPROCESSOR_H
19 #endif
20 
21 #ifndef BALL_MOLMEC_COMMON_CHARGERULEPROCESSOR_H
23 #endif
24 
25 #ifndef BALL_STRUCTURE_DEFAULTPROCESSORS_H
27 #endif
28 
29 #ifndef BALL_DATATYPE_OPTIONS_H
30 # include <BALL/DATATYPE/options.h>
31 #endif
32 
33 #include <BALL/VIEW/UIC/ui_dockDialog.h>
34 
35 namespace BALL
36 {
37  class INIFile;
38  class System;
39  class Options;
40 
41  namespace VIEW
42  {
43  class DockingController;
44 
45 
53  public QDialog,
54  public Ui_DockDialogData,
55  public PreferencesEntry
56  {
57  Q_OBJECT
58 
59  public:
60 
64 
75  DockDialog(QWidget* parent = 0, const char* name = "DockDialog");
76 
79  virtual ~DockDialog();
81 
85 
88  const DockDialog& operator =(const DockDialog& dock_dialog);
90 
94 
99  void setSystems(System* system1, System* system2);
100 
103  System* getSystem1();
104 
107  System* getSystem2();
108 
111  Options& getAlgorithmOptions();
112 
115  Options& getScoringOptions();
116 
119  void isRedock(bool is_redock);
120 
126  // remark: score_func isn't enum type because we then have cyclic includes of DockDialog and DockingController
127  void addAlgorithm(const QString& name, const int algorithm, QDialog* dialog);
128 
134  // remark: score_func isn't enum type because we then have cyclic includes of DockDialog and DockingController
135  void addScoringFunction(const QString& name, const int score_func, QDialog* dialog=0);
136 
143  virtual void initializeWidget();
144 
151  virtual void fetchPreferences(INIFile& file);
152 
158  virtual void writePreferences(INIFile& file);
159 
160 
163  void reset();
165 
166  public slots:
167 
172  bool exec();
173 
177  void resetPressed();
178 
184  void okPressed();
185 
189  void cancelPressed();
190 
194  void algAdvancedPressed();
195 
199  void scoringAdvancedPressed();
200 
204  void partner1Chosen();
205 
209  void partner2Chosen();
210 
214  void scoringFuncChosen();
215 
219  void algorithmChosen();
220 
224  void browseChargesData();
225 
229  void browseChargesRules();
230 
234  void browseRadiiData();
235 
239  void browseRadiiRules();
240 
241 
242  protected:
243 
247  void applyValues_();
248 
251  bool applyProcessors_();
252 
255  void selectFile_(QLineEdit& lineedit);
256 
260  void fillSystemComboboxes_();
261 
269  void fetchPreferences_(INIFile& file, const String& entry, const QString& default_value);
270 
275  void swapValues_();
276 
277 
278  private:
279 
284  DockDialog(const DockDialog& dock_dialog);
285 
288  bool is_redock_;
289 
294  bool has_changed_;
295 
299  HashMap<int, QDialog*> algorithm_dialogs_;
300 
304  HashMap<int, QDialog*> scoring_dialogs_;
305 
309  HashMap<int, vector<int> > allowed_sf_;
310 
313  vector<System*> loaded_systems_;
314 
317  System* docking_partner1_;
318 
321  System* docking_partner2_;
322 
325  Options algorithm_opt_, scoring_opt_;
326 
332  vector<QString> backup_;
333 
336  RadiusRuleProcessor radius_rule_processor_;
337  ChargeRuleProcessor charge_rule_processor_;
338  AssignRadiusProcessor radius_processor_;
339  AssignChargeProcessor charge_processor_;
340  };
341 
342  } // end of namespace View
343 } // end of namespace BALL
344 #endif
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52