BALL  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Slots | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
BALL::VIEW::DockDialog Class Reference

#include <BALL/VIEW/DIALOGS/dockDialog.h>

Inheritance diagram for BALL::VIEW::DockDialog:
QDialog BALL::VIEW::PreferencesEntry

Public Slots

bool exec ()
 
void resetPressed ()
 
void okPressed ()
 
void cancelPressed ()
 
void algAdvancedPressed ()
 
void scoringAdvancedPressed ()
 
void partner1Chosen ()
 
void partner2Chosen ()
 
void scoringFuncChosen ()
 
void algorithmChosen ()
 
void browseChargesData ()
 
void browseChargesRules ()
 
void browseRadiiData ()
 
void browseRadiiRules ()
 

Public Member Functions

Constructors and Destructors
 DockDialog (QWidget *parent=0, const char *name="DockDialog")
 
virtual ~DockDialog ()
 
Assignment
const DockDialogoperator= (const DockDialog &dock_dialog)
 
Accessors: inspectors and mutators
void setSystems (System *system1, System *system2)
 
SystemgetSystem1 ()
 
SystemgetSystem2 ()
 
OptionsgetAlgorithmOptions ()
 
OptionsgetScoringOptions ()
 
void isRedock (bool is_redock)
 
void addAlgorithm (const QString &name, const int algorithm, QDialog *dialog)
 
void addScoringFunction (const QString &name, const int score_func, QDialog *dialog=0)
 
virtual void initializeWidget ()
 
virtual void fetchPreferences (INIFile &file)
 
virtual void writePreferences (INIFile &file)
 
void reset ()
 
- Public Member Functions inherited from BALL::VIEW::PreferencesEntry
 PreferencesEntry ()
 
virtual ~PreferencesEntry ()
 
virtual void writePreferenceEntries (INIFile &inifile)
 Store the settings of all registered objects. More...
 
virtual void readPreferenceEntries (const INIFile &inifile)
 Restore the settings of all registered objects. More...
 
void setINIFileSectionName (const String &name)
 Set the name for the section in the INIFile. More...
 
const StringgetINIFileSectionName () const
 Get the name for the section in the INIFile. More...
 
void setWidgetStackName (const String &name)
 
StackPagesgetStackPages ()
 Return all pages, that are to be shown in a parent QStackedWidget. More...
 
void setWidgetStack (QStackedWidget *stack)
 
virtual void showStackPage (Position nr)
 Show the specified page in the QStackedWidget. More...
 
virtual void showStackPage (QWidget *widget)
 Show the specified page in the QStackedWidget. More...
 
virtual Position currentStackPage () const
 Get the currently shown page in the QStackedWidget. More...
 
virtual void restoreDefaultValues (bool all=false)
 Set all registered objects to their default values. More...
 
virtual void storeValues ()
 
virtual void restoreValues (bool all=false)
 
virtual void dump (std::ostream &s=std::cout, Size depth=0) const
 

Protected Member Functions

void applyValues_ ()
 
bool applyProcessors_ ()
 
void selectFile_ (QLineEdit &lineedit)
 
void fillSystemComboboxes_ ()
 
void fetchPreferences_ (INIFile &file, const String &entry, const QString &default_value)
 
void swapValues_ ()
 
- Protected Member Functions inherited from BALL::VIEW::PreferencesEntry
void registerWidgets_ ()
 
void registerObject_ (QObject *widget)
 
void unregisterObject_ (QObject *widget)
 
void registerWidgetForHelpSystem_ (const QWidget *widget, const String &url)
 
void restoreValues_ (bool all, const ValueMap &map)
 
void insertStackEntry_ (QWidget *, const String &name)
 
bool isSupported_ (QObject &widget)
 
bool getValue_ (const QObject *widget, String &value)
 
bool setValue_ (QObject *widget, const String &value)
 

Private Member Functions

 DockDialog (const DockDialog &dock_dialog)
 

Private Attributes

bool is_redock_
 
bool has_changed_
 
