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

Extended 3D view for editing molecules. More...

#include <editableScene.h>

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

List of all members.


Public Types

enum EditMode { EDIT__MODE = PICKING__MODE + 1 }

Public Slots

virtual void mousePressEvent (QMouseEvent *e)
Catch mouse press events, store the actual mouse position in this scene widget and sent events accordingly.
virtual void mouseMoveEvent (QMouseEvent *e)
Catch mouse move events, store the actual mouse position in this scene widget and sent events accordingly.
virtual void mouseReleaseEvent (QMouseEvent *e)
Catch mouse release events, store the actual mouse position in this scene widget and sent events accordingly.
virtual void wheelEvent (QWheelEvent *qmouse_event)
Catch mouse wheel events and zoom the scene accordingly.
void createNewMolecule ()
void saturateWithHydrogens ()
void optimizeStructure ()
void computeBondOrders ()
void setEditElementType (int element_number)
int getEditElementType ()

Signals

void newEditOperation (EditableScene::EditOperation &eo)

Public Member Functions

EditableScene (QWidget *parent_widget, const char *name=NULL, Qt::WFlags w_flags=0)
Default Constructor.
EditableScene (const EditableScene &eScene, QWidget *parent_widget=NULL, const char *name=NULL, Qt::WFlags wflags=0)
Copy constructor.
virtual ~EditableScene ()
Destructor.
void initializeWidget (MainControl &main_control)
ModularWidget methods.
void checkMenu (MainControl &main_control)
Menu checking method.
void initializePreferencesTab (Preferences &preferences)
Initialize a preferences tab for the widget (if needed).
void finalizePreferencesTab (Preferences &preferences)
Remove the preferences tab.
virtual void applyPreferences ()
Apply the preferences of the specific tab.
void showContextMenu (QPoint pos)
virtual void setMode (ModeType mode)
void addStructure (String name)
void setCursor (String c)
void setElementCursor ()

Protected Slots

virtual void editMode_ ()
void deleteAtom_ ()
void changeElement_ ()
void deleteBond_ ()
void changeBondOrder_ ()
void activatedOrderItem_ (QAction *action)
void moveAtom_ ()
void atomProperties_ ()
void createMolecule_ ()
void addStructure_ ()
void setFormalCharge_ ()

Protected Member Functions

virtual void addToolBarEntries (QToolBar *tb)
Add the widgets actions to the (main) toolbar.
virtual void keyPressEvent (QKeyEvent *e)
Catch key events.
virtual void mouseDoubleClickEvent (QMouseEvent *e)
virtual bool reactToKeyEvent_ (QKeyEvent *e)
virtual void onNotify (Message *message)
Handles messages sent by other registered ConnectionObject objects.
void insert_ (int x_, int y_, PDBAtom &atom_)
Insert a given Atom in the Scene.
void merge_ (Composite *a1, Composite *a2)
TVector2< float > getScreenPosition_ (Vector3 vec)
Given a 3-dim.
void getClickedItems_ (int x, int y)
void init_ ()
String getBondOrderString_ (Index order)
List< AtomContainer * > getContainers_ ()
void changeBondOrder_ (Index delta)
void deselect_ (bool update=true)
void renderGrid_ ()

Protected Attributes

QAction * edit_id_
QAction * new_molecule_action_
QAction * optimize_action_
QAction * add_hydrogens_action_
QAction * element_action_
QAction * bondorders_action_
Atom * current_atom_
Bond * current_bond_
Vector3 atom_pos_
int atomic_number_
Position atom_number_
int bond_order_
Position last_y_
Qt::MouseButtons last_buttons_
vector< EditOperation > undo_
EditSettings * edit_settings_
QPoint menu_point_
FragmentDB fragment_db_
bool fragment_db_initialized_
bool temp_move_
QToolBar * toolbar_edit_controls_
QList< QAction * > toolbar_actions_edit_controls_

Static Protected Attributes

static bool only_highlighted_

Detailed Description

Extended 3D view for editing molecules.

The editing functionality is implemented as an own mode.


Member Function Documentation

virtual void BALL::VIEW::EditableScene::addToolBarEntries ( QToolBar * main_tb ) [protected, virtual]

Add the widgets actions to the (main) toolbar.

This method is needed to enable ordering the entries. It is called in Mainframe.

