RelaxBase Class Reference

#include <relaxbase.h>

List of all members.


Detailed Description

This class allows generation of an input file for the program Relax.

It provides the functionality to RelaxWidget.

Definition at line 43 of file relaxbase.h.

Public Types

enum  Input { AFF, MAFF }

Public Slots

void reset ()
 Resets all widgets to their default values.

Public Member Functions

 RelaxBase (AtomSet *atomset, QWidget *parent=0, const char *name=0, bool modal=FALSE, WFlags fl=0)
 ~RelaxBase ()
 The default destructor.
void setName (const QString name)
 Sets the filename prefix of the calculation.
void setDescription (const QString description)
 Sets the description of the calculation.
void setDir (const QString dir)
 Sets the directory of the calculation.
void setExtendedFormat (const bool state)
 Sets the format of the coordinates (normal/extended).
unsigned int inputGenerationFrequency ()
 Returns the frequency with which the internal coordinates should be regenerated.
unsigned int maxSteps ()
 Returns the maximum number of optimization steps to be done.
void scaleFactors (vector< unsigned int > &steps, vector< double > &factors)
 Returns the scalefactors.
QStringList generateInput (const Input type)
 Generates input for a specific program.
void loadCML (const QDomElement *root)
 Reads the widgetdata from a QDomElement.
void saveCML (QDomElement *root)
 Saves the widgetdata to a QDomElement.

Protected Slots

void accept ()
 Overridden from RelaxWidget::accept().
void reject ()
 Overridden from RelaxWidget::reject().

Protected Member Functions

void showEvent (QShowEvent *e)
 Overridden from RelaxWidget::showEvent().

Private Types

enum  Categories {
  BASIC = 0, INTERNAL = 1, CARTESIAN = 2, ADVANCED = 3,
  DEBUG1 = 4, EXTRA = 5, CARTESIAN_SYMMETRY = 6, CARTESIAN_OTHER = 7,
  ADVANCED_THRESHOLDS = 8, ADVANCED_OTHER = 9
}
enum  Type { PreviewAFF, ICListAFF }

Private Slots

void showPreview ()
 Shows a preview from the widgets.
void showPreview2 ()
 Shows a preview from the widgets.
void readInputFile ()
 Reads a Relax AFF file into the widgets.
void setChanged (bool state=true)
 Sets the 'changed' property of the widget.
void selectWidget (QListViewItem *)
 Shows a widget from WidgetStackCategory depending on newItem.
void enableAutogenWidgets ()
 Enabled/disables the widgets for configuring the (re)generation of the internal coordinates.
void enableSFACWidgets (bool state=true)
 Enabled/disables the widgets for configuring the scale factor depending on RadioButtonSFAC{1|2}.
void newScaleFactor ()
 Adds a new scale factor to the list.
void deleteScaleFactor ()
 Deletes the currently selected scale factor from the list.
void updateICEdit ()
 Updates the widgets for changing an IC with the contents of the currently selected IC in ListViewIC.
void updateICList ()
 Updates ListViewIC with the contents of the widgets for changing an IC.
void updateICSpecifics ()
 Updates the widgets for the specific data.
void updateICType ()
 Does the necessary updating of all parts of an internal.
void newIC ()
 Creates a new internal coordinate at the bottom of ListViewIC.
void newICPart ()
 Creates a new part of an internal coordinate.
void deleteIC ()
 Deletes the currently selected internal coordinate.
void clearIC ()
 Deletes all internal coordinates.
void genIC ()
 Fills the internal coordinates list with (non)redundant internal coordinates.
void genIC2 ()
 Fills the internal coordinates list with (non)redundant internal coordinates.
void moveICUp ()
 Moves the selected internal coordinate one place up in the list.
void moveICDown ()
 Moves the selected internal coordinate one place down in the list.
void newFixedAtom ()
 Adds a new atom to the list of fixed atoms.
void deleteFixedAtom ()
 Deletes the selected atom from the list of fixed atoms.
void checkFIXABoxes ()
 Makes sure at least 1 box stays checked for the fixed atoms.
void enableTROTWidgets (bool state=true)
 Enables/disables the widgets for configuring the optimization of the external coordinates depending on CheckBoxTROT.
void newExtraBond ()
 Adds a new bond to the XBON list.
