Loading...
Searching...
No Matches
molecularControl.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_VIEW_WIDGETS_MOLECULARCONTROL_H
#define BALL_VIEW_WIDGETS_MOLECULARCONTROL_H
#ifndef BALL_VIEW_WIDGETS_GENERICCONTROL_H
# include <BALL/VIEW/WIDGETS/genericControl.h>
#endif
#ifndef BALL_CONCEPT_MOLECULARINFORMATION_H
# include <BALL/CONCEPT/molecularInformation.h>
#endif
#ifndef BALL_SYSTEM_MUTEX_H
# include <BALL/SYSTEM/mutex.h>
#endif
#ifndef BALL_VIEW_KERNEL_COMMON_H
# include <BALL/VIEW/KERNEL/common.h>
#endif
#include <QtWidgets/QMenu>
#include <QtWidgets/QTreeView>
class QComboBox;
class QPoint;
class QSignalMapper;
class QThread;
namespace BALL
{
class Residue;
class RotamerLibrary;
namespace VIEW
{
class BondProperties;
class BALL_VIEW_EXPORT MolecularControl
: public GenericControl
{
// for internal usage only:
class MyTreeWidgetItem
: public QTreeWidgetItem
{
public:
MyTreeWidgetItem(QTreeWidget* parent, QStringList& sl, Composite* composite);
MyTreeWidgetItem(QTreeWidgetItem* parent, QStringList& sl, Composite* composite);
void init_();
Composite* composite;
};
enum MolecularMenuEntries
{
CREATE_REPRESENTATION,
OBJECT__MOVE,
SELECT,
DESELECT,
EDIT_MENU,
CUT,
COPY,
DELETE_ENTRY,
PASTE,
CAMERA__CENTER,
COMPOSITE__PROPERTIES,
COUNT__ITEMS,
BOND__PROPERTIES,
COLLAPSE_ALL,
EXPAND_ALL
};
Q_OBJECT
public:
BALL_EMBEDDABLE(MolecularControl,GenericControl)
friend class BondProperties;
MolecularControl(QWidget* parent = 0, const char* name = 0);
virtual ~MolecularControl();
virtual void checkMenu(VIEW::MainControl& main_control);
void addComposite(Composite& composite, String given_name = "");
Size removeComposite(Composite& composite);
const std::list<Composite*>& getSelection() const;
Composite* getContextComposite();
virtual void onNotify(Message *message);
virtual void updateContextMenu(Composite& composite);
virtual void initializeWidget(MainControl& main_control);
Size applySelector(const String& expression);
void writePreferences(INIFile& inifile);
void fetchPreferences(INIFile& inifile);
void showDistance(Atom* a1, Atom* a2);
void showAngle(Atom* a1, Atom* a2, Atom* a3, Atom* a4 = 0);
QMenu& getContextMenu();
public Q_SLOTS:
void createRepresentation();
void compositeProperties();
void toggleDisulfidBond();
void bondProperties();
void checkResidue();
void buildBonds();
void centerCamera();
void countItems();
void showFilename();
virtual void updateSelection();
void highlightSelection();
void highlight(const std::list<Composite*>& composite);
void cut();
void copy();
void paste();
void clearClipboard();
void select();
void deselect();
void moveItems();
void collapseAll();
void expandAll();
Size applySelector();
BALL_DEPRECATED void showSelectorHelp();
virtual void deleteCurrentItems();
virtual void clearSelector();
void switchShowSecondaryStructure();
void showAtomOverview();
void showAtomOverviewForSelection();
void showDistance();
void showAngle();
protected Q_SLOTS:
/*_ Controlling method for context menus.
Clear the previously created context menu.
Calls buildContextMenu for the Composite object belonging
to the <tt>item</tt> and executes the context menu if menu entries are available.
\param point the position to which the context menu should be drawn
\param column not used at the moment
\see buildContextMenu
*/
void showGuestContextMenu(const QPoint& pos);
//_ called when a model is selected in the context menu
void activatedItem_(QAction* action);
//_
void createRepresentation_();
//
void onItemClicked(QTreeWidgetItem* item, int);
void changeRotamer_(int i);
protected:
void buildContextMenu_();
void buildRotamerMenu_();
void setSelection_(bool open, bool force = false);
virtual MolecularInformation& getInformationVisitor_();
virtual void recurseGeneration_(QTreeWidgetItem* item, Composite& composite);
virtual bool reactToMessages_(Message* message);
QTreeWidgetItem* generateListViewItem_(QTreeWidgetItem* parent,
Composite& composite, QString* default_name = 0);
//_ Test, if its allowed to paste the copy liste into the current selected context item.
bool pasteAllowedFor_(Composite& composite);
//
inline void removeRecursive_(QTreeWidgetItem* item);
// only for Python Interface
MolecularControl(const MolecularControl& mc);
//
std::list<QTreeWidgetItem*> getAllItems_();
void enableUpdates_(bool state);
void newSelection_(std::list<Composite*>& sel, bool selected);
bool allowPaste_();
//_
QAction* cut_id_, *copy_id_, *paste_id_, *delete_id_, *clipboard_id_, *select_id_, *deselect_id_,
*show_ss_id_;
std::list<Composite*> selected_;
std::list<Composite*> copy_list_;
MolecularInformation information_;
QComboBox* selector_edit_;
QComboBox* smarts_edit_;
// the context menus
QMenu context_menu_,
model_menu_,
edit_menu_,
color_menu_[MODEL_LABEL - MODEL_LINES];
QMenu* rotamer_menu_;
Composite* context_composite_;
QTreeWidgetItem* context_item_;
ModelType selected_model_;
ColoringMethod selected_coloring_method_;
std::map<Composite*, MyTreeWidgetItem*> composite_to_item_;
// let cut know to delete the entries, set by deleteCurrentItems()
bool was_delete_;
Size nr_items_removed_;
bool show_ss_;
QAction* center_camera_action_, *composite_properties_action_, *bond_propertes_action_, *disulfidbond_action_,
*select_action_, *deselect_action_, *count_items_action_, *atom_overview_, *atom_overview_selection_,
*angle_action_, *distance_action_, *paste_action_;
bool ignore_messages_;
QSignalMapper* rotamer_mapper_;
Residue* current_residue_;
RotamerLibrary* rotamer_library_;
ReadWriteLock rotamer_library_mutex_;
QThread* rl_thread_;
};
}} // namespaces
#endif // BALL_VIEW_WIDGETS_MOLECULARCONTROL_H
BALL_DEPRECATED
#define BALL_DEPRECATED
Definition COMMON/global.h:64
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition COMMON/global.h:52
common.h
BALL::Atom
Definition atom.h:90
BALL::Composite
Definition composite.h:74
BALL::INIFile
Definition INIFile.h:29
BALL::MolecularInformation
Definition molecularInformation.h:23
BALL::Residue
Definition residue.h:38
BALL::RotamerLibrary
Rotamer Library Class.
Definition rotamerLibrary.h:34
BALL::String
Definition string.h:57
BALL::VIEW::BondProperties
Definition bondProperties.h:28
BALL::VIEW::GenericControl::GenericControl
GenericControl(QWidget *parent=0, const char *name=0)
BALL::VIEW::MainControl
Definition mainControl.h:118
BALL::VIEW::Message
Definition message.h:53
BALL::VIEW::MolecularControl::removeRecursive_
void removeRecursive_(QTreeWidgetItem *item)
BALL::VIEW::MolecularControl::highlightSelection
void highlightSelection()
BALL::VIEW::MolecularControl::context_item_
QTreeWidgetItem * context_item_
Definition molecularControl.h:463
BALL::VIEW::MolecularControl::getContextComposite
Composite * getContextComposite()
BALL::VIEW::MolecularControl::expandAll
void expandAll()
Expand all QListViewItem.
BALL::VIEW::MolecularControl::deselect_id_
QAction * deselect_id_
Definition molecularControl.h:440
BALL::VIEW::MolecularControl::countItems
void countItems()
Count the molecular items and print the info.
BALL::VIEW::MolecularControl::current_residue_
Residue * current_residue_
Definition molecularControl.h:482
BALL::VIEW::MolecularControl::bondProperties
void bondProperties()
Bond properties dialog requested.
BALL::VIEW::MolecularControl::applySelector
Size applySelector(const String &expression)
BALL::VIEW::MolecularControl::showSelectorHelp
BALL_DEPRECATED void showSelectorHelp()
BALL::VIEW::MolecularControl::clearSelector
virtual void clearSelector()
Connected to the clear selection button.
BALL::VIEW::MolecularControl::rotamer_library_
RotamerLibrary * rotamer_library_
Definition molecularControl.h:483
BALL::VIEW::MolecularControl::delete_id_
QAction * delete_id_
Definition molecularControl.h:440
BALL::VIEW::MolecularControl::paste_action_
QAction * paste_action_
Definition molecularControl.h:477
BALL::VIEW::MolecularControl::context_composite_
Composite * context_composite_
Definition molecularControl.h:461
BALL::VIEW::MolecularControl::showFilename
void showFilename()
Show the filename from which the composite was loaded.
BALL::VIEW::MolecularControl::pasteAllowedFor_
bool pasteAllowedFor_(Composite &composite)
BALL::VIEW::MolecularControl::fetchPreferences
void fetchPreferences(INIFile &inifile)
BALL::VIEW::MolecularControl::disulfidbond_action_
QAction * disulfidbond_action_
Definition molecularControl.h:475
BALL::VIEW::MolecularControl::onItemClicked
void onItemClicked(QTreeWidgetItem *item, int)
BALL::VIEW::MolecularControl::paste
void paste()
BALL::VIEW::MolecularControl::copy_list_
std::list< Composite * > copy_list_
Definition molecularControl.h:446
BALL::VIEW::MolecularControl::composite_properties_action_
QAction * composite_properties_action_
Definition molecularControl.h:475
BALL::VIEW::MolecularControl::getInformationVisitor_
virtual MolecularInformation & getInformationVisitor_()
BALL::VIEW::MolecularControl::deselect
void deselect()
BALL::VIEW::MolecularControl::createRepresentation_
void createRepresentation_()
BALL::VIEW::MolecularControl::writePreferences
void writePreferences(INIFile &inifile)
BALL::VIEW::MolecularControl::show_ss_
bool show_ss_
Definition molecularControl.h:474
BALL::VIEW::MolecularControl::rotamer_library_mutex_
ReadWriteLock rotamer_library_mutex_
Definition molecularControl.h:484
BALL::VIEW::MolecularControl::getContextMenu
QMenu & getContextMenu()
BALL::VIEW::MolecularControl::ignore_messages_
bool ignore_messages_
Definition molecularControl.h:479
BALL::VIEW::MolecularControl::selected_coloring_method_
ColoringMethod selected_coloring_method_
Definition molecularControl.h:466
BALL::VIEW::MolecularControl::switchShowSecondaryStructure
void switchShowSecondaryStructure()
BALL::VIEW::MolecularControl::recurseGeneration_
virtual void recurseGeneration_(QTreeWidgetItem *item, Composite &composite)
BALL::VIEW::MolecularControl::deselect_action_
QAction * deselect_action_
Definition molecularControl.h:476
BALL::VIEW::MolecularControl::bond_propertes_action_
QAction * bond_propertes_action_
Definition molecularControl.h:475
BALL::VIEW::MolecularControl::angle_action_
QAction * angle_action_
Definition molecularControl.h:477
BALL::VIEW::MolecularControl::atom_overview_
QAction * atom_overview_
Definition molecularControl.h:476
BALL::VIEW::MolecularControl::color_menu_
QMenu color_menu_[MODEL_LABEL - MODEL_LINES]
Definition molecularControl.h:457
BALL::VIEW::MolecularControl::moveItems
void moveItems()
Move a composite.
BALL::VIEW::MolecularControl::showDistance
void showDistance(Atom *a1, Atom *a2)
BALL::VIEW::MolecularControl::removeComposite
Size removeComposite(Composite &composite)
BALL::VIEW::MolecularControl::BondProperties
friend class BondProperties
Definition molecularControl.h:101
BALL::VIEW::MolecularControl::clipboard_id_
QAction * clipboard_id_
Definition molecularControl.h:440
BALL::VIEW::MolecularControl::was_delete_
bool was_delete_
Definition molecularControl.h:470
BALL::VIEW::MolecularControl::distance_action_
QAction * distance_action_
Definition molecularControl.h:477
BALL::VIEW::MolecularControl::checkResidue
void checkResidue()
BALL::VIEW::MolecularControl::enableUpdates_
void enableUpdates_(bool state)
BALL::VIEW::MolecularControl::edit_menu_
QMenu edit_menu_
Definition molecularControl.h:456
BALL::VIEW::MolecularControl::updateSelection
virtual void updateSelection()
BALL::VIEW::MolecularControl::buildRotamerMenu_
void buildRotamerMenu_()
BALL::VIEW::MolecularControl::showAtomOverview
void showAtomOverview()
BALL::VIEW::MolecularControl::paste_id_
QAction * paste_id_
Definition molecularControl.h:440
BALL::VIEW::MolecularControl::atom_overview_selection_
QAction * atom_overview_selection_
Definition molecularControl.h:476
BALL::VIEW::MolecularControl::context_menu_
QMenu context_menu_
Definition molecularControl.h:454
BALL::VIEW::MolecularControl::getSelection
const std::list< Composite * > & getSelection() const
BALL::VIEW::MolecularControl::composite_to_item_
std::map< Composite *, MyTreeWidgetItem * > composite_to_item_
Definition molecularControl.h:467
BALL::VIEW::MolecularControl::rl_thread_
QThread * rl_thread_
Definition molecularControl.h:485
BALL::VIEW::MolecularControl::compositeProperties
void compositeProperties()
Composite properties dialog requested.
BALL::VIEW::MolecularControl::updateContextMenu
virtual void updateContextMenu(Composite &composite)
BALL::VIEW::MolecularControl::setSelection_
void setSelection_(bool open, bool force=false)
BALL::VIEW::MolecularControl::checkMenu
virtual void checkMenu(VIEW::MainControl &main_control)
BALL::VIEW::MolecularControl::highlight
void highlight(const std::list< Composite * > &composite)
BALL::VIEW::MolecularControl::model_menu_
QMenu model_menu_
Definition molecularControl.h:455
BALL::VIEW::MolecularControl::nr_items_removed_
Size nr_items_removed_
Definition molecularControl.h:472
BALL::VIEW::MolecularControl::select_action_
QAction * select_action_
Definition molecularControl.h:476
BALL::VIEW::MolecularControl::MolecularControl
MolecularControl(QWidget *parent=0, const char *name=0)
BALL::VIEW::MolecularControl::cut_id_
QAction * cut_id_
Definition molecularControl.h:440
BALL::VIEW::MolecularControl::collapseAll
void collapseAll()
Collapse all QListViewItem.
BALL::VIEW::MolecularControl::onNotify
virtual void onNotify(Message *message)
BALL::VIEW::MolecularControl::buildContextMenu_
void buildContextMenu_()
BALL::VIEW::MolecularControl::buildBonds
void buildBonds()
BALL::VIEW::MolecularControl::showGuestContextMenu
void showGuestContextMenu(const QPoint &pos)
BALL::VIEW::MolecularControl::showAngle
void showAngle(Atom *a1, Atom *a2, Atom *a3, Atom *a4=0)
BALL::VIEW::MolecularControl::centerCamera
void centerCamera()
BALL::VIEW::MolecularControl::allowPaste_
bool allowPaste_()
BALL::VIEW::MolecularControl::getAllItems_
std::list< QTreeWidgetItem * > getAllItems_()
BALL::VIEW::MolecularControl::copy_id_
QAction * copy_id_
Definition molecularControl.h:440
BALL::VIEW::MolecularControl::generateListViewItem_
QTreeWidgetItem * generateListViewItem_(QTreeWidgetItem *parent, Composite &composite, QString *default_name=0)
BALL::VIEW::MolecularControl::count_items_action_
QAction * count_items_action_
Definition molecularControl.h:476
BALL::VIEW::MolecularControl::selected_
std::list< Composite * > selected_
Definition molecularControl.h:445
BALL::VIEW::MolecularControl::select
void select()
BALL::VIEW::MolecularControl::copy
void copy()
BALL::VIEW::MolecularControl::selected_model_
ModelType selected_model_
Definition molecularControl.h:465
BALL::VIEW::MolecularControl::newSelection_
void newSelection_(std::list< Composite * > &sel, bool selected)
BALL::VIEW::MolecularControl::cut
void cut()
BALL::VIEW::MolecularControl::clearClipboard
void clearClipboard()
BALL::VIEW::MolecularControl::addComposite
void addComposite(Composite &composite, String given_name="")
BALL::VIEW::MolecularControl::rotamer_mapper_
QSignalMapper * rotamer_mapper_
Definition molecularControl.h:481
BALL::VIEW::MolecularControl::createRepresentation
void createRepresentation()
Create a Representation with the DisplayProperties Dialog.
BALL::VIEW::MolecularControl::rotamer_menu_
QMenu * rotamer_menu_
Definition molecularControl.h:459
BALL::VIEW::MolecularControl::showAtomOverviewForSelection
void showAtomOverviewForSelection()
BALL::VIEW::MolecularControl::show_ss_id_
QAction * show_ss_id_
Definition molecularControl.h:441
BALL::VIEW::MolecularControl::changeRotamer_
void changeRotamer_(int i)
BALL::VIEW::MolecularControl::information_
MolecularInformation information_
Definition molecularControl.h:448
BALL::VIEW::MolecularControl::center_camera_action_
QAction * center_camera_action_
Definition molecularControl.h:475
BALL::VIEW::MolecularControl::reactToMessages_
virtual bool reactToMessages_(Message *message)
BALL::VIEW::MolecularControl::activatedItem_
void activatedItem_(QAction *action)
BALL::VIEW::MolecularControl::deleteCurrentItems
virtual void deleteCurrentItems()
Overloaded from GenericControl, calls cut.
BALL::VIEW::MolecularControl::selector_edit_
QComboBox * selector_edit_
Definition molecularControl.h:450
BALL::VIEW::MolecularControl::smarts_edit_
QComboBox * smarts_edit_
Definition molecularControl.h:451
BALL::VIEW::MolecularControl::select_id_
QAction * select_id_
Definition molecularControl.h:440
BALL::VIEW::MolecularControl::initializeWidget
virtual void initializeWidget(MainControl &main_control)
BALL::VIEW::MolecularControl::toggleDisulfidBond
void toggleDisulfidBond()
Create a disulfid bond.
QThread
QTreeWidgetItem
QTreeWidget
QWidget
BALL_EMBEDDABLE
#define BALL_EMBEDDABLE(TYPE, BASE)
Definition embeddable.h:31
genericControl.h
molecularInformation.h
mutex.h
BALL::VIEW
Definition constraints.h:35
BALL::VIEW::ColoringMethod
ColoringMethod
Definition VIEW/KERNEL/common.h:243
BALL::VIEW::ModelType
ModelType
Definition VIEW/KERNEL/common.h:166
BALL::VIEW::MODEL_LINES
@ MODEL_LINES
defines the property for the model: Lines
Definition VIEW/KERNEL/common.h:168
BALL::VIEW::MODEL_LABEL
@ MODEL_LABEL
defines the property for the model: Label
Definition VIEW/KERNEL/common.h:205
BALL
Definition constants.h:13
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114
BALL::ReadWriteLock
TReadWriteLock< BALL_DEFAULT_READWRITELOCK_TYPE > ReadWriteLock
Definition mutex.h:225
std
STL namespace.