BALL::VIEW::MolecularControl Class Reference
[Modular Widgets]

MolecularControl is a widget to display the molecular structure of Composite objects. More...

#include <molecularControl.h>

Inheritance diagram for BALL::VIEW::MolecularControl:
Inheritance graph
[legend]

List of all members.


Public Slots

Public slots
void createRepresentation ()
Create a Representation with the DisplayProperties Dialog.
void compositeProperties ()
Composite properties dialog requested.
void bondProperties ()
Bond properties dialog requested.
void checkResidue ()
Check residues.
void buildBonds ()
Build bonds.
void centerCamera ()
Center the camera on a composite.
void countItems ()
Count the molecular items and print the info.
void showFilename ()
Show the filename from which the composite was loaded.
virtual void updateSelection ()
Prints the filename from which a Systems was loaded, after its selection.
void highlightSelection ()
void highlight (const List< Composite * > &composite)
void cut ()
Cut the selected Composite objects and copy them into an internal copy list.
void copy ()
Copy the selected Composite objects into an internal copy list.
void paste ()
Paste the copied Composite objects from the internal copy list into the Control.
void clearClipboard ()
Clear the copied Composite objects from the internal copy list.
void select ()
Select.
void deselect ()
Deselect.
void moveItems ()
Move a composite.
void collapseAll ()
Collapse all QListViewItem.
void expandAll ()
Expand all QListViewItem.
Size applySelector ()
Apply the BALL expression from the QLineEdit.
void showSelectorHelp ()
Show a help dialog for the Selector.
virtual void deleteCurrentItems ()
Overloaded from GenericControl, calls cut.
virtual void clearSelector ()
Connected to the clear selection button.
void switchShowSecondaryStructure ()
void showAtomOverview ()
void showAtomOverviewForSelection ()
void showDistance ()
void showAngle ()

Public Member Functions

Constructors and Destructor
MolecularControl (QWidget *parent=0, const char *name=0)
Default Constructor.
virtual ~MolecularControl ()
Destructor.
Accessors: inspectors and mutators
virtual void checkMenu (VIEW::MainControl &main_control)
Menu checking method.
void addComposite (Composite &composite, String given_name="")
Insert a Composite object into this Control.
Size removeComposite (Composite &composite)
Recursive removal of a Composite from the Control.
const List< Composite * > & getSelection () const
Non-mutable inspection of the selection.
virtual void onNotify (Message *message)
Message handling.
virtual void updateContextMenu (Composite &composite)
Build a context menu for a Composite.
virtual void initializeWidget (MainControl &main_control)
Initialize the menu entries:
  • cut
  • copy
  • paste
  • delete
  • clear clipboard.

Size applySelector (const String &expression)
Apply a given BALL expression.
void writePreferences (INIFile &inifile)
Write settings to an INIFile.
void fetchPreferences (INIFile &inifile)
Load settings from an INIFile.
void showDistance (Atom *a1, Atom *a2)
void showAngle (Atom *a1, Atom *a2, Atom *a3, Atom *a4=0)

Protected Attributes

List< Composite * > selected_
List< Composite * > copy_list_
MolecularInformation information_
QComboBox * selector_edit_
QComboBox * smarts_edit_
QMenu context_menu_
QMenu model_menu_
QMenu edit_menu_
QMenu color_menu_ [MODEL_LABEL-MODEL_LINES]
Composite * context_composite_
QTreeWidgetItem * context_item_
ModelType selected_model_
ColoringMethod selected_coloring_method_
std::map< Composite
*, MyTreeWidgetItem * >
composite_to_item_
bool was_delete_
Size nr_items_removed_
bool show_ss_
QAction * center_camera_action_
QAction * composite_properties_action_
QAction * bond_propertes_action_
QAction * select_action_
QAction * deselect_action_
QAction * count_items_action_
QAction * atom_overview_
QAction * atom_overview_selection_
QAction * angle_action_
QAction * distance_action_
bool ignore_messages_
Menu entries ids
QAction * cut_id_
QAction * copy_id_
QAction * paste_id_
QAction * delete_id_
QAction * clipboard_id_
QAction * select_id_
QAction * deselect_id_
QAction * show_ss_id_

