BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
editMode.h
Go to the documentation of this file.
1 #ifndef BALL_VIEW_KERNEL_MODES_EDITMODE_H
2 #define BALL_VIEW_KERNEL_MODES_EDITMODE_H
3 
5 
6 #include <QtGui/QMouseEvent>
7 
8 #include <vector>
9 
10 namespace BALL
11 {
12  class Composite;
13  class FragmentDB;
14  class PDBAtom;
15 
16  namespace VIEW
17  {
18 
19  class EditMode : public InteractionMode
20  {
21  Q_OBJECT
22 
23  public:
24  EditMode(Scene* scene);
25  virtual ~EditMode();
26 
27  virtual void keyPressEvent(QKeyEvent* evt);
28  virtual void keyReleaseEvent(QKeyEvent* evt);
29 
30  virtual void mouseDoubleClickEvent(QMouseEvent* evt);
31 
32  virtual void wheelEvent(QWheelEvent* evt);
33 
34  virtual void addToolBarEntries(QToolBar* tb);
35 
36  virtual Qt::Key getKey() const;
37  virtual QString getName() const { return "EditMode"; }
38 
39  virtual void activate();
40  virtual void populateContextMenu(QMenu* menu);
41 
42  protected slots:
43  virtual void addStructure_();
44  virtual void setFormalCharge_();
45  virtual void changeBondOrder_();
46  virtual void activatedOrderItem_(QAction* action);
47  virtual void deleteCurrentBondTriggered_();
48  virtual void deleteCurrentAtomTriggered_();
49  virtual void atomPropertiesTriggered_();
50  virtual void changeAtomElementTriggered_();
51  virtual void createBond_();
52 
53  protected:
54  bool temp_move_;
57  Qt::MouseButtons last_buttons_;
59  QAction* element_action_;
60  QAction* bond_action_;
61  QAction* delete_atom_;
62  QAction* change_charge_;
63  QAction* atom_properties_;
64  QMenu* charge_menu_;
65  QMenu* order_menu_;
66  QMenu* add_menu_;
67  std::vector<QAction*> order_actions_;
68 
69  virtual void mouseMoveEventImpl_ (QMouseEvent* evt);
70  virtual void mousePressEventImpl_ (QMouseEvent* evt);
71  virtual void mouseReleaseEventImpl_(QMouseEvent* evt);
72 
73  void insert_(int x, int y, PDBAtom &atom);
74  void merge_(Composite* a1, Composite* a2);
75  virtual void createActions_();
76 
77  private:
78  void checkBondOrderActions_(unsigned int bo);
79  void createContextMenuEntries_();
80  };
81 
82  }
83 }
84 
85 #endif //BALL_VIEW_KERNEL_MODES_EDITMODE_H
virtual void keyReleaseEvent(QKeyEvent *evt)
virtual void mousePressEventImpl_(QMouseEvent *evt)
virtual void mouseReleaseEventImpl_(QMouseEvent *evt)
virtual void wheelEvent(QWheelEvent *evt)
EditMode(Scene *scene)
virtual void mouseDoubleClickEvent(QMouseEvent *evt)
virtual void createActions_()
virtual void addToolBarEntries(QToolBar *tb)
QAction * delete_atom_
Definition: editMode.h:61
QAction * bond_action_
Definition: editMode.h:60
virtual QString getName() const
Definition: editMode.h:37
QAction * element_action_
Definition: editMode.h:59
virtual void mouseMoveEventImpl_(QMouseEvent *evt)
virtual void atomPropertiesTriggered_()
virtual void addStructure_()
virtual void changeAtomElementTriggered_()
virtual void populateContextMenu(QMenu *menu)
virtual Qt::Key getKey() const
virtual void setFormalCharge_()
std::vector< QAction * > order_actions_
Definition: editMode.h:67
FragmentDB * fragment_db_
Definition: editMode.h:58
Qt::MouseButtons last_buttons_
Definition: editMode.h:57
virtual void deleteCurrentAtomTriggered_()
QMenu * order_menu_
Definition: editMode.h:65
void merge_(Composite *a1, Composite *a2)
virtual void deleteCurrentBondTriggered_()
virtual void activate()
QAction * atom_properties_
Definition: editMode.h:63
virtual void activatedOrderItem_(QAction *action)
void insert_(int x, int y, PDBAtom &atom)
virtual void changeBondOrder_()
virtual void keyPressEvent(QKeyEvent *evt)
virtual void createBond_()
QMenu * charge_menu_
Definition: editMode.h:64
QAction * change_charge_
Definition: editMode.h:62