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

A Graphical Item that represents a node connected by arcs in a scene. More...

#include <qtBaseNode.h>

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

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.
 
qtDiagramGeneratorgenerator () const
 Return the generator responsible for this node.
 
qtDiagramdiagram () const
 Return the diagram which owns the generator of this node.
 
qtDiagramScenescene () 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

qtDiagramGeneratorm_generator { nullptr }
 
ContentStyle m_contentStyle { ContentStyle::Minimal }
 

Properties

ContentStyle contentStyle
 

Detailed Description

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.

Member Enumeration Documentation

◆ ContentStyle

Determine how the node is presented to users.

Enumerator
Minimal 

Only the node's title-bar is shown.

Summary 

The node's title bar and a "mini" viewer should be shown.

Details 

The node's full state and any contained view should be shown.

Member Function Documentation

◆ addToScene()

void smtk::extension::qtBaseNode::addToScene ( )
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

◆ boundingRect()

QRectF smtk::extension::qtBaseNode::boundingRect ( ) const
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).

◆ dataUpdated()

virtual void smtk::extension::qtBaseNode::dataUpdated ( )
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.


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