HashMap< int, QDialog * > algorithm_dialogs_
 
HashMap< int, QDialog * > scoring_dialogs_
 
HashMap< int, vector< int > > allowed_sf_
 
vector< System * > loaded_systems_
 
Systemdocking_partner1_
 
Systemdocking_partner2_
 
Options algorithm_opt_
 
Options scoring_opt_
 
vector< QString > backup_
 
RadiusRuleProcessor radius_rule_processor_
 
ChargeRuleProcessor charge_rule_processor_
 
AssignRadiusProcessor radius_processor_
 
AssignChargeProcessor charge_processor_
 

Additional Inherited Members

- Public Types inherited from BALL::VIEW::PreferencesEntry
typedef std::list< std::pair
< QWidget *, String > > 
StackPages
 
- Protected Types inherited from BALL::VIEW::PreferencesEntry
typedef HashMap< const QObject
*, String
ValueMap
 
- Protected Attributes inherited from BALL::VIEW::PreferencesEntry
String inifile_section_name_
 
HashSet< QObject * > registered_objects_
 
ValueMap default_values_
 
ValueMap last_values_
 
QStackedWidget * widget_stack_
 
StackPages stack_pages_
 

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.

Definition at line 52 of file dockDialog.h.

Constructor & Destructor Documentation

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

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

Parameters
parentthe parent widget of the DockDialog
namethe name of the DockDialog
modalthe modal flag
flthe widget flags
See Also
QDialog
PreferncesEntry
virtual BALL::VIEW::DockDialog::~DockDialog ( )
virtual

Destructor.

BALL::VIEW::DockDialog::DockDialog ( const DockDialog dock_dialog)
private

Copy constructor. Remark: Copy contructor is private because it is not completed. The copy constuctor of the QT widgets is private and cannot be called.

Member Function Documentation

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

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

Parameters
namethe name of the algorithm
algorithmthe value of enum DockingController::Algorithm
dialogpointer to an advanced option dialog
void BALL::VIEW::DockDialog::addScoringFunction ( const QString &  name,
const int  score_func,
QDialog dialog = 0 
)

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

Parameters
namethe name of the scoring function
score_functhe value of enum DockingController::ScoringFunction
dialogpointer to an advanced option dialog
void BALL::VIEW::DockDialog::algAdvancedPressed ( )
slot

Is called when advanced button for algorithm options is pressed. Shows corresponding options dialog.

void BALL::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 BALL::VIEW::DockDialog::applyProcessors_ ( )
protected

Applies processors to the systems.

void BALL::VIEW::DockDialog::applyValues_ ( )
protected

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

void BALL::VIEW::DockDialog::browseChargesData ( )
slot

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

void BALL::VIEW::DockDialog::browseChargesRules ( )
slot

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

void BALL::VIEW::DockDialog::browseRadiiData ( )
slot

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

void BALL::VIEW::DockDialog::browseRadiiRules ( )
slot

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

void BALL::VIEW::DockDialog::cancelPressed ( )
slot

Is called when cancel button is pressed. Hides the dialog.

bool BALL::VIEW::DockDialog::exec ( )
slot

Shows and raises the dialog. Dialog is adapted for docking / redocking. Calls fillSystemComboboxes_ in case of docking.

virtual void BALL::VIEW::DockDialog::fetchPreferences ( INIFile file)
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 BALL::VIEW::DockDialog::fetchPreferences_ ( INIFile file,
const String entry,
const QString &  default_value 
)
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
filethe INIFile that is read
entrykey of entry that is read
default_valuedefault value
See Also
fetchPreferences
void BALL::VIEW::DockDialog::fillSystemComboboxes_ ( )
protected

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

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

Get algorithm options.

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

Get scoring options.

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

Get first docking partner.

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

Get second docking partner.

virtual void BALL::VIEW::DockDialog::initializeWidget ( )
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 BALL::VIEW::DockDialog::isRedock ( bool  is_redock)

Sets the flags is_redock_ and has_changed_ .

