SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Public Types | Public Slots | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
smtk::extension::qtConnectMode Class Reference

A mode where clicking on a pair of objects will launch an operation to connect them with an arc. More...

#include <qtConnectMode.h>

Inheritance diagram for smtk::extension::qtConnectMode:
[legend]
Collaboration diagram for smtk::extension::qtConnectMode:
[legend]

Public Types

using Superclass = qtDiagramViewMode
 
- Public Types inherited from smtk::extension::qtDiagramViewMode
using Superclass = QObject
 

Public Slots

void hoverConnectNode (qtBaseObjectNode *node)
 
void clickConnectNode (qtBaseObjectNode *node)
 
void abandonConnection ()
 

Public Member Functions

 qtConnectMode (qtDiagram *diagram, qtDiagramView *view, QToolBar *toolbar, QActionGroup *modeGroup)
 Construct a mode for diagram and add it to toolbar and modeGroup.
 
qtPreviewArcpreviewArc () const
 Return the preview arc this mode uses to indicate potential connections.
 
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) override
 Ensure the preview arc does not become invalid when objects are expunged.
 
- Public Member Functions inherited from smtk::extension::qtDiagramViewMode
 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

bool eventFilter (QObject *obj, QEvent *event) override
 
void sceneCleared (qtDiagramGenerator *generator) override
 This method is called by diagram generators as the scene is cleared. More...
 
void enterMode () override
 This method is called by the diagram as the mode is being changed to this class. More...
 
void exitMode () override
 This method is called by the diagram as the mode is being changed away from this class. More...
 
void updateArcTypes ()
 
void setConnectionType (int arcTypeItemIndex)
 
- Protected Member Functions inherited from smtk::extension::qtDiagramViewMode
bool removeSelectedObjects ()
 A method subclasses may call to invoke deleters on the view's selection.
 

Protected Attributes

QPointer< qtPreviewArcm_previewArc
 
QPointer< QComboBox > m_connectType
 
QPointer< QAction > m_connectTypeAction
 
std::shared_ptr< smtk::operation::Managerm_operationManager
 
smtk::operation::GroupObservers::Key m_groupObserverKey
 
- Protected Attributes inherited from smtk::extension::qtDiagramViewMode
smtk::string::Token m_modeName
 
qtDiagramm_diagram { nullptr }
 
QAction * m_modeAction { nullptr }
 

Friends

class qtDiagram
 

Detailed Description

A mode where clicking on a pair of objects will launch an operation to connect them with an arc.

Pressing the escape key after the first object has been selected will restart the arc-creation process. Pressing the escape key when no object has been selected will exit this mode for the diagram's default mode.

Member Function Documentation

◆ enterMode()

void smtk::extension::qtConnectMode::enterMode ( )
overrideprotectedvirtual

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 from smtk::extension::qtDiagramViewMode.

◆ exitMode()

void smtk::extension::qtConnectMode::exitMode ( )
overrideprotectedvirtual

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 from smtk::extension::qtDiagramViewMode.

◆ sceneCleared()

void smtk::extension::qtConnectMode::sceneCleared ( qtDiagramGenerator )
overrideprotectedvirtual

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 from smtk::extension::qtDiagramViewMode.


The documentation for this class was generated from the following files: