SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
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>
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 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. | |
qtDiagram * | diagram () 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 * > &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 Attributes | |
qtDiagram * | m_diagram { nullptr } |
The parent diagram. | |
A base class that maintains a diagram in the face of operations which modify the state of the diagram's objective.
|
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.
|
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.
|
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.
|
inlinevirtual |
Save/load diagram state.
Add this generator's configuration data to the diagram's overall config.
Reimplemented in smtk::extension::qtResourceDiagram.
|
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.
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.
|
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.