BALL 1.5.0
Loading...
Searching...
No Matches
molecularControl.h
Go to the documentation of this file.
1// -*- Mode: C++; tab-width: 2; -*-
2// vi: set ts=2:
3//
4
5#ifndef BALL_VIEW_WIDGETS_MOLECULARCONTROL_H
6#define BALL_VIEW_WIDGETS_MOLECULARCONTROL_H
7
8#ifndef BALL_VIEW_WIDGETS_GENERICCONTROL_H
10#endif
11
12#ifndef BALL_CONCEPT_MOLECULARINFORMATION_H
14#endif
15
16#ifndef BALL_SYSTEM_MUTEX_H
17# include <BALL/SYSTEM/mutex.h>
18#endif
19
20#ifndef BALL_VIEW_KERNEL_COMMON_H
22#endif
23
24#include <QtWidgets/QMenu>
25#include <QtWidgets/QTreeView>
26
27class QComboBox;
28class QPoint;
29class QSignalMapper;
30class QThread;
31
32namespace BALL
33{
34 class Residue;
35 class RotamerLibrary;
36
37 namespace VIEW
38 {
39 class BondProperties;
40
50 : public GenericControl
51{
52 // for internal usage only:
53 class MyTreeWidgetItem
54 : public QTreeWidgetItem
55 {
56 public:
57
58 MyTreeWidgetItem(QTreeWidget* parent, QStringList& sl, Composite* composite);
59
60 MyTreeWidgetItem(QTreeWidgetItem* parent, QStringList& sl, Composite* composite);
61
62 void init_();
63
64 Composite* composite;
65 };
66
67 enum MolecularMenuEntries
68 {
70 CREATE_REPRESENTATION,
71 OBJECT__MOVE,
72 SELECT,
73 DESELECT,
74 EDIT_MENU,
75 CUT,
76 COPY,
77 DELETE_ENTRY,
78 PASTE,
79
80
82 CAMERA__CENTER,
84 COMPOSITE__PROPERTIES,
86 COUNT__ITEMS,
88 BOND__PROPERTIES,
90 COLLAPSE_ALL,
92 EXPAND_ALL
93 };
94
95 Q_OBJECT
96
97 public:
98
100
101 friend class BondProperties;
102
106
111 MolecularControl(QWidget* parent = 0, const char* name = 0);
112
116
118
121
128 virtual void checkMenu(VIEW::MainControl& main_control);
129
136 void addComposite(Composite& composite, String given_name = "");
137
141
144 const std::list<Composite*>& getSelection() const;
145
149
155 virtual void onNotify(Message *message);
156
166 virtual void updateContextMenu(Composite& composite);
167
179 virtual void initializeWidget(MainControl& main_control);
180
184 Size applySelector(const String& expression);
185
187 void writePreferences(INIFile& inifile);
188
190 void fetchPreferences(INIFile& inifile);
191
193 void showDistance(Atom* a1, Atom* a2);
194
196 void showAngle(Atom* a1, Atom* a2, Atom* a3, Atom* a4 = 0);
197
201
202 public Q_SLOTS:
203
205
208
211
214
217
220
224
228
232
235
238
242 virtual void updateSelection();
243
246
248 void highlight(const std::list<Composite*>& composite);
249
259 void cut();
260
265 void copy();
266
271 void paste();
272
276
279 void select();
280
283 void deselect();
284
286 void moveItems();
287
290
292 void expandAll();
293
298
304
306 virtual void deleteCurrentItems();
307
309 virtual void clearSelector();
310
312
315
318
321
323 void showAngle();
324
326
329 protected Q_SLOTS:
330
331 /*_ Controlling method for context menus.
332 Clear the previously created context menu.
333 Calls buildContextMenu for the Composite object belonging
334 to the <tt>item</tt> and executes the context menu if menu entries are available.
335 \param point the position to which the context menu should be drawn
336 \param column not used at the moment
337 \see buildContextMenu
338 */
339 void showGuestContextMenu(const QPoint& pos);
340
341 //_ called when a model is selected in the context menu
342 void activatedItem_(QAction* action);
343
344 //_
346
347 //
349
350 void changeRotamer_(int i);
351
352 protected:
353
356
359
366 void setSelection_(bool open, bool force = false);
367
376
383 virtual void recurseGeneration_(QTreeWidgetItem* item, Composite& composite);
384
399 virtual bool reactToMessages_(Message* message);
400
415 Composite& composite, QString* default_name = 0);
416
417 //_ Test, if its allowed to paste the copy liste into the current selected context item.
418 bool pasteAllowedFor_(Composite& composite);
419
420 //
422
423 // only for Python Interface
425
426 //
428
429 void enableUpdates_(bool state);
430 void newSelection_(std::list<Composite*>& sel, bool selected);
431
433
435
438
439 //_
442
444
447
449
450 QComboBox* selector_edit_;
451 QComboBox* smarts_edit_;
452
453 // the context menus
458
460
462
464
467 std::map<Composite*, MyTreeWidgetItem*> composite_to_item_;
468
469 // let cut know to delete the entries, set by deleteCurrentItems()
471
473
478
480
481 QSignalMapper* rotamer_mapper_;
486};
487
488}} // namespaces
489
490#endif // BALL_VIEW_WIDGETS_MOLECULARCONTROL_H
#define BALL_DEPRECATED
#define BALL_VIEW_EXPORT
Rotamer Library Class.
GenericControl(QWidget *parent=0, const char *name=0)
void removeRecursive_(QTreeWidgetItem *item)
Composite * getContextComposite()
void expandAll()
Expand all QListViewItem.
void countItems()
Count the molecular items and print the info.
void bondProperties()
Bond properties dialog requested.
Size applySelector(const String &expression)
BALL_DEPRECATED void showSelectorHelp()
virtual void clearSelector()
Connected to the clear selection button.
void showFilename()
Show the filename from which the composite was loaded.
bool pasteAllowedFor_(Composite &composite)
void fetchPreferences(INIFile &inifile)
void onItemClicked(QTreeWidgetItem *item, int)
std::list< Composite * > copy_list_
virtual MolecularInformation & getInformationVisitor_()
void writePreferences(INIFile &inifile)
virtual void recurseGeneration_(QTreeWidgetItem *item, Composite &composite)
QMenu color_menu_[MODEL_LABEL - MODEL_LINES]
void moveItems()
Move a composite.
void showDistance(Atom *a1, Atom *a2)
Size removeComposite(Composite &composite)
void enableUpdates_(bool state)
virtual void updateSelection()
const std::list< Composite * > & getSelection() const
std::map< Composite *, MyTreeWidgetItem * > composite_to_item_
void compositeProperties()
Composite properties dialog requested.
virtual void updateContextMenu(Composite &composite)
void setSelection_(bool open, bool force=false)
virtual void checkMenu(VIEW::MainControl &main_control)
void highlight(const std::list< Composite * > &composite)
MolecularControl(QWidget *parent=0, const char *name=0)
void collapseAll()
Collapse all QListViewItem.
virtual void onNotify(Message *message)
void showGuestContextMenu(const QPoint &pos)
void showAngle(Atom *a1, Atom *a2, Atom *a3, Atom *a4=0)
std::list< QTreeWidgetItem * > getAllItems_()
QTreeWidgetItem * generateListViewItem_(QTreeWidgetItem *parent, Composite &composite, QString *default_name=0)
std::list< Composite * > selected_
void newSelection_(std::list< Composite * > &sel, bool selected)
void addComposite(Composite &composite, String given_name="")
void createRepresentation()
Create a Representation with the DisplayProperties Dialog.
MolecularInformation information_
virtual bool reactToMessages_(Message *message)
void activatedItem_(QAction *action)
virtual void deleteCurrentItems()
Overloaded from GenericControl, calls cut.
virtual void initializeWidget(MainControl &main_control)
void toggleDisulfidBond()
Create a disulfid bond.
#define BALL_EMBEDDABLE(TYPE, BASE)
Definition embeddable.h:31
@ MODEL_LINES
defines the property for the model: Lines
@ MODEL_LABEL
defines the property for the model: Label
BALL_SIZE_TYPE Size
TReadWriteLock< BALL_DEFAULT_READWRITELOCK_TYPE > ReadWriteLock
Definition mutex.h:225
STL namespace.