SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
A Graphical Item that represents a node connected by arcs in a scene. More...
#include <qtBaseNode.h>
Public Types | |
enum | ContentStyle : int { ContentStyle::Minimal, ContentStyle::Summary, ContentStyle::Details } |
Determine how the node is presented to users. More... | |
Signals | |
void | nodeResized () |
void | nodeMoved () |
Public Member Functions | |
smtkSuperclassMacro (QGraphicsObject) | |
smtkTypeMacroBase (smtk::extension::qtBaseNode) | |
qtBaseNode (qtDiagramGenerator *scene, QGraphicsItem *parent=nullptr) | |
QRectF | boundingRect () const override |
Return a dummy bounding-rect. More... | |
virtual smtk::common::UUID | nodeId () const =0 |
Return a UUID for this node. | |
qtDiagramGenerator * | generator () const |
Return the generator responsible for this node. | |
qtDiagram * | diagram () const |
Return the diagram which owns the generator of this node. | |
qtDiagramScene * | scene () const |
Return the scene this node belongs to. | |
virtual std::string | name () const =0 |
Nodes must provide a textual name used for sorting and presentation to users. | |
virtual void | setContentStyle (ContentStyle cs) |
Set/get how much data the node should render inside its boundary. | |
ContentStyle | contentStyle () const |
virtual void | dataUpdated () |
Deal with updates (e.g., a configuration change that affects the node's visual appearance or interaction style). More... | |
Protected Member Functions | |
QVariant | itemChange (GraphicsItemChange change, const QVariant &value) override |
virtual int | updateSize () |
Update the node bounds to fit its content. | |
void | addToScene () |
Adds the node to the scene. More... | |
Protected Attributes | |
qtDiagramGenerator * | m_generator { nullptr } |
ContentStyle | m_contentStyle { ContentStyle::Minimal } |
Properties | |
ContentStyle | contentStyle |
A Graphical Item that represents a node connected by arcs in a scene.
Any object that the qtDiagramScene should be able to lay out as a graph must inherit this class. Note that grouping nodes do not necessarily have to be persistent objects, so this class just assumes that each instance can provide a UUID along with connections (of various edge types) to other qtBaseNode instances via a qtBaseArc instance.
|
strong |
|
protected |
Adds the node to the scene.
NOTE: since qtBaseNode class does not have any UI geometry associated with it, it will not automatically add itself to the Task Scene. Derived classes should call this method after its UI geometry has been setup
|
override |
Return a dummy bounding-rect.
Without this, calling this->setCursor() in the qtBaseNode constructor results in a pure virtual function call (as the subclass that implements the actual bounding-box computation has not yet been initialized).
|
inlinevirtual |
Deal with updates (e.g., a configuration change that affects the node's visual appearance or interaction style).
This method is invoked when an operation makes changes to the data the node represents.
Reimplemented in smtk::extension::qtBaseTaskNode, smtk::extension::qtTaskNode, smtk::extension::qtDefaultTaskNode1, smtk::extension::qtDefaultTaskNode, smtk::extension::qtGroupingNode, smtk::extension::qtComponentNode, and smtk::extension::qtResourceNode.