void BALL::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_ .

const DockDialog& BALL::VIEW::DockDialog::operator= ( const DockDialog dock_dialog)

Assignment operator

void BALL::VIEW::DockDialog::partner1Chosen ( )
slot

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

void BALL::VIEW::DockDialog::partner2Chosen ( )
slot

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

void BALL::VIEW::DockDialog::reset ( )

Resets the dialog to the standard values.

void BALL::VIEW::DockDialog::resetPressed ( )
slot

Is called when reset button is pressed. Calls reset .

void BALL::VIEW::DockDialog::scoringAdvancedPressed ( )
slot

Is called when advanced button for scoring function options is pressed. Shows corresponding options dialog, if it exits.

void BALL::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 BALL::VIEW::DockDialog::selectFile_ ( QLineEdit lineedit)
protected

Shows chosen file in the dialog.

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

Sets two systems as docking partners.

Parameters
system1first docking partner
system2second docking partner
void BALL::VIEW::DockDialog::swapValues_ ( )
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 BALL::VIEW::DockDialog::writePreferences ( INIFile file)
virtual

Writes the preferences to the INIFile. Calls PreferencesEntry::writePreferenceEntries . This method is called in DockingController::writePreferences .

See Also
fetchPreferences

Member Data Documentation

HashMap<int, QDialog*> BALL::VIEW::DockDialog::algorithm_dialogs_
private

key: DockingController::Algorithm value: advanced options dialog

Definition at line 299 of file dockDialog.h.

Options BALL::VIEW::DockDialog::algorithm_opt_
private

Options for the docking algorithm and scoring function

Definition at line 325 of file dockDialog.h.

HashMap<int, vector<int> > BALL::VIEW::DockDialog::allowed_sf_
private

key: DockingController::Algorithm value: vector of scoring functions which can be used with this algorithm

Definition at line 309 of file dockDialog.h.

vector<QString> BALL::VIEW::DockDialog::backup_
private

Needed to guarantee that both, docking and redocking preferences can be written to INIFile When we do docking, redocking values are in the vector and when we do redocking, the docking values are in there. In fetchPreferences , we read the last redocking values from INIFile in this vector and in writePreferences , we write the redocking values in INIFile from this vector

Definition at line 332 of file dockDialog.h.

AssignChargeProcessor BALL::VIEW::DockDialog::charge_processor_
private

Definition at line 339 of file dockDialog.h.

ChargeRuleProcessor BALL::VIEW::DockDialog::charge_rule_processor_
private

Definition at line 337 of file dockDialog.h.

System* BALL::VIEW::DockDialog::docking_partner1_
private

Pointer to docking partner 1

Definition at line 317 of file dockDialog.h.

System* BALL::VIEW::DockDialog::docking_partner2_
private

Pointer to docking partner 2

Definition at line 321 of file dockDialog.h.

bool BALL::VIEW::DockDialog::has_changed_
private

Flag: True if we do docking and did redocking before or otherwise. False if we do (re)docking and also did (re)docking before.

Definition at line 294 of file dockDialog.h.

bool BALL::VIEW::DockDialog::is_redock_
private

Flag which indicates if we do docking or redocking.

Definition at line 288 of file dockDialog.h.

vector<System*> BALL::VIEW::DockDialog::loaded_systems_
private

vector contains pointers to all systems that are loaded into BALLView

Definition at line 313 of file dockDialog.h.

AssignRadiusProcessor BALL::VIEW::DockDialog::radius_processor_
private

Definition at line 338 of file dockDialog.h.

RadiusRuleProcessor BALL::VIEW::DockDialog::radius_rule_processor_
private

Processors

Definition at line 336 of file dockDialog.h.

HashMap<int, QDialog*> BALL::VIEW::DockDialog::scoring_dialogs_
private

key: DockingController::ScoringFunction value: advanced options dialog

Definition at line 304 of file dockDialog.h.

Options BALL::VIEW::DockDialog::scoring_opt_
private

Definition at line 325 of file dockDialog.h.