Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

VIEW::DockDialog Class Reference
[QT Dialogs]

Dialog for docking / redocking two systems. More...

#include <dockDialog.h>

Inheritance diagram for VIEW::DockDialog:

VIEW::PreferencesEntry List of all members.

Public Slots

bool exec ()
 Shows and raises the dialog.
void resetPressed ()
 Is called when reset button is pressed.
void okPressed ()
 Is called when OK button is pressed.
void cancelPressed ()
 Is called when cancel button is pressed.
void algAdvancedPressed ()
 Is called when advanced button for algorithm options is pressed.
void scoringAdvancedPressed ()
 Is called when advanced button for scoring function options is pressed.
void partner1Chosen ()
 Is called when a system in the combobox is chosen as docking partner 1.
void partner2Chosen ()
 Is called when a system in the combobox is chosen as docking partner 2.
void scoringFuncChosen ()
 Is called when a scoring function in the combobox is chosen.
void algorithmChosen ()
 Is called when an algorithm in the combobox is chosen.
void browseChargesData ()
 Is called when browse button to get a charges config file from table is pressed.
void browseChargesRules ()
 Is called when browse button to get a charges config file by rules is pressed.
void browseRadiiData ()
 Is called when browse button to get a radii config file from table is pressed.
void browseRadiiRules ()
 Is called when browse button to get a radii config file by rules s pressed.

Public Member Functions

Constructors and Destructors
 DockDialog (QWidget *parent=0, const char *name="DockDialog") throw ()
 Default Constructor.
virtual ~DockDialog () throw ()
 Destructor.
Assignment
const DockDialogoperator= (const DockDialog &dock_dialog) throw ()
 Assignment operator.
Accessors: inspectors and mutators
void setSystems (System *system1, System *system2) throw ()
 Sets two systems as docking partners.
SystemgetSystem1 () throw ()
 Get first docking partner.
SystemgetSystem2 () throw ()
 Get second docking partner.
OptionsgetAlgorithmOptions () throw ()
 Get algorithm options.
OptionsgetScoringOptions () throw ()
 Get scoring options.
void isRedock (bool is_redock) throw ()
 Sets the flags is_redock_ and has_changed_ .
void addAlgorithm (const QString &name, const int algorithm, QDialog *dialog) throw ()
 Adds docking algorithm to combobox and its advanced option dialog to hashmap.
void addScoringFunction (const QString &name, const int score_func, QDialog *dialog=0) throw ()
 Adds scoring function to combobox and its advanced option dialog to hashmap, if it has such a dialog.
virtual void initializeWidget () throw ()
 Builds hashmaps for algorithm advanced option dialogs and for scoring function advanced option dialogs.
virtual void fetchPreferences (INIFile &file) throw ()
 Fetchs the preferences from the INIFile.
virtual void writePreferences (INIFile &file) throw ()
 Writes the preferences to the INIFile.
void reset () throw ()
 Resets the dialog to the standard values.

Protected Member Functions

void applyValues_ () throw ()
 Sets options algorithm_opt_ and scoring_opt_ with values the user has chosen.
bool applyProcessors_ () throw ()
 Applies processors to the systems.
void selectFile_ (QLineEdit &lineedit) throw ()
 Shows chosen file in the dialog.
void fillSystemComboboxes_ () throw ()
 Fills the system comboboxes.
void fetchPreferences_ (INIFile &file, const String &entry, const QString &default_value) throw ()
 Reads the redocking values from INIFile into vector backup_.
void swapValues_ () throw ()
 Swaps the option values between vector backup_ and dialog.

Detailed Description

Dialog for docking / redocking two systems.

In this dialog the user choose the two docking partners, the docking algorithm and the scoring function. Furthermore he can set the options for the algorithm and scroing function and can apply processors to the docking parnters. For redocking he can specify the euler angles.


Constructor & Destructor Documentation

VIEW::DockDialog::DockDialog QWidget *  parent = 0,
const char *  name = "DockDialog"
throw ()
 

Default Constructor.

Calls PreferencesEntry::registerObject_ . Sets flag is_redock_ to false.

Parameters:
parent the parent widget of the DockDialog
name the name of the DockDialog
modal the modal flag
fl the widget flags
See also:
QDialog

PreferncesEntry

virtual VIEW::DockDialog::~DockDialog  )  throw () [virtual]
 

Destructor.


Member Function Documentation

void VIEW::DockDialog::addAlgorithm const QString &  name,
const int  algorithm,
QDialog *  dialog
throw ()
 

Adds docking algorithm to combobox and its advanced option dialog to hashmap.

Parameters:
name the name of the algorithm
algorithm the value of enum DockingController::Algorithm
dialog pointer to an advanced option dialog

void VIEW::DockDialog::addScoringFunction const QString &  name,
const int  score_func,
QDialog *  dialog = 0
throw ()
 

Adds scoring function to combobox and its advanced option dialog to hashmap, if it has such a dialog.

Parameters:
name the name of the scoring function
score_func the value of enum DockingController::ScoringFunction
dialog pointer to an advanced option dialog

void VIEW::DockDialog::algAdvancedPressed  )  [slot]
 

