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

VIEW::EditableScene Class Reference
[Modular Widgets]

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

#include <editableScene.h>

Inheritance diagram for VIEW::EditableScene:

VIEW::Scene VIEW::ModularWidget Embeddable VIEW::ConnectionObject 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 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) throw ()
 Default Constructor.
 EditableScene (const EditableScene &eScene, QWidget *parent_widget=NULL, const char *name=NULL, Qt::WFlags wflags=0) throw ()
 Copy constructor.
virtual ~EditableScene () throw ()
 Destructor.
void initializeWidget (MainControl &main_control) throw ()
 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).
void checkMenu (MainControl &main_control) throw ()
 Menu checking method.
void initializePreferencesTab (Preferences &preferences) throw ()
 Initialize a preferences tab for the widget (if needed).
void finalizePreferencesTab (Preferences &preferences) throw ()
 Remove the preferences tab.
virtual void applyPreferences () throw ()
 Apply the preferences of the specific tab.
void showContextMenu (QPoint pos)
virtual void setMode (ModeType mode) throw ()
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) throw ()
 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)
virtual void paintGL ()
 Render the visualization.
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_
QAction * optimize_
QAction * add_hydrogens_
QAction * element_action_
Atomcurrent_atom_
Bondcurrent_bond_
Vector3 atom_pos_
bool draw_line_
int atomic_number_
Position atom_number_
int bond_order_
Position last_y_
Qt::MouseButtons last_buttons_
vector< EditOperation > undo_
EditSettingsedit_settings_
QPoint menu_point_
FragmentDB fragment_db_
bool fragment_db_initialized_
bool temp_move_

Static Protected Attributes

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 VIEW::EditableScene::addToolBarEntries QToolBar *  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 VIEW::Scene.

virtual void VIEW::EditableScene::applyPreferences  )  throw () [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 VIEW::Scene.

void VIEW::EditableScene::checkMenu MainControl main_control  )  throw () [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 VIEW::Scene.

void VIEW::EditableScene::finalizePreferencesTab Preferences preferences  )  throw () [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 VIEW::Scene.

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

Given a 3-dim.

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

void VIEW::EditableScene::initializePreferencesTab Preferences preferences  )  throw () [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 VIEW::Scene.

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

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 VIEW::Scene.

void 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 VIEW::EditableScene::mouseMoveEvent QMouseEvent *  e  )  [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 VIEW::Scene.

virtual void VIEW::EditableScene::mousePressEvent QMouseEvent *  e  )  [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 VIEW::Scene.

virtual void VIEW::EditableScene::mouseReleaseEvent QMouseEvent *  e  )  [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 VIEW::Scene.

virtual void VIEW::EditableScene::onNotify Message message  )  throw () [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 VIEW::Scene.

virtual void VIEW::EditableScene::paintGL  )  [protected, virtual]
 

Render the visualization.

Overriden qt method for rendering the visualization of this scene. This method will be called automatically every time an update is necessary. See QT-library for information concerning qglwidgets and paintGL methods and events.

See also:
MainControl

Reimplemented from VIEW::Scene.

virtual void 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 VIEW::Scene.