Friends

class BondProperties

Protected members

void showGuestContextMenu (const QPoint &pos)
void activatedItem_ (QAction *action)
void createRepresentation_ ()
void onItemClicked (QTreeWidgetItem *item, int)
void buildContextMenu_ ()
void setSelection_ (bool open, bool force=false)
Set the selection of the checkboxes and the opening of the tree according to the selection in the MainControl.
virtual MolecularInformation & getInformationVisitor_ ()
Access the MolecularInformation visitor.
virtual void recurseGeneration_ (QTreeWidgetItem *item, Composite &composite)
Iterate over the children of the Composite and call for each the method generateListViewItem_().
virtual bool reactToMessages_ (Message *message)
Message handling.
QTreeWidgetItem * generateListViewItem_ (QTreeWidgetItem *parent, Composite &composite, QString *default_name=0)
Generate a new QTreeWidgetItem for the given Composite.
bool pasteAllowedFor_ (Composite &composite)
void removeRecursive_ (QTreeWidgetItem *item)
MolecularControl (const MolecularControl &mc)
List< QTreeWidgetItem * > getAllItems_ ()
void enableUpdates_ (bool state)
void newSelection_ (List< Composite * > &sel, bool selected)

Detailed Description

MolecularControl is a widget to display the molecular structure of Composite objects.

This class is derived from the class GenericControl and extends it for showing and modifiying molecular structures. The methods checkMenu() and buildContextMenu() are overridden for performing special molecular tasks. MolecularControl has also a QLineEdit to select Composites by BALL expressions. For further informations on this topic have a look at the class Selector.


Constructor & Destructor Documentation

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

Default Constructor.

Parameters:
parent the parent widget
name the name of this widget

Member Function Documentation

void BALL::VIEW::MolecularControl::addComposite ( Composite & composite,
String given_name = ""
)

Insert a Composite object into this Control.

If name == "" than the Information visitor is used for determining a name for the Composite.

Calls generateListViewItem_() for the Composite.
Parameters:
composite a pointer to the Composite to be inserted into the Control

Size BALL::VIEW::MolecularControl::applySelector ( ) [slot]

Apply the BALL expression from the QLineEdit.

Returns:
Size number of selected atoms

Size BALL::VIEW::MolecularControl::applySelector ( const String & expression )

Apply a given BALL expression.

Returns:
Size number of selected atoms

virtual void BALL::VIEW::MolecularControl::checkMenu ( VIEW::MainControl & main_control ) [virtual]

Menu checking method.

This method is called by MainControl::checkMenus before a popup menu is shown. The copy menu entry is only enabled for selected System objects.

Parameters:
main_control the MainControl object whose menus should be checked
See also:
Control::checkMenu

Reimplemented from BALL::VIEW::ModularWidget.

void BALL::VIEW::MolecularControl::copy ( ) [slot]

Copy the selected Composite objects into an internal copy list.

If there are already Composite objects in the copy list they will be deleted.

void BALL::VIEW::MolecularControl::cut ( ) [slot]

Cut the selected Composite objects and copy them into an internal copy list.

If there are already Composite objects in the copy list they will be deleted. All Composite objects that are cutted are removed from the Control. Cuted systems are moved to the copy list. A RemovedCompositeMessage will be sent for each cutted object. After all selected objects are removed a SceneMessage will be sent to update the Scene.

void BALL::VIEW::MolecularControl::fetchPreferences ( INIFile & inifile ) [virtual]

Load settings from an INIFile.

See also:
ModularWidget::fetchPreferences

Reimplemented from BALL::VIEW::DockWidget.

QTreeWidgetItem* BALL::VIEW::MolecularControl::generateListViewItem_ ( QTreeWidgetItem * parent,
Composite & composite,
QString * default_name = 0
) [protected]

Generate a new QTreeWidgetItem for the given Composite.