Reimplemented from BALL::VIEW::Scene.

virtual void BALL::VIEW::EditableScene::applyPreferences ( ) [virtual]

Apply the preferences of the specific tab.

In this method the widget can extract any changed values from its preferences tab (if required). This method is called automatically by the applyPreferencesTab from the MainControl object if the apply button in the Preferences dialog is pressed.

Parameters:
preferences the Preferences dialog of the MainControl
See also:
initializePreferencesTab

finalizePreferencesTab

applyPreferencesTab

Reimplemented from BALL::VIEW::Scene.

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

Menu checking method.

This method is called by MainControl::checkMenus before a popup menu is shown. The menus rotate mode and picking mode each will be checked if this scene is in the corresponding mode.

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

finalizeWidget

checkMenus

show

Reimplemented from BALL::VIEW::Scene.

void BALL::VIEW::EditableScene::finalizePreferencesTab ( Preferences & preferences ) [virtual]

Remove the preferences tab.

This method can remove a preferences widget (if created in initializePreferencesTab) from the Preferences dialog of the MainControl. This method is called automatically by MainControl::aboutToExit() at the end of the application.

Parameters:
preferences the Preferences dialog of the MainControl

Reimplemented from BALL::VIEW::Scene.

TVector2<float> BALL::VIEW::EditableScene::getScreenPosition_ ( Vector3 vec ) [protected]

Given a 3-dim.

Coordinates (in Viewing Volume) getScreenPosition computes the 2-dim Coordinates on Screen.

void BALL::VIEW::EditableScene::initializePreferencesTab ( Preferences & preferences ) [virtual]

Initialize a preferences tab for the widget (if needed).

This method can be used to create preferences widgets that can be inserted into the Preferences dialog with the method insertTab. This method is called automatically by MainControl::show at the start of the application.

Parameters:
preferences the Preferences dialog of the MainControl

Reimplemented from BALL::VIEW::Scene.

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

ModularWidget methods.

Initialize the popup menu Display and the menus of this scene:

  • the rotate mode (all mouse actions are attached to rotating, translating and zooming the scene)
  • the picking mode (all mouse actions are attached to picking objects from the scene)
    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 scene

Reimplemented from BALL::VIEW::Scene.

void BALL::VIEW::EditableScene::insert_ ( int x_,
int y_,
PDBAtom & atom_
) [protected]

Insert a given Atom in the Scene.

Its position is specified by the 2-dim Mouseclick coordinates of the Screen, which will be translated into the 3-dim space of Viewing Volume.

virtual void BALL::VIEW::EditableScene::mouseMoveEvent ( QMouseEvent * qmouse_event ) [virtual, slot]

Catch mouse move events, store the actual mouse position in this scene widget and sent events accordingly.

Parameters:
e the QT-mouse event (See QT-library for mouse events)

Reimplemented from BALL::VIEW::Scene.

virtual void BALL::VIEW::EditableScene::mousePressEvent ( QMouseEvent * qmouse_event ) [virtual, slot]

Catch mouse press events, store the actual mouse position in this scene widget and sent events accordingly.

Parameters:
e the QT-mouse event (See QT-library for mouse events)

Reimplemented from BALL::VIEW::Scene.

virtual void BALL::VIEW::EditableScene::mouseReleaseEvent ( QMouseEvent * qmouse_event ) [virtual, slot]

Catch mouse release events, store the actual mouse position in this scene widget and sent events accordingly.

Parameters:
e the QT-mouse event (See QT-library for mouse events)

Reimplemented from BALL::VIEW::Scene.

virtual void BALL::VIEW::EditableScene::onNotify ( Message * message ) [protected, virtual]

Handles messages sent by other registered ConnectionObject objects.

Filters for SceneMessage and sets the Camera appropriate or updates the visualization.

Parameters:
message the pointer to the message that should be processed
See also:
ConnectionObject

Message

Reimplemented from BALL::VIEW::Scene.

virtual void BALL::VIEW::EditableScene::wheelEvent ( QWheelEvent * qmouse_event ) [virtual, slot]

Catch mouse wheel events and zoom the scene accordingly.

Parameters:
e the QT-mouse event (See QT-library for mouse events)

Reimplemented from BALL::VIEW::Scene.


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