void deleteExtraBond ()
 Deletes the selected bond from the XBON list.
void enableUPDTWidgets (bool state=true)
 Enables/disables the widgets for configuring the update of the force constants depending on CheckBoxUPDT.
void enableSHRTWidgets (bool state=true)
 Enables/disables the widgets for configuring the short output depending on CheckBoxSHRT.
void checkOverflow (int row, int col)
 Spans cell(row, col) over multiple columns if it contains more than 10 characters.
void addExtraRow ()
 If a row is selected, inserts a row before the selection.
void removeExtraRow ()
 Removes the selected rows.
void clearSelection ()
 Clears the selected cells.

Private Member Functions

void makeConnections ()
 Sets up the permanent connections. Called once from the constructor.
void init ()
 Initializes the dialog.
void saveWidgets ()
 Saves the status of the widgets to a data struct.
void restoreWidgets ()
 Restores the status of the widgets from a data struct.
QString icRepresentation (const unsigned int atom1, const unsigned int atom2, const unsigned int atom3=0, const int atom4=0)
 Returns a QString containing a representation of an internal coordinate from the 4 atom indices.
void getAtomsFromIC (const QString textIC, unsigned int &atom1, unsigned int &atom2, unsigned int &atom3, int &atom4)
 Returns the atom numbers from a textual representation of an internal coordinate.
void renumberICs ()
 Renumbers the internal coordinates.
QStringList generateAFFHeader ()
 Generates input for the first part of an .aff file.
QStringList generateBmatInput ()
 Generates input for Maff to generate non-redundant internal coordinates.
bool makeDirCurrent (const QString dir, const QString title)
 Makes dir the current directory.
void fillICListFromAFF (const QStringList aff)
 Adds the internal coordinates found in the latest generated aff to the IC list widget.
bool startMAFF (const unsigned int slot)
 Initiates the generation of an AFF file using MAFF.
QStringList readMAFFGeneratedICs ()
 Returns the internal coordinates generated by the latest MAFF run.

Private Attributes

WidgetData data
 Contains the status of all widgets.
AtomSetatoms
 Pointer to the AtomSet passed in through the constructor.
vector< QString > category
 Contains translatable names for the items in ListViewCategory.
bool widgetChanged
 = TRUE if the dialog has been changed and needs saving.
QString calcName
 Contains the filename prefix (maybe change to pointer to XbraboView QString.
QString calcDescription
 Contains the description.
QString calcDir
 Contains the directory.
bool calcXF
 = TRUE if the calculation is to be done in extended format.
QProcess * maffProcess
 The process for running MAFF.

Static Private Attributes

static const XMLData xml
 Contains the XML dictRef values for all WidgetData.

Classes

struct  ICData
 A utility struct containing all data to reconstruct an internal coordinate. More...
struct  WidgetData
 A struct representing the data from all widgets. More...
struct  XMLData
 A struct representing the XML dictRef values for all the data from WidgetData. More...


Member Enumeration Documentation

enum RelaxBase::Input
 

Enumerator:
AFF 
MAFF 

Definition at line 53 of file relaxbase.h.

enum RelaxBase::Categories [private]
 

Enumerator:
BASIC 
INTERNAL 
CARTESIAN 
ADVANCED 
DEBUG1 
EXTRA 
CARTESIAN_SYMMETRY 
CARTESIAN_OTHER 
ADVANCED_THRESHOLDS 
ADVANCED_OTHER 

Definition at line 126 of file relaxbase.h.

enum RelaxBase::Type [private]
 

Enumerator:
PreviewAFF 
ICListAFF 

Definition at line 129 of file relaxbase.h.


Constructor & Destructor Documentation

RelaxBase::RelaxBase AtomSet atomset,
QWidget *  parent = 0,
const char *  name = 0,
bool  modal = FALSE,
WFlags  fl = 0
 

Definition at line 77 of file relaxbase.cpp.

RelaxBase::~RelaxBase  ) 
 

The default destructor.

Definition at line 88 of file relaxbase.cpp.


Member Function Documentation

void RelaxBase::setName const QString  name  ) 
 

Sets the filename prefix of the calculation.

This is the basename from which all input and output files will be named.

Definition at line 95 of file relaxbase.cpp.

void RelaxBase::setDescription const QString  description  ) 
 

