Renders a node in a VuoRendererComposition
.
Definition at line 33 of file VuoRendererNode.hh.
Public Types | |
enum | Type { node , detachedConstant , detachedDrawer , detachedTypecast } |
Specifies how this node is graphically represented. More... | |
Public Types inherited from VuoRendererItem | |
enum | activityState { notTrackingActivity = -1 , activityInProgress = 0 } |
Special composition component activity states. More... | |
enum | zValues { triggerAnimationZValue = 1 , nodeZValue = 0 , portZValue = -1 , attachmentZValue = -2 , cableZValue = -3 , errorMarkZValue = -4 , commentZValue = -5 } |
Stacking order for canvas elements. More... | |
Public Member Functions | |
VuoRendererNode (VuoNode *baseNode, VuoRendererSignaler *signaler) | |
Creates a renderer detail for the specified base node. More... | |
virtual QRectF | boundingRect (void) const |
Returns a rectangle that completely encloses the rendered node (accounting for the thick line width). More... | |
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) |
Draws a standard node, including rectangular frame, and input and output ports. More... | |
virtual QRectF | getOuterNodeFrameBoundingRect (void) const |
Returns the bounding rect for the node's outer frame (excluding ports). More... | |
virtual bool | paintingDisabled (void) const |
Returns a boolean indicating whether painting is currently disabled for this node. More... | |
virtual bool | isEffectivelySelected (void) |
Returns a boolean indicating whether the node should be rendered as if it is selected, regardless of whether it has been directly selected. More... | |
vector< VuoRendererInputDrawer * > | getAttachedInputDrawers (void) const |
Returns a vector containing all of the drawers attached to any of this node's input ports. More... | |
qreal | getInputDrawerOffset (unsigned int portIndex) const |
Returns the horizontal offset necessary to prevent the drawer at portIndex from overlapping any drawers beneath it. More... | |
void | updateNodeFrameRect (void) |
Calculates and updates the cached inner frame of a node based on its current attributes. More... | |
void | setMissingImplementation (bool missingImplementation) |
Sets whether the node is rendered as though its implementation is missing. More... | |
bool | isMissingImplementation (void) |
Returns whether the node is rendered as though its implementation is missing. More... | |
void | setProxyNode (VuoRendererNode *proxyNode) |
If set, this node will not be drawn; its drawing will be handled by proxyNode . More... | |
VuoRendererNode * | getProxyNode (void) const |
Returns this node's rendering proxy. More... | |
VuoRendererTypecastPort * | getProxyCollapsedTypecast (void) const |
Returns the collapsed typecast port rendered in place of this node, or NULL if none. More... | |
void | setAlwaysDisplayPortNames (bool displayPortNames) |
Sets the boolean indicating whether this node's ports, including unambiguous ones, should always have their names displayed. More... | |
bool | nameDisplayEnabledForPort (const VuoRendererPort *port) |
Returns a boolean indicating whether the name of the provided port should be rendered within the node. More... | |
bool | nameDisplayEnabledForInputPorts () |
Returns a boolean indicating whether the names of input ports should be rendered within the node. More... | |
bool | nameDisplayEnabledForOutputPorts () |
Returns a boolean indicating whether the names of output ports should be rendered within the node. More... | |
VuoRendererColors::HighlightType | getEligibilityHighlight (void) |
Returns the highlight that should be used to indicate whether this node contains ports eligible for the current cable drag. More... | |
void | setEligibilityHighlight (VuoRendererColors::HighlightType eligibility) |
Sets whether this node should be highlighted to indicate that it contains ports eligible for the current cable drag. More... | |
QVariant | itemChange (GraphicsItemChange change, const QVariant &value) |
Updates the node and its connected cables to reflect changes in state. More... | |
void | updateGeometry (void) |
Schedules a redraw of this node. More... | |
void | updateConnectedCableGeometry (void) |
Schedules a redraw of this node's connected cables. More... | |
set< VuoCable * > | getConnectedCables (bool includePublishedCables) |
Returns the set of cables connected to this node. More... | |
set< VuoCable * > | getConnectedInputCables (bool includePublishedCables) |
Returns the set of input cables connected to this node. More... | |
set< VuoCable * > | getConnectedOutputCables (bool includePublishedCables) |
Returns the set of output cables connected to this node. More... | |
vector< VuoRendererPort * > & | getInputPorts (void) |
Returns this node's input ports. More... | |
vector< VuoRendererPort * > & | getOutputPorts (void) |
Returns this node's output ports. More... | |
vector< pair< QString, json_object * > > | getConstantPortValues () |
Returns an ordered list of port name-value pairs for the ports that belong to this node and whose values are currently constant. More... | |
void | replaceInputPort (VuoRendererPort *oldPort, VuoRendererPort *newPort) |
Replaces input port old with new . More... | |
void | addInputPort (VuoRendererPort *newPort) |
Adds input port newPort to the node, relocating it to the end of the input port list if it was already present somewhere within the list. More... | |
bool | hasGenericPort (void) |
Returns a boolean indicating whether this node has any ports with generic data types. More... | |
void | setTitle (string title) |
Sets the title for this node; re-lays-out its ports to accommodate the new name. More... | |
void | resetTimeLastExecuted () |
Resets the time last executed to a value that causes the node to be painted as if activity-rendering were disabled. More... | |
void | setExecutionEnded () |
Updates the node's execution state to indicate that it has just finished executing. More... | |
void | setExecutionBegun () |
Updates the node's execution state to indicate that it is currently executing. More... | |
qint64 | getTimeLastExecutionEnded () |
Returns the time, in ms since epoch, that this node's most recent node execution ended, or if applicable, a special VuoRendererItem::activityState. More... | |
void | layoutConnectedInputDrawers (void) |
Calculates and sets the positions of the node's connected input drawers relative to the node. More... | |
void | layoutConnectedInputDrawersAtAndAbovePort (VuoRendererPort *port) |
Calculates and sets the positions of any input drawers connected to this node's ports beginning with the provided port and iterating through the ports rendered above (i.e., with indices lower than) that port. More... | |
void | setCacheModeForNodeAndPorts (QGraphicsItem::CacheMode mode) |
Sets the cache mode of this node and its child ports to mode . More... | |
void | setCacheModeForConnectedCables (QGraphicsItem::CacheMode mode) |
Sets the cache mode of this node's connected cables to mode . More... | |
Public Member Functions inherited from VuoRendererItem | |
void | setSelectable (bool selectable) |
Enables or disables selection for the item. More... | |
Public Member Functions inherited from VuoBaseDetail< VuoNode > | |
VuoBaseDetail (string description, VuoNode *base) | |
Creates a detail class. More... | |
VuoNode * | getBase (void) const |
Returns the detail class instance's base class instance. More... | |
void | setBase (VuoNode *base) |
Sets the detail class instance's base class instance. More... | |
Static Public Member Functions | |
static QPair< QPainterPath, QPainterPath > | getNodeFrames (QRectF nodeInnerFrameRect) |
Returns the outer and inner node frames, in that order, for a node with the provided nodeInnerFrameRect value. More... | |
static QPainterPath | getSubcompositionIndicatorPath (QRectF nodeInnerFrameRect, bool isSubcomposition) |
Returns the path of the subcomposition icon for a node with the provided nodeInnerFrameRect , or an empty path if isSubcomposition is false. More... | |
Static Public Member Functions inherited from VuoRendererItem | |
static void | setSnapToGrid (bool snap) |
Specifies whether graphics items should be snapped to a grid. More... | |
static void | setDrawBoundingRects (bool drawBoundingRects) |
Specifies whether bounding rects will be shown the next time the QGraphicsScene is rendered. More... | |
static bool | shouldDrawBoundingRects (void) |
Returns whether bounding rects are currently being shown. More... | |
static void | drawRect (QPainter *painter, QRectF rect) |
Draws a rect, for debugging. More... | |
static bool | getSnapToGrid () |
Retrieves the boolean indicating whether graphics items should be snapped to a grid. More... | |
Static Public Attributes | |
static const qreal | nodeTitleHeight = 18 |
The height of the node's title. More... | |
static const qreal | nodeHeaderYOffset = -nodeTitleHeight - nodeClassHeight |
The vertical offset of the node header's top left corner from the origin. More... | |
static const qreal | cornerRadius = 10 |
The radius of rounded corners. More... | |
Protected Member Functions | |
virtual void | hoverEnterEvent (QGraphicsSceneHoverEvent *event) |
Handle mouse hover start events. More... | |
virtual void | hoverMoveEvent (QGraphicsSceneHoverEvent *event) |
Handle mouse hover move events. More... | |
virtual void | hoverLeaveEvent (QGraphicsSceneHoverEvent *event) |
Handle mouse hover leave events. More... | |
void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) |
Handle mouse release events. More... | |
void | mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) |
Handle mouse double-click events. More... | |
void | keyPressEvent (QKeyEvent *event) |
Handle key-press events. More... | |
virtual void | layoutPorts (void) |
Calculates and sets the positions of the node's child ports relative to the node. More... | |
Protected Member Functions inherited from VuoRendererItem | |
void | drawBoundingRect (QPainter *painter) |
Draws this item's bounding rect, for debugging. More... | |
bool | getRenderActivity () const |
Retrieves the composition-wide boolean indicating whether recent activity (e.g., a node execution or event firing) by this item should be reflected in its rendering. More... | |
bool | getRenderHiddenCables () const |
Retrieves the composition-wide boolean indicating whether hidden ("wireless") cables should be rendered as if they were not hidden. More... | |
QGraphicsItem::CacheMode | getCurrentDefaultCacheMode () const |
Returns the current default cache mode for components of this composition. More... | |
Protected Attributes | |
VuoRendererSignaler * | signaler |
The object that sends signals on behalf of this renderer node. More... | |
vector< VuoRendererPort * > | inputPorts |
The list of input renderer ports belonging to this renderer node. More... | |
vector< VuoRendererPort * > | outputPorts |
The list of output renderer ports belonging to this renderer node. More... | |
qint64 | timeLastExecutionEnded |
The time at which this node's running counterpart last completed an execution. More... | |
bool | alwaysDisplayPortNames |
Indicates whether this node's ports, even unambiguous ones, should always have their names displayed. More... | |
Additional Inherited Members | |
Static Protected Member Functions inherited from VuoRendererItem | |
static void | addRoundedCorner (QPainterPath &path, bool drawLine, QPointF sharpCornerPoint, qreal radius, bool isTop, bool isLeft) |
Appends a line (or move) and curve to path , to produce a clockwise-wound rounded corner near sharpCornerPoint . More... | |
Specifies how this node is graphically represented.
Definition at line 39 of file VuoRendererNode.hh.
VuoRendererNode::VuoRendererNode | ( | VuoNode * | baseNode, |
VuoRendererSignaler * | signaler | ||
) |
Creates a renderer detail for the specified base node.
Definition at line 36 of file VuoRendererNode.cc.
void VuoRendererNode::addInputPort | ( | VuoRendererPort * | newPort | ) |
Adds input port newPort
to the node, relocating it to the end of the input port list if it was already present somewhere within the list.
Affects only renderer detail ports (not base or compiler ports).
Definition at line 1072 of file VuoRendererNode.cc.
|
virtual |
Returns a rectangle that completely encloses the rendered node (accounting for the thick line width).
Reimplemented in VuoRendererValueListForReadOnlyDictionary, VuoRendererInputListDrawer, and VuoRendererHiddenInputAttachment.
Definition at line 503 of file VuoRendererNode.cc.
vector< VuoRendererInputDrawer * > VuoRendererNode::getAttachedInputDrawers | ( | void | ) | const |
Returns a vector containing all of the drawers attached to any of this node's input ports.
Definition at line 382 of file VuoRendererNode.cc.
set< VuoCable * > VuoRendererNode::getConnectedCables | ( | bool | includePublishedCables | ) |
Returns the set of cables connected to this node.
This includes:
Definition at line 919 of file VuoRendererNode.cc.
set< VuoCable * > VuoRendererNode::getConnectedInputCables | ( | bool | includePublishedCables | ) |
Returns the set of input cables connected to this node.
This includes:
Definition at line 936 of file VuoRendererNode.cc.
set< VuoCable * > VuoRendererNode::getConnectedOutputCables | ( | bool | includePublishedCables | ) |
Returns the set of output cables connected to this node.
This includes:
Definition at line 964 of file VuoRendererNode.cc.
vector< pair< QString, json_object * > > VuoRendererNode::getConstantPortValues | ( | ) |
Returns an ordered list of port name-value pairs for the ports that belong to this node and whose values are currently constant.
Definition at line 1033 of file VuoRendererNode.cc.
VuoRendererColors::HighlightType VuoRendererNode::getEligibilityHighlight | ( | void | ) |
Returns the highlight that should be used to indicate whether this node contains ports eligible for the current cable drag.
Definition at line 1271 of file VuoRendererNode.cc.
qreal VuoRendererNode::getInputDrawerOffset | ( | unsigned int | portIndex | ) | const |
Returns the horizontal offset necessary to prevent the drawer at portIndex
from overlapping any drawers beneath it.
Definition at line 337 of file VuoRendererNode.cc.
vector< VuoRendererPort * > & VuoRendererNode::getInputPorts | ( | void | ) |
Returns this node's input ports.
Definition at line 1014 of file VuoRendererNode.cc.
|
static |
Returns the outer and inner node frames, in that order, for a node with the provided nodeInnerFrameRect
value.
Definition at line 264 of file VuoRendererNode.cc.
|
virtual |
Returns the bounding rect for the node's outer frame (excluding ports).
Reimplemented in VuoRendererValueListForReadOnlyDictionary, and VuoRendererInputListDrawer.
Definition at line 573 of file VuoRendererNode.cc.
vector< VuoRendererPort * > & VuoRendererNode::getOutputPorts | ( | void | ) |
Returns this node's output ports.
Definition at line 1024 of file VuoRendererNode.cc.
VuoRendererTypecastPort * VuoRendererNode::getProxyCollapsedTypecast | ( | void | ) | const |
Returns the collapsed typecast port rendered in place of this node, or NULL if none.
Definition at line 703 of file VuoRendererNode.cc.
VuoRendererNode * VuoRendererNode::getProxyNode | ( | void | ) | const |
Returns this node's rendering proxy.
Definition at line 695 of file VuoRendererNode.cc.
|
static |
Returns the path of the subcomposition icon for a node with the provided nodeInnerFrameRect
, or an empty path if isSubcomposition
is false.
Definition at line 307 of file VuoRendererNode.cc.
qint64 VuoRendererNode::getTimeLastExecutionEnded | ( | ) |
Returns the time, in ms since epoch, that this node's most recent node execution ended, or if applicable, a special VuoRendererItem::activityState.
Definition at line 1152 of file VuoRendererNode.cc.
bool VuoRendererNode::hasGenericPort | ( | void | ) |
Returns a boolean indicating whether this node has any ports with generic data types.
Definition at line 1087 of file VuoRendererNode.cc.
|
protectedvirtual |
Handle mouse hover start events.
Definition at line 837 of file VuoRendererNode.cc.
|
protectedvirtual |
Handle mouse hover leave events.
Definition at line 860 of file VuoRendererNode.cc.
|
protectedvirtual |
Handle mouse hover move events.
Definition at line 845 of file VuoRendererNode.cc.
|
virtual |
Returns a boolean indicating whether the node should be rendered as if it is selected, regardless of whether it has been directly selected.
For regular (non-input-attachment) nodes, these two concepts are equivalent.
Reimplemented in VuoRendererInputAttachment.
Definition at line 533 of file VuoRendererNode.cc.
bool VuoRendererNode::isMissingImplementation | ( | void | ) |
Returns whether the node is rendered as though its implementation is missing.
Definition at line 679 of file VuoRendererNode.cc.
QVariant VuoRendererNode::itemChange | ( | GraphicsItemChange | change, |
const QVariant & | value | ||
) |
Updates the node and its connected cables to reflect changes in state.
Definition at line 724 of file VuoRendererNode.cc.
|
protected |
Handle key-press events.
Definition at line 902 of file VuoRendererNode.cc.
void VuoRendererNode::layoutConnectedInputDrawers | ( | void | ) |
Calculates and sets the positions of the node's connected input drawers relative to the node.
Definition at line 169 of file VuoRendererNode.cc.
void VuoRendererNode::layoutConnectedInputDrawersAtAndAbovePort | ( | VuoRendererPort * | port | ) |
Calculates and sets the positions of any input drawers connected to this node's ports beginning with the provided port
and iterating through the ports rendered above (i.e., with indices lower than) that port.
Definition at line 186 of file VuoRendererNode.cc.
|
protectedvirtual |
Calculates and sets the positions of the node's child ports relative to the node.
Reimplemented in VuoRendererInputDrawer.
Definition at line 146 of file VuoRendererNode.cc.
|
protected |
Handle mouse double-click events.
Definition at line 883 of file VuoRendererNode.cc.
|
protected |
Handle mouse release events.
Definition at line 868 of file VuoRendererNode.cc.
bool VuoRendererNode::nameDisplayEnabledForInputPorts | ( | ) |
Returns a boolean indicating whether the names of input ports should be rendered within the node.
Definition at line 1230 of file VuoRendererNode.cc.
bool VuoRendererNode::nameDisplayEnabledForOutputPorts | ( | ) |
Returns a boolean indicating whether the names of output ports should be rendered within the node.
Definition at line 1256 of file VuoRendererNode.cc.
bool VuoRendererNode::nameDisplayEnabledForPort | ( | const VuoRendererPort * | port | ) |
Returns a boolean indicating whether the name of the provided port
should be rendered within the node.
Definition at line 1218 of file VuoRendererNode.cc.
|
virtual |
Draws a standard node, including rectangular frame, and input and output ports.
The node is drawn with (0,0) as the top left inner margin, so you should use a QPainter transform if you want to position the node.
Reimplemented in VuoRendererValueListForReadOnlyDictionary, VuoRendererInputListDrawer, and VuoRendererHiddenInputAttachment.
Definition at line 586 of file VuoRendererNode.cc.
|
virtual |
Returns a boolean indicating whether painting is currently disabled for this node.
Definition at line 522 of file VuoRendererNode.cc.
void VuoRendererNode::replaceInputPort | ( | VuoRendererPort * | oldPort, |
VuoRendererPort * | newPort | ||
) |
Replaces input port old
with new
.
Affects only renderer detail ports (not base or compiler ports).
Definition at line 1054 of file VuoRendererNode.cc.
void VuoRendererNode::resetTimeLastExecuted | ( | ) |
Resets the time last executed to a value that causes the node to be painted as if activity-rendering were disabled.
Definition at line 1127 of file VuoRendererNode.cc.
void VuoRendererNode::setAlwaysDisplayPortNames | ( | bool | displayPortNames | ) |
Sets the boolean indicating whether this node's ports, including unambiguous ones, should always have their names displayed.
Updates the relevant cached data structures.
Definition at line 1198 of file VuoRendererNode.cc.
void VuoRendererNode::setCacheModeForConnectedCables | ( | QGraphicsItem::CacheMode | mode | ) |
Sets the cache mode of this node's connected cables to mode
.
Definition at line 1179 of file VuoRendererNode.cc.
void VuoRendererNode::setCacheModeForNodeAndPorts | ( | QGraphicsItem::CacheMode | mode | ) |
Sets the cache mode of this node and its child ports to mode
.
Definition at line 1160 of file VuoRendererNode.cc.
void VuoRendererNode::setEligibilityHighlight | ( | VuoRendererColors::HighlightType | eligibility | ) |
Sets whether this node should be highlighted to indicate that it contains ports eligible for the current cable drag.
Definition at line 1280 of file VuoRendererNode.cc.
void VuoRendererNode::setExecutionBegun | ( | ) |
Updates the node's execution state to indicate that it is currently executing.
Definition at line 1135 of file VuoRendererNode.cc.
void VuoRendererNode::setExecutionEnded | ( | ) |
Updates the node's execution state to indicate that it has just finished executing.
Definition at line 1143 of file VuoRendererNode.cc.
void VuoRendererNode::setMissingImplementation | ( | bool | missingImplementation | ) |
Sets whether the node is rendered as though its implementation is missing.
Definition at line 671 of file VuoRendererNode.cc.
void VuoRendererNode::setProxyNode | ( | VuoRendererNode * | proxyNode | ) |
If set, this node will not be drawn; its drawing will be handled by proxyNode
.
Useful for, e.g., attached typecast nodes.
Definition at line 687 of file VuoRendererNode.cc.
void VuoRendererNode::setTitle | ( | string | title | ) |
Sets the title
for this node; re-lays-out its ports to accommodate the new name.
Definition at line 1115 of file VuoRendererNode.cc.
void VuoRendererNode::updateConnectedCableGeometry | ( | void | ) |
Schedules a redraw of this node's connected cables.
Definition at line 996 of file VuoRendererNode.cc.
void VuoRendererNode::updateGeometry | ( | void | ) |
Schedules a redraw of this node.
Definition at line 981 of file VuoRendererNode.cc.
void VuoRendererNode::updateNodeFrameRect | ( | void | ) |
Calculates and updates the cached inner frame of a node based on its current attributes.
The "inner frame" is the light grey rect in the middle of the node. It doesn't include the node's header or footer.
Definition at line 401 of file VuoRendererNode.cc.
|
protected |
Indicates whether this node's ports, even unambiguous ones, should always have their names displayed.
Definition at line 119 of file VuoRendererNode.hh.
|
static |
The radius of rounded corners.
Definition at line 102 of file VuoRendererNode.hh.
|
protected |
The list of input renderer ports belonging to this renderer node.
Definition at line 116 of file VuoRendererNode.hh.
|
static |
The vertical offset of the node header's top left corner from the origin.
Definition at line 101 of file VuoRendererNode.hh.
|
static |
The height of the node's title.
Definition at line 100 of file VuoRendererNode.hh.
|
protected |
The list of output renderer ports belonging to this renderer node.
Definition at line 117 of file VuoRendererNode.hh.
|
protected |
The object that sends signals on behalf of this renderer node.
Definition at line 115 of file VuoRendererNode.hh.
|
protected |
The time at which this node's running counterpart last completed an execution.
Definition at line 118 of file VuoRendererNode.hh.