SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
A base class that maintains a diagram based on the results of operations which modify the state of the diagram's objective. More...
#include <qtResourceDiagram.h>
Classes | |
struct | ResourceRules |
A collection of component-filters applied to a resource to identify objects to include/exclude. More... | |
struct | VisualComparator |
A comparator used to order leaf nodes around the diagram's circumference. More... | |
Public Types | |
using | ObjectRules = std::unordered_map< smtk::string::Token, ResourceRules > |
A map from resource type-names to rules for accepting/rejecting persistent objects. | |
using | ArcLegendEntries = std::unordered_map< smtk::string::Token, qtDiagramLegendEntry * > |
using | NodeEdge = std::vector< qtBaseNode * > |
Type-aliases for the containers that represent the diagram's layout. More... | |
using | NodeTree = std::set< NodeEdge, VisualComparator > |
A circumferential ordering of node "edges". | |
Public Types inherited from smtk::extension::qtDiagramGenerator | |
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 | |
smtkTypenameMacro (smtk::extension::qtResourceDiagram) | |
smtkSuperclassMacro (qtDiagramGenerator) | |
qtResourceDiagram (const smtk::view::Information &info, const smtk::view::Configuration::Component &config, qtDiagram *parent) | |
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) override |
Called when an operation completes. | |
qtResourceDiagramSummary * | summarizer () const |
Return an item used to display metadata when a qtBaseNode is hovered. More... | |
qtBaseNode * | root () const |
Return the root node of the diagram (if it exists yet… it may not). | |
bool | acceptDropProposal (QDragEnterEvent *event) override |
Drag-and-drop support. More... | |
void | moveDropPoint (QDragMoveEvent *event) override |
Update any drop preview to the location in the provided event. More... | |
void | abortDrop (QDragLeaveEvent *event) override |
Clean up any drop preview; the user has aborted the drag-and-drop. More... | |
bool | acceptDrop (QDropEvent *event) override |
Return true if this generator accepts the drag-and-drop data at the finalized location. More... | |
bool | addConfiguration (nlohmann::json &config) const override |
Save/load diagram state. More... | |
bool | configure (const nlohmann::json &config) override |
Fetch configuration data for this generator from the diagram's overall config. | |
double | shortArcOpacity () const |
Methods used by arc/node paint() methods to determine visual properties. More... | |
bool | setShortArcOpacity (double value) |
double | longArcOpacityAdjustment () const |
Set/get the amount to adjust opacity for extremely long arcs. More... | |
bool | setLongArcOpacityAdjustment (double value) |
double | beta () const |
Set/get the control-polygon "tightness" adjustment factor, beta. More... | |
bool | setBeta (double value) |
double | nodeSpacing () const |
Set/get the spacing factor for placing nodes along the circumference of a circle. More... | |
bool | setNodeSpacing (double value) |
Public Member Functions inherited from smtk::extension::qtDiagramGenerator | |
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... | |
Protected Slots | |
void | updateArcsOfSendingNode () |
Identify arcs that need updating when a node is moved. More... | |
void | updateArcsOfNode (qtBaseNode *node) |
Identify arcs that need updating when a node (not necessarily a leaf node) is moved. | |
Protected Member Functions | |
void | addArcsOfNodeRecursive (qtBaseNode *node, std::unordered_set< qtBaseArc * > &arcs) |
Used by updateArcsOfNode to find arcs attached to node and all its children. | |
void | removeFromLayout (const std::unordered_set< smtk::resource::PersistentObject * > &expunged) |
Used by updateScene to cleans the layout of expunged nodes before removing the nodes from the scene. | |
void | generateLayout (bool zoomToLayout) |
Create a layout of the nodes. More... | |
bool | acceptObject (const smtk::resource::PersistentObject *obj) const |
template<bool HandleReparentedObjects> | |
bool | updateParentArc (smtk::resource::PersistentObject *object, ArcLegendEntries ®isteredArcTypes) |
template<bool RemoveUnusedArcs> | |
bool | updateGraphArcs (smtk::resource::PersistentObject *object, ArcLegendEntries ®isteredArcTypes) |
Protected Attributes | |
std::unordered_map< smtk::string::Token, qtBaseNode * > | m_groupingNodes |
Hold a map of non-object nodes used to group objects together. More... | |
std::set< std::vector< qtBaseNode * >, VisualComparator > | m_diagramNodes |
The set of all leaf nodes and all arcs this diagram maintains. More... | |
std::unordered_set< qtBaseArc * > | m_diagramArcs |
qtResourceDiagramSummary * | m_summarizer |
An item that shows a summary of a node. | |
nlohmann::json | m_groupItemData |
Configuration information provided out-of-band by operations that produce application state in addition to changes to persistent objects. More... | |
double | m_shortArcOpacity { 1.0 } |
double | m_longArcOpacityAdjustment { 0.75 } |
double | m_beta { 0.9 } |
double | m_nodeSpacing { 1.125 } |
std::unordered_set< smtk::string::Token > | m_classExclusions |
ObjectRules | m_acceptsRules |
ObjectRules | m_rejectsRules |
Protected Attributes inherited from smtk::extension::qtDiagramGenerator | |
qtDiagram * | m_diagram { nullptr } |
The parent diagram. | |
A base class that maintains a diagram based on the results of operations which modify the state of the diagram's objective.
using smtk::extension::qtResourceDiagram::NodeEdge = std::vector<qtBaseNode*> |
Type-aliases for the containers that represent the diagram's layout.
A radial "edge" of nodes starting at the diagram root and moving outward.
|
inlineoverridevirtual |
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 from smtk::extension::qtDiagramGenerator.
|
inlineoverridevirtual |
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 from smtk::extension::qtDiagramGenerator.
|
inlineoverridevirtual |
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 from smtk::extension::qtDiagramGenerator.
|
overridevirtual |
Save/load diagram state.
Add this generator's configuration data to the diagram's overall config.
Reimplemented from smtk::extension::qtDiagramGenerator.
|
inline |
Set/get the control-polygon "tightness" adjustment factor, beta.
Values near 1.0 produce arcs that conform closely to the tree. Values near 0.0 produce arcs that go nearly straight from node to node. The default is 0.9.
This parameter is named β to match the Hierarchical Edge Bundles paper by Holten.
|
protected |
Create a layout of the nodes.
If zoomToLayout is true, then qtDiagram::includeInView() will be called with the bounds of the diagram because 1 or more nodes/arcs have been modified.
|
inline |
Set/get the amount to adjust opacity for extremely long arcs.
The default is 0.75.
Opacity for an arc with N hops is computed as O1 - O2 * (1 - exp(min(0, 3 - N))), where O1 is shortArcOpacity() and O2 is longArcOpacityAdjustment().
|
inlineoverridevirtual |
Update any drop preview to the location in the provided event.
This is only called after your acceptDropProposal method returns true.
Reimplemented from smtk::extension::qtDiagramGenerator.
|
inline |
Set/get the spacing factor for placing nodes along the circumference of a circle.
When the spacing factor is 1.0, the circle's radius is chosen such that nodes will be tightly packed around the circle (no space between nodes but no overlap). Values less than 1.0 will cause nodes to overlap. Values larger than 1.0 will leave space between nodes.
The default is 1.125. Only positive values are accepted.
|
inline |
Methods used by arc/node paint() methods to determine visual properties.
Set/get the opacity to use for short arcs (<= 3 hops). The default is 1.0;
|
inline |
Return an item used to display metadata when a qtBaseNode is hovered.
This item never has its configuration serialized.
|
protectedslot |
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, updateArcsOfNode() is called with that node.
|
protected |
The set of all leaf nodes and all arcs this diagram maintains.
These are used to update a fixed layout for the diagram each time an operation runs.
|
protected |
Hold a map of non-object nodes used to group objects together.
(Note that object-based nodes may also group objects together, e.g., comments may be grouped underneath their subject node.)
|
protected |
Configuration information provided out-of-band by operations that produce application state in addition to changes to persistent objects.
This particular information is currently (x,y)-locations, names, and node IDs of grouping nodes computed (or loaded off disk) by operations. It is provided via configure() during the operation and will eventually be used to populate m_groupingNodes by updateScene() (called by the operation's observers).