SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
An object to handle modal interaction in a diagram view. More...
#include <qtDiagramViewMode.h>
Public Types | |
using | Superclass = QObject |
Public Member Functions | |
qtDiagramViewMode (smtk::string::Token modeName, qtDiagram *diagram, QToolBar *toolbar, QActionGroup *modeGroup) | |
Construct a mode for diagram and add it to toolbar and modeGroup. | |
QAction * | modeAction () const |
bool | isModeActive () const |
Protected Member Functions | |
virtual void | sceneCleared (qtDiagramGenerator *=nullptr) |
This method is called by diagram generators as the scene is cleared. More... | |
virtual void | exitMode () |
This method is called by the diagram as the mode is being changed away from this class. More... | |
virtual void | enterMode () |
This method is called by the diagram as the mode is being changed to this class. More... | |
virtual void | updateFromOperation (std::unordered_set< smtk::resource::PersistentObject * > &created, std::unordered_set< smtk::resource::PersistentObject * > &modified, std::unordered_set< smtk::resource::PersistentObject * > &expunged, const smtk::operation::Operation &operation, const smtk::operation::Operation::Result &result) |
This method is called by the diagram when an operation is observed. More... | |
bool | removeSelectedObjects () |
A method subclasses may call to invoke deleters on the view's selection. | |
Protected Attributes | |
smtk::string::Token | m_modeName |
qtDiagram * | m_diagram { nullptr } |
QAction * | m_modeAction { nullptr } |
Friends | |
class | qtDiagram |
class | qtDiagramGenerator |
An object to handle modal interaction in a diagram view.
Subclasses of this object control how objects in the QSceneGraph respond to user input by installing event filters and setting item flags.
This base class provides the functionality to create a QAction for a QActionGroup that is inserted into the view's QToolBar to switch modes. When the action is invoked, a mode change is requested (and the mode becomes active at some later point after any prior mode has an opportunity to finalize itself).
|
inlineprotectedvirtual |
This method is called by the diagram as the mode is being changed to this class.
Subclasses should override this method to prepare the scene (such as enabling/disabling items in the scene, adding items to be drawn while the mode is active, etc.)
Reimplemented in smtk::extension::qtConnectMode, smtk::extension::qtDisconnectMode, smtk::extension::qtPanMode, and smtk::extension::qtSelectMode.
|
inlineprotectedvirtual |
This method is called by the diagram as the mode is being changed away from this class.
Subclasses should override this method to prepare the scene (such as enabling/disabling items in the scene, removing items drawn while the mode was active, etc.)
Reimplemented in smtk::extension::qtConnectMode, smtk::extension::qtDisconnectMode, smtk::extension::qtPanMode, and smtk::extension::qtSelectMode.
|
inlineprotectedvirtual |
This method is called by diagram generators as the scene is cleared.
Subclasses which add items to the scene need to override this method to recreate their internal items.
Reimplemented in smtk::extension::qtConnectMode.
|
inlineprotectedvirtual |
This method is called by the diagram when an operation is observed.
Subclasses may override this if they have state related to persistent objects in order to adapt to those objects being modified or expunged.
Reimplemented in smtk::extension::qtConnectMode.