Is called when advanced button for algorithm options is pressed.

Shows corresponding options dialog.

void VIEW::DockDialog::algorithmChosen  )  [slot]
 

Is called when an algorithm in the combobox is chosen.

If the chosen algorithm has advanced options, the advanced_button will be enabled.

bool VIEW::DockDialog::applyProcessors_  )  throw () [protected]
 

Applies processors to the systems.

void VIEW::DockDialog::applyValues_  )  throw () [protected]
 

Sets options algorithm_opt_ and scoring_opt_ with values the user has chosen.

void VIEW::DockDialog::browseChargesData  )  [slot]
 

Is called when browse button to get a charges config file from table is pressed.

Calls selectFile_ .

void VIEW::DockDialog::browseChargesRules  )  [slot]
 

Is called when browse button to get a charges config file by rules is pressed.

Calls selectFile_ .

void VIEW::DockDialog::browseRadiiData  )  [slot]
 

Is called when browse button to get a radii config file from table is pressed.

Calls selectFile_ .

void VIEW::DockDialog::browseRadiiRules  )  [slot]
 

Is called when browse button to get a radii config file by rules s pressed.

Calls selectFile_ .

void VIEW::DockDialog::cancelPressed  )  [slot]
 

Is called when cancel button is pressed.

Hides the dialog.

bool VIEW::DockDialog::exec  )  [slot]
 

Shows and raises the dialog.

Dialog is adapted for docking / redocking. Calls fillSystemComboboxes_ in case of docking.

virtual void VIEW::DockDialog::fetchPreferences INIFile file  )  throw () [virtual]
 

Fetchs the preferences from the INIFile.

Calls PreferencesEntry::readPreferenceEntries . Calls fetchPreferences_ to read the redocking options. This method is called in DockingController::fetchPreferences .

See also:
writePreferences

void VIEW::DockDialog::fetchPreferences_ INIFile file,
const String entry,
const QString &  default_value
throw () [protected]
 

Reads the redocking values from INIFile into vector backup_.

If INIFile has not yet a section REDOCKING , fill vector backup_ with default values.

Parameters:
file the INIFile that is read
entry key of entry that is read
default_value default value
See also:
fetchPreferences

void VIEW::DockDialog::fillSystemComboboxes_  )  throw () [protected]
 

Fills the system comboboxes.

If the user has already selected one or two systems, they are the current items in the comboboxes.

Options& VIEW::DockDialog::getAlgorithmOptions  )  throw ()
 

Get algorithm options.

Options& VIEW::DockDialog::getScoringOptions  )  throw ()
 

Get scoring options.

System* VIEW::DockDialog::getSystem1  )  throw ()
 

Get first docking partner.

System* VIEW::DockDialog::getSystem2  )  throw ()
 

Get second docking partner.

virtual void VIEW::DockDialog::initializeWidget  )  throw () [virtual]
 

Builds hashmaps for algorithm advanced option dialogs and for scoring function advanced option dialogs.

Also builds hashmap with the allowed scoring functions for the different algorithms. Is called by DockingController::initializeWidget .

See also:
addAlgorithm

addScoringFunction

void VIEW::DockDialog::isRedock bool  is_redock  )  throw ()
 

Sets the flags is_redock_ and has_changed_ .

void VIEW::DockDialog::okPressed  )  [slot]
 

Is called when OK button is pressed.

For docking, it checks if two different systems are chosen. Hides the dialog and calls applyValues_ and applyProcessors_ .

void VIEW::DockDialog::partner1Chosen  )  [slot]
 

Is called when a system in the combobox is chosen as docking partner 1.

Calls partnerChosen_ .

void VIEW::DockDialog::partner2Chosen  )  [slot]
 

Is called when a system in the combobox is chosen as docking partner 2.

Calls partnerChosen_ .

void VIEW::DockDialog::reset  )  throw ()
 

Resets the dialog to the standard values.

void VIEW::DockDialog::resetPressed  )  [slot]
 

Is called when reset button is pressed.

Calls reset .

void VIEW::DockDialog::scoringAdvancedPressed  )  [slot]
 

Is called when advanced button for scoring function options is pressed.

Shows corresponding options dialog, if it exits.

void VIEW::DockDialog::scoringFuncChosen  )  [slot]
 

Is called when a scoring function in the combobox is chosen.

If the chosen scoring function has advanced options, the advanced_button will be enabled.

void VIEW::DockDialog::selectFile_ QLineEdit &  lineedit  )  throw () [protected]
 

Shows chosen file in the dialog.

void VIEW::DockDialog::setSystems System system1,
System system2
throw ()
 

Sets two systems as docking partners.

Parameters:
system1 first docking partner
system2 second docking partner

void VIEW::DockDialog::swapValues_  )  throw () [protected]
 

Swaps the option values between vector backup_ and dialog.

Is called in show if has_changed_ is true and in writePreferences if is_redock_ is true

virtual void VIEW::DockDialog::writePreferences INIFile file  )  throw () [virtual]
 

Writes the preferences to the INIFile.

Calls PreferencesEntry::writePreferenceEntries . This method is called in DockingController::writePreferences .

See also:
fetchPreferences