If default_name == 0 than a new name is created using the Information visitor accessed with the method getInformationVisitor_(). If parent == 0 than the new QTreeWidgetItem is a root item. Otherwise a new QTreeWidgetItem for is created that will be inserted into given parent. All children of composite will be inserted recursivly into the newly created item by the method recurseGeneration_().

Parameters:
parent a QTreeWidgetItem into which a subtree of items will be inserted, or 0 if a new root item should be created
composite the Composite object whose subtree will be inserted into parent
default_name the name of the item

virtual MolecularInformation& BALL::VIEW::MolecularControl::getInformationVisitor_ ( ) [protected, virtual]

Access the MolecularInformation visitor.

With the MolecularInformation, the names and type entries for the Items are generated. Override this method if another information visitor is needed. This method is used in the method generateListViewItem_() to retrieve certain information of the given Composite.

virtual void BALL::VIEW::MolecularControl::initializeWidget ( MainControl & main_control ) [virtual]

Initialize the menu entries:

  • cut
  • copy
  • paste
  • delete
  • clear clipboard.
This method is called automatically immediately before the main application is started by MainControl::show.
Parameters:
main_control the MainControl object to be initialized with this ModularWidget

Reimplemented from BALL::VIEW::GenericControl.

virtual void BALL::VIEW::MolecularControl::onNotify ( Message * message ) [virtual]

Message handling.

Overridden method from ConnectionObject to handle incoming messages.

Calls reactToMessages_().
Parameters:
message a pointer to a Message object

Reimplemented from BALL::VIEW::GenericControl.

void BALL::VIEW::MolecularControl::paste ( ) [slot]

Paste the copied Composite objects from the internal copy list into the Control.

For each Composite in the copy list a NewCompositeMessage will be sent.

virtual bool BALL::VIEW::MolecularControl::reactToMessages_ ( Message * message ) [protected, virtual]

Message handling.

Catch the Message objects and react accordingly to the different messages. Override this method if new messages should be catched.

Note: If this method is overriden, call this method at the end of the new implementation to make sure the old messages are still catched properly.
Messages to be catched and the resulting reaction:
  • NewCompositeMessage - update always necessary
  • RemovedCompositeMessage - update necessary if already inserted
  • ChangedCompositeMessage - update necessary if Composite object has changed
Parameters:
message a pointer to the Message object
Returns:
bool true if an update of the Control is necessary, false otherwise
See also:
onNotify

virtual void BALL::VIEW::MolecularControl::recurseGeneration_ ( QTreeWidgetItem * item,
Composite & composite
) [protected, virtual]

Iterate over the children of the Composite and call for each the method generateListViewItem_().

Parameters:
item a pointer to a QTreeWidgetItem to which all children of the Composite will be inserted
composite whose children will be inserted into item

void BALL::VIEW::MolecularControl::setSelection_ ( bool open,
bool force = false
) [protected]

Set the selection of the checkboxes and the opening of the tree according to the selection in the MainControl.

Parameters:
open true means, that the item tree is opend and closed according to the changes
force true means, that the item tree is opend and closed also if more than 50 items are selected.

virtual void BALL::VIEW::MolecularControl::updateContextMenu ( Composite & composite ) [virtual]

Build a context menu for a Composite.

If the Composite has certain properties a context menu is created. This method only creates the necessary interface for derived classes. Override this method for creating other context menu entries, but call Control::buildContextMenu at the end of your method to create the standard entries. Calls insertContextMenuEntry() for each context menu entry that will be created.

Parameters:
composite the Composite object for that a context menu should be created
See also:
onContextMenu

virtual void BALL::VIEW::MolecularControl::updateSelection ( ) [virtual, slot]

Prints the filename from which a Systems was loaded, after its selection.

Calls showFilename()

Reimplemented from BALL::VIEW::GenericControl.

void BALL::VIEW::MolecularControl::writePreferences ( INIFile & inifile ) [virtual]

Write settings to an INIFile.

See also:
ModularWidget::writePreferences

Reimplemented from BALL::VIEW::DockWidget.


Generated on Thu Aug 6 18:31:00 2009 for BALL by doxygen 1.5.8