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

A base class that maintains a diagram in the face of operations which modify the state of the diagram's objective. More...

#include <qtDiagramGenerator.h>

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

Public Types

using ArcLegendEntries = std::unordered_map< smtk::string::Token, qtDiagramLegendEntry * >
 Subclasses may use this to pass information about arc types registered with the legend.
 

Public Slots

void updateArcsOfSendingNodeRecursive ()
 Identify arcs that need updating when a node is moved. More...
 
void updateArcsOfNodeRecursive (qtBaseNode *node)
 Identify arcs that need updating when a node (not necessarily a leaf node) is moved.
 

Public Member Functions

 smtkTypenameMacroBase (qtDiagramGenerator)
 
 smtkSuperclassMacro (QObject)
 
 qtDiagramGenerator (const smtk::view::Information &info, const smtk::view::Configuration::Component &config, qtDiagram *parent)
 Create a generator from configuration information.
 
qtDiagramdiagram () const
 Return the diagram this generator inserts content into.
 
void sceneCleared ()
 Called by subclasses to notify qtDiagramViewMode instances that the generator's items have been cleared. More...
 
virtual void updateScene (std::unordered_set< smtk::resource::PersistentObject * > &, std::unordered_set< smtk::resource::PersistentObject * > &, std::unordered_set< smtk::resource::PersistentObject * > &, const smtk::operation::Operation &, const smtk::operation::Operation::Result &)
 Diagram update methodsCalled when an operation completes. More...
 
virtual void updateSceneNodes (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)
 Diagram update methodsCalled when an operation completes. More...
 
virtual void updateSceneArcs (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)=0
 Diagram update methodsCalled when an operation completes. More...
 
virtual bool acceptDropProposal (QDragEnterEvent *event)
 Drag-and-drop support. More...
 
virtual void moveDropPoint (QDragMoveEvent *event)
 Update any drop preview to the location in the provided event. More...
 
virtual void abortDrop (QDragLeaveEvent *event)
 Clean up any drop preview; the user has aborted the drag-and-drop. More...
 
virtual bool acceptDrop (QDropEvent *event)
 Return true if this generator accepts the drag-and-drop data at the finalized location. More...
 
virtual bool addConfiguration (nlohmann::json &config) const
 Save/load diagram state. More...
 
virtual bool configure (const nlohmann::json &config)
 Fetch configuration data for this generator from the diagram's overall config.
 

Protected Member Functions

void addArcsOfNodeRecursive (qtBaseNode *node, std::unordered_set< qtBaseArc * > &arcs)
 Used by updateArcsOfNodeRecursive to find arcs attached to node and all its children.
 

Protected Attributes

qtDiagramm_diagram { nullptr }
 The parent diagram.
 

Detailed Description

A base class that maintains a diagram in the face of operations which modify the state of the diagram's objective.

Member Function Documentation

◆ abortDrop()

virtual void smtk::extension::qtDiagramGenerator::abortDrop ( QDragLeaveEvent *  event)
inlinevirtual

Clean up any drop preview; the user has aborted the drag-and-drop.

This may only be called after your acceptDropProposal method returns true.

Reimplemented in smtk::extension::qtResourceDiagram, and smtk::extension::qtTaskEditor.

◆ acceptDrop()

virtual bool smtk::extension::qtDiagramGenerator::acceptDrop ( QDropEvent *  event)
inlinevirtual

Return true if this generator accepts the drag-and-drop data at the finalized location.

This may only be called after your acceptDropProposal method returns true.

Reimplemented in smtk::extension::qtResourceDiagram, and smtk::extension::qtTaskEditor.

◆ acceptDropProposal()

virtual bool smtk::extension::qtDiagramGenerator::acceptDropProposal ( QDragEnterEvent *  event)
inlinevirtual

Drag-and-drop support.

Returns true if this generator wishes to handle the proposed drag-and-drop mime data.

If your subclass returns true, then be prepared to receive 0 or more calls to moveDropPoint followed by either abortDrop or acceptDrop (depending on user input).

Reimplemented in smtk::extension::qtResourceDiagram, and smtk::extension::qtTaskEditor.

◆ addConfiguration()

virtual bool smtk::extension::qtDiagramGenerator::addConfiguration ( nlohmann::json &  config) const
inlinevirtual

Save/load diagram state.

Add this generator's configuration data to the diagram's overall config.

Reimplemented in smtk::extension::qtResourceDiagram.

◆ moveDropPoint()

virtual void smtk::extension::qtDiagramGenerator::moveDropPoint ( QDragMoveEvent *  event)
inlinevirtual

Update any drop preview to the location in the provided event.

This is only called after your acceptDropProposal method returns true.

Reimplemented in smtk::extension::qtResourceDiagram, and smtk::extension::qtTaskEditor.

◆ sceneCleared()

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

Called by subclasses to notify qtDiagramViewMode instances that the generator's items have been cleared.

Modes which add scene items via a qtDiagramGenerator may need to re-insert items into the scene.

◆ updateArcsOfSendingNodeRecursive

void smtk::extension::qtDiagramGenerator::updateArcsOfSendingNodeRecursive ( )
slot

Identify arcs that need updating when a node is moved.

The node is identified by examining the sender of the signal, not by an argument. Then, updateArcsOfNodeRecursive() is called with that node.

◆ updateScene()

virtual void smtk::extension::qtDiagramGenerator::updateScene ( std::unordered_set< smtk::resource::PersistentObject * > &  ,
std::unordered_set< smtk::resource::PersistentObject * > &  ,
std::unordered_set< smtk::resource::PersistentObject * > &  ,
const smtk::operation::Operation ,
const smtk::operation::Operation::Result  
)
inlinevirtual

Diagram update methodsCalled when an operation completes.

Each diagram generator is invoked with the same values and a generator prior to this instance may already have created or expunged items in the scene corresponding to the created or expunged objects; be sure to check the diagram's node index before blindly adding/removing scene items.

◆ updateSceneArcs()

virtual void smtk::extension::qtDiagramGenerator::updateSceneArcs ( 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 
)
pure virtual

Diagram update methodsCalled when an operation completes.

Each diagram generator is invoked with the same values and a generator prior to this instance may already have created or expunged items in the scene corresponding to the created or expunged objects; be sure to check the diagram's node index before blindly adding/removing scene items.

Implemented in smtk::extension::qtResourceDiagram, and smtk::extension::qtTaskEditor.

◆ updateSceneNodes()

void smtk::extension::qtDiagramGenerator::updateSceneNodes ( 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 
)
virtual

Diagram update methodsCalled when an operation completes.

Each diagram generator is invoked with the same values and a generator prior to this instance may already have created or expunged items in the scene corresponding to the created or expunged objects; be sure to check the diagram's node index before blindly adding/removing scene items.

Reimplemented in smtk::extension::qtResourceDiagram, and smtk::extension::qtTaskEditor.


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