Sets the description of the calculation.

Definition at line 103 of file relaxbase.cpp.

void RelaxBase::setDir const QString  dir  ) 
 

Sets the directory of the calculation.

Definition at line 110 of file relaxbase.cpp.

void RelaxBase::setExtendedFormat const bool  state  ) 
 

Sets the format of the coordinates (normal/extended).

Definition at line 117 of file relaxbase.cpp.

unsigned int RelaxBase::inputGenerationFrequency  ) 
 

Returns the frequency with which the internal coordinates should be regenerated.

0 means just once at the beginning.

Definition at line 124 of file relaxbase.cpp.

unsigned int RelaxBase::maxSteps  ) 
 

Returns the maximum number of optimization steps to be done.

0 means no limit.

Definition at line 137 of file relaxbase.cpp.

void RelaxBase::scaleFactors vector< unsigned int > &  steps,
vector< double > &  factors
 

Returns the scalefactors.

Get it from the data struct (easier).

Definition at line 145 of file relaxbase.cpp.

QStringList RelaxBase::generateInput const Input  type  ) 
 

Generates input for a specific program.

  • AFF: complete .aff in case of manual input or just the header if using MAFF
  • MAFF: input for a call to the program MAFF

Definition at line 171 of file relaxbase.cpp.

void RelaxBase::loadCML const QDomElement *  root  ) 
 

Reads the widgetdata from a QDomElement.

Definition at line 214 of file relaxbase.cpp.

void RelaxBase::saveCML QDomElement *  root  ) 
 

Saves the widgetdata to a QDomElement.

Definition at line 485 of file relaxbase.cpp.

void RelaxBase::reset  )  [slot]
 

Resets all widgets to their default values.

Definition at line 629 of file relaxbase.cpp.

void RelaxBase::showEvent QShowEvent *  e  )  [protected]
 

Overridden from RelaxWidget::showEvent().

Definition at line 746 of file relaxbase.cpp.

void RelaxBase::accept  )  [protected, slot]
 

Overridden from RelaxWidget::accept().

Definition at line 834 of file relaxbase.cpp.

void RelaxBase::reject  )  [protected, slot]
 

Overridden from RelaxWidget::reject().

Definition at line 848 of file relaxbase.cpp.

void RelaxBase::showPreview  )  [private, slot]
 

Shows a preview from the widgets.

This function only starts MAFF if needed. The actual showing is done by showPreview2.

Definition at line 865 of file relaxbase.cpp.

void RelaxBase::showPreview2  )  [private, slot]
 

Shows a preview from the widgets.

This function is either called directly by showPreview if IC's are not generated or as a slot when the MAFF process is finished.

Definition at line 884 of file relaxbase.cpp.

void RelaxBase::readInputFile  )  [private, slot]
 

Reads a Relax AFF file into the widgets.

Definition at line 921 of file relaxbase.cpp.

void RelaxBase::setChanged bool  state = true  )  [private, slot]
 

Sets the 'changed' property of the widget.

Definition at line 1163 of file relaxbase.cpp.

void RelaxBase::selectWidget QListViewItem *   )  [private, slot]
 

Shows a widget from WidgetStackCategory depending on newItem.

Definition at line 1170 of file relaxbase.cpp.

void RelaxBase::enableAutogenWidgets  )  [private, slot]
 

Enabled/disables the widgets for configuring the (re)generation of the internal coordinates.

Definition at line 1215 of file relaxbase.cpp.

void RelaxBase::enableSFACWidgets bool  state = true  )  [private, slot]
 

Enabled/disables the widgets for configuring the scale factor depending on RadioButtonSFAC{1|2}.

Definition at line 1225 of file relaxbase.cpp.

void RelaxBase::newScaleFactor  )  [private, slot]
 

Adds a new scale factor to the list.

Definition at line 1240 of file relaxbase.cpp.

void RelaxBase::deleteScaleFactor  )  [private, slot]
 

Deletes the currently selected scale factor from the list.

Definition at line 1253 of file relaxbase.cpp.

void RelaxBase::updateICEdit  )  [private, slot]
 

Updates the widgets for changing an IC with the contents of the currently selected IC in ListViewIC.

Definition at line 1263 of file relaxbase.cpp.

void RelaxBase::updateICList  )  [private, slot]
 

Updates ListViewIC with the contents of the widgets for changing an IC.

It blocks calls to updateICEdit to prevent infinite recursion.

Definition at line 1351 of file relaxbase.cpp.

void RelaxBase::updateICSpecifics  )  [private, slot]
 

Updates the widgets for the specific data.

Definition at line 1408 of file relaxbase.cpp.

void RelaxBase::updateICType  )  [private, slot]
 

Does the necessary updating of all parts of an internal.

Definition at line 1479 of file relaxbase.cpp.

void RelaxBase::newIC  )  [private, slot]
 

Creates a new internal coordinate at the bottom of ListViewIC.

Definition at line 1610 of file relaxbase.cpp.

void RelaxBase::newICPart  )  [private, slot]
 

Creates a new part of an internal coordinate.

Definition at line 1645 of file relaxbase.cpp.

void RelaxBase::deleteIC  )  [private, slot]
 

Deletes the currently selected internal coordinate.

Definition at line 1685 of file relaxbase.cpp.

void RelaxBase::clearIC  )  [private, slot]
 

Deletes all internal coordinates.

Definition at line 1728 of file relaxbase.cpp.

void RelaxBase::genIC  )  [private, slot]
 

Fills the internal coordinates list with (non)redundant internal coordinates.

This function only starts MAFF. The reuslting file is parsed in genIC2.

Definition at line 1737 of file relaxbase.cpp.

void RelaxBase::genIC2  )  [private, slot]
 

Fills the internal coordinates list with (non)redundant internal coordinates.

It is only called when a MAFF run has ended.

Definition at line 1749 of file relaxbase.cpp.

void RelaxBase::moveICUp  )  [private, slot]
 

Moves the selected internal coordinate one place up in the list.

Definition at line 1765 of file relaxbase.cpp.

void RelaxBase::moveICDown  )  [private, slot]
 

Moves the selected internal coordinate one place down in the list.

Definition at line 1798 of file relaxbase.cpp.

void RelaxBase::newFixedAtom  )  [private, slot]
 

Adds a new atom to the list of fixed atoms.

Definition at line 1819 of file relaxbase.cpp.

void RelaxBase::deleteFixedAtom  )  [private, slot]
 

Deletes the selected atom from the list of fixed atoms.

Definition at line 1865 of file relaxbase.cpp.

void RelaxBase::checkFIXABoxes  )  [private, slot]
 

Makes sure at least 1 box stays checked for the fixed atoms.

Otherwise nothing would be actually fixed.

Definition at line 1877 of file relaxbase.cpp.

void RelaxBase::enableTROTWidgets bool  state = true  )  [private, slot]
 

Enables/disables the widgets for configuring the optimization of the external coordinates depending on CheckBoxTROT.

Definition at line 1910 of file relaxbase.cpp.

void RelaxBase::newExtraBond  )  [private, slot]
 

Adds a new bond to the XBON list.

Definition at line 1924 of file relaxbase.cpp.

void RelaxBase::deleteExtraBond  )  [private, slot]
 

Deletes the selected bond from the XBON list.

Definition at line 1947 of file relaxbase.cpp.

void RelaxBase::enableUPDTWidgets bool  state = true  )  [private, slot]
 

Enables/disables the widgets for configuring the update of the force constants depending on CheckBoxUPDT.

Definition at line 1958 of file relaxbase.cpp.

void RelaxBase::enableSHRTWidgets bool  state = true  )  [private, slot]
 

Enables/disables the widgets for configuring the short output depending on CheckBoxSHRT.

Definition at line 1967 of file relaxbase.cpp.

void RelaxBase::checkOverflow int  row,
int  col
[private, slot]
 

Spans cell(row, col) over multiple columns if it contains more than 10 characters.

Definition at line 1983 of file relaxbase.cpp.

void RelaxBase::addExtraRow  )  [private, slot]
 

If a row is selected, inserts a row before the selection.

If no row is selected, adds a row at the end.

Definition at line 1991 of file relaxbase.cpp.

void RelaxBase::removeExtraRow  )  [private, slot]
 

Removes the selected rows.

Definition at line 1999 of file relaxbase.cpp.

void RelaxBase::clearSelection  )  [private, slot]
 

Clears the selected cells.

Definition at line 2007 of file relaxbase.cpp.

void RelaxBase::makeConnections  )  [private]
 

Sets up the permanent connections. Called once from the constructor.

Definition at line 2020 of file relaxbase.cpp.

void RelaxBase::init  )  [private]
 

Initializes the dialog.

Called once from the constructor. Connections should be up.

Definition at line 2188 of file relaxbase.cpp.

void RelaxBase::saveWidgets  )  [private]
 

Saves the status of the widgets to a data struct.

Definition at line 2322 of file relaxbase.cpp.

void RelaxBase::restoreWidgets  )  [private]
 

Restores the status of the widgets from a data struct.

Definition at line 2465 of file relaxbase.cpp.

QString RelaxBase::icRepresentation const unsigned int  atom1,
const unsigned int  atom2,
const unsigned int  atom3 = 0,
const int  atom4 = 0
[private]
 

Returns a QString containing a representation of an internal coordinate from the 4 atom indices.

A zero value will not be added.

Definition at line 2590 of file relaxbase.cpp.

void RelaxBase::getAtomsFromIC const QString  textIC,
unsigned int &  atom1,
unsigned int &  atom2,
unsigned int &  atom3,
int &  atom4
[private]
 

Returns the atom numbers from a textual representation of an internal coordinate.

Definition at line 2614 of file relaxbase.cpp.

void RelaxBase::renumberICs  )  [private]
 

Renumbers the internal coordinates.

Definition at line 2638 of file relaxbase.cpp.

QStringList RelaxBase::generateAFFHeader  )  [private]
 

Generates input for the first part of an .aff file.

Definition at line 2654 of file relaxbase.cpp.

QStringList RelaxBase::generateBmatInput  )  [private]
 

Generates input for Maff to generate non-redundant internal coordinates.

Only generates the actual input for the IC definitions. The input for the initial questions is generated in generateICs.

Definition at line 2957 of file relaxbase.cpp.

bool RelaxBase::makeDirCurrent const QString  dir,
const QString  title
[private]
 

Makes dir the current directory.

Shows a messagebox with the error and title when something goes wrong.

Definition at line 3224 of file relaxbase.cpp.

void RelaxBase::fillICListFromAFF const QStringList  aff  )  [private]
 

Adds the internal coordinates found in the latest generated aff to the IC list widget.

Definition at line 3246 of file relaxbase.cpp.

bool RelaxBase::startMAFF const unsigned int  slot  )  [private]
 

Initiates the generation of an AFF file using MAFF.

Upon completion a specific slot will be called.

Definition at line 3420 of file relaxbase.cpp.

QStringList RelaxBase::readMAFFGeneratedICs  )  [private]
 

Returns the internal coordinates generated by the latest MAFF run.

Definition at line 3495 of file relaxbase.cpp.


Member Data Documentation

WidgetData RelaxBase::data [private]
 

Contains the status of all widgets.

Definition at line 357 of file relaxbase.h.

const RelaxBase::XMLData RelaxBase::xml [static, private]
 

Contains the XML dictRef values for all WidgetData.

Definition at line 358 of file relaxbase.h.

AtomSet* RelaxBase::atoms [private]
 

Pointer to the AtomSet passed in through the constructor.

Definition at line 359 of file relaxbase.h.

vector<QString> RelaxBase::category [private]
 

Contains translatable names for the items in ListViewCategory.

Definition at line 360 of file relaxbase.h.

bool RelaxBase::widgetChanged [private]
 

= TRUE if the dialog has been changed and needs saving.

Definition at line 361 of file relaxbase.h.

QString RelaxBase::calcName [private]
 

Contains the filename prefix (maybe change to pointer to XbraboView QString.

Definition at line 362 of file relaxbase.h.

QString RelaxBase::calcDescription [private]
 

Contains the description.

Definition at line 363 of file relaxbase.h.

QString RelaxBase::calcDir [private]
 

Contains the directory.

Definition at line 364 of file relaxbase.h.

bool RelaxBase::calcXF [private]
 

= TRUE if the calculation is to be done in extended format.

Definition at line 365 of file relaxbase.h.

QProcess* RelaxBase::maffProcess [private]
 

The process for running MAFF.

Definition at line 366 of file relaxbase.h.


Generated on Fri May 19 14:31:58 2006 for Brabosphere by  doxygen 1.4.6-NO