Vuo
0.7.0
|
Renders a node in a VuoRendererComposition
.
Public Types | |
enum | Type { node, detachedConstant, detachedDrawer, detachedTypecast } |
Specifies how this node is graphically represented. More... | |
![]() | |
enum | activityState { notTrackingActivity = -1, activityInProgress = 0 } |
Special composition component activity states. More... | |
Public Member Functions | |
VuoRendererNode (VuoNode *baseNode, VuoRendererSignaler *signaler) | |
Creates a renderer detail for the specified base node. | |
virtual QRectF | boundingRect (void) const |
Returns a rectangle that completely encloses the rendered node (accounting for the thick line width). | |
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) |
Draws a standard node, including rectangular frame, and input and output ports. | |
virtual QRectF | getNodeTitleBoundingRect (void) const |
Returns the bounding rect for the node title box. | |
vector< VuoRendererMakeListNode * > | getAttachedInputDrawers (void) const |
Returns a vector containing all of the drawers attached to any of this node's input ports. | |
qreal | getInputDrawerOffset (unsigned int portIndex) const |
Returns the horizontal offset necessary to prevent the drawer at portIndex from overlapping any drawers beneath it. | |
void | updateNodeFrameRect (void) |
Calculates and updates the cached inner frame of a node based on its current attributes. | |
void | setMissingImplementation (bool missingImplementation) |
Sets whether the node is rendered as though its implementation is missing. | |
void | setProxyNode (VuoRendererNode *proxyNode) |
If set, this node will not be drawn; its drawing will be handled by proxyNode . | |
VuoRendererNode * | getProxyNode (void) const |
Returns this node's rendering proxy. | |
VuoRendererTypecastPort * | getProxyCollapsedTypecast (void) const |
Returns the collapsed typecast port rendered in place of this node, or NULL if none. | |
QVariant | itemChange (GraphicsItemChange change, const QVariant &value) |
Updates the node and its connected cables to reflect changes in state. | |
void | updateGeometry (void) |
Schedules a redraw of this node. | |
void | updateConnectedCableGeometry (void) |
Schedules a redraw of this node's connected cables. | |
set< VuoCable * > | getConnectedCables (bool includePublishedCables) |
Returns the set of cables connected to this node. | |
set< VuoCable * > | getConnectedInputCables (bool includePublishedCables) |
Returns the set of input cables connected to this node. | |
set< VuoCable * > | getConnectedOutputCables (bool includePublishedCables) |
Returns the set of output cables connected to this node. | |
VuoRendererPortList * | getInputPorts (void) |
Returns this node's input ports, as a VuoRendererPortList . | |
VuoRendererPortList * | getOutputPorts (void) |
Returns this node's output ports, as a VuoRendererPortList . | |
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. | |
void | replaceInputPort (VuoRendererPort *oldPort, VuoRendererPort *newPort) |
Replaces input port old with new . | |
void | addInputPort (VuoRendererPort *newPort) |
Adds input port port to the node. | |
bool | hasGenericPort (void) |
Returns a boolean indicating whether this node has any ports with generic data types. | |
void | setTitle (string title) |
Sets the title for this node; re-lays-out its ports to accommodate the new name. | |
void | resetTimeLastExecuted () |
Resets the time last executed to a value that causes the node to be painted as if activity-rendering were disabled. | |
void | setExecutionEnded () |
Updates the node's execution state to indicate that it has just finished executing. | |
void | setExecutionBegun () |
Updates the node's execution state to indicate that it is currently executing. | |
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. | |
void | layoutConnectedInputDrawers (void) |
Calculates and sets the positions of the node's connected input drawers relative to the node. | |
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. | |
void | setCacheModeForNodeAndPorts (QGraphicsItem::CacheMode mode) |
Sets the cache mode of this node and its child ports to mode . | |
void | setCacheModeForConnectedCables (QGraphicsItem::CacheMode mode) |
Sets the cache mode of this node's connected cables to mode . | |
![]() | |
VuoBaseDetail (string description, VuoNode *base) | |
Creates a VuoNode detail class. | |
VuoNode * | getBase (void) const |
Returns the VuoNode detail class instance's base class instance. | |
void | setBase (VuoNode *base) |
Sets the VuoNode detail class instance's base class instance. | |
Static Public Member Functions | |
static QPair< QPainterPath, QPainterPath > | getNodeFrames (QRectF nodeInnerFrameRect, QPainterPath portsPath, QPainterPath portsInsetPath, QPainterPath statefulIndicatorOutline, bool isSubcomposition) |
Returns the outer and inner node frames, in that order, for a node with the provided nodeInnerFrameRect , portsPath , portsInsetPath , statefulIndicatorOutline , and isSubcomposition attribute values. | |
static QVector< QPainterPath > | getStatefulIndicatorOutlines (QRectF nodeInnerFrameRect, bool isStateful) |
Returns the (cableOutline, highlightOutline, cableOutline.subtracted(highlightOutline)) paths, in that order, required to paint a stateful indicator for a node with the provided nodeInnerFrameRect , or empty paths if isStateful is false. | |
static QPainterPath | getAntennaPath (QRectF nodeInnerFrameRect, bool isInterface) |
Returns the path of the "Antenna" icon for a node with the provided nodeInnerFrameRect , or an empty path if isInterface is false. | |
static QPair< QPainterPath, QPainterPath > | getPortPaths (VuoRendererPortList *inputPorts, VuoRendererPortList *outputPorts) |
Returns the port path and portInset path, in that order, for a node with the provided inputPorts and outputPorts lists. | |
static QString | generateNodeClassToolTipTitle (VuoNodeClass *nodeClass, VuoNode *node) |
Generates a formatted title to be incorporated into the tooltip for the input nodeClass . | |
static QString | generateNodeClassToolTipTextBody (VuoNodeClass *nodeClass) |
Generates a formatted description to be incorporated into the tooltip for the input nodeClass . | |
![]() | |
static void | setDrawBoundingRects (bool drawBoundingRects) |
Specifies whether bounding rects will be shown the next time the QGraphicsScene is rendered. | |
static void | drawRect (QPainter *painter, QRectF rect) |
Draws a rect, for debugging. | |
Static Public Attributes | |
static const qreal | nodeTitleHeight = round(VuoRendererFonts::nodeTitleFontSize + VuoRendererFonts::thickPenWidth*1./8.) |
The height of the node's title. | |
Protected Member Functions | |
virtual void | hoverEnterEvent (QGraphicsSceneHoverEvent *event) |
Handle mouse hover start events. | |
virtual void | hoverMoveEvent (QGraphicsSceneHoverEvent *event) |
Handle mouse hover move events. | |
virtual void | hoverLeaveEvent (QGraphicsSceneHoverEvent *event) |
Handle mouse hover leave events. | |
void | mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) |
Handle mouse double-click events. | |
void | keyPressEvent (QKeyEvent *event) |
Handle key-press events. | |
virtual void | layoutPorts (void) |
Calculates and sets the positions of the node's child ports relative to the node. | |
![]() | |
void | drawBoundingRect (QPainter *painter) |
Draws this item's bounding rect, for debugging. | |
bool | getRenderActivity () |
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. | |
QGraphicsItem::CacheMode | getCurrentDefaultCacheMode () |
Returns the current default cache mode for components of this composition. | |
Protected Attributes | |
VuoRendererSignaler * | signaler |
The object that sends signals on behalf of this renderer node. | |
VuoRendererPortList * | inputPorts |
The list of input renderer ports belonging to this renderer node. | |
VuoRendererPortList * | outputPorts |
The list of output renderer ports belonging to this renderer node. | |
qint64 | timeLastExecutionEnded |
The time at which this node's running counterpart last completed an execution. | |
Static Protected Attributes | |
static const qreal | cornerRadius = VuoRendererFonts::thickPenWidth/8.0 |
The radius of rounded corners. | |
Additional Inherited Members | |
![]() | |
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 . | |
Specifies how this node is graphically represented.
VuoRendererNode::VuoRendererNode | ( | VuoNode * | baseNode, |
VuoRendererSignaler * | signaler | ||
) |
Creates a renderer detail for the specified base node.
void VuoRendererNode::addInputPort | ( | VuoRendererPort * | newPort | ) |
Adds input port port
to the node.
Affects only renderer detail ports (not base or compiler ports).
|
virtual |
Returns a rectangle that completely encloses the rendered node (accounting for the thick line width).
Reimplemented in VuoRendererMakeListNode.
|
static |
Generates a formatted description to be incorporated into the tooltip for the input nodeClass
.
|
static |
Generates a formatted title to be incorporated into the tooltip for the input nodeClass
.
|
static |
Returns the path of the "Antenna" icon for a node with the provided nodeInnerFrameRect
, or an empty path if isInterface
is false.
vector< VuoRendererMakeListNode * > VuoRendererNode::getAttachedInputDrawers | ( | void | ) | const |
Returns a vector containing all of the drawers attached to any of this node's input ports.
set< VuoCable * > VuoRendererNode::getConnectedCables | ( | bool | includePublishedCables | ) |
Returns the set of cables connected to this node.
This includes:
set< VuoCable * > VuoRendererNode::getConnectedInputCables | ( | bool | includePublishedCables | ) |
Returns the set of input cables connected to this node.
This includes:
set< VuoCable * > VuoRendererNode::getConnectedOutputCables | ( | bool | includePublishedCables | ) |
Returns the set of output cables connected to this node.
This includes:
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.
qreal VuoRendererNode::getInputDrawerOffset | ( | unsigned int | portIndex | ) | const |
Returns the horizontal offset necessary to prevent the drawer at portIndex
from overlapping any drawers beneath it.
VuoRendererPortList * VuoRendererNode::getInputPorts | ( | void | ) |
Returns this node's input ports, as a VuoRendererPortList
.
|
static |
Returns the outer and inner node frames, in that order, for a node with the provided nodeInnerFrameRect
, portsPath
, portsInsetPath
, statefulIndicatorOutline
, and isSubcomposition
attribute values.
|
virtual |
Returns the bounding rect for the node title box.
Reimplemented in VuoRendererMakeListNode.
VuoRendererPortList * VuoRendererNode::getOutputPorts | ( | void | ) |
Returns this node's output ports, as a VuoRendererPortList
.
|
static |
Returns the port path and portInset path, in that order, for a node with the provided inputPorts
and outputPorts
lists.
These paths should be subtracted from the node's filled areas.
VuoRendererTypecastPort * VuoRendererNode::getProxyCollapsedTypecast | ( | void | ) | const |
Returns the collapsed typecast port rendered in place of this node, or NULL if none.
VuoRendererNode * VuoRendererNode::getProxyNode | ( | void | ) | const |
Returns this node's rendering proxy.
|
static |
Returns the (cableOutline, highlightOutline, cableOutline.subtracted(highlightOutline)) paths, in that order, required to paint a stateful indicator for a node with the provided nodeInnerFrameRect
, or empty paths if isStateful
is false.
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.
bool VuoRendererNode::hasGenericPort | ( | void | ) |
Returns a boolean indicating whether this node has any ports with generic data types.
|
protectedvirtual |
Handle mouse hover start events.
|
protectedvirtual |
Handle mouse hover leave events.
|
protectedvirtual |
Handle mouse hover move events.
QVariant VuoRendererNode::itemChange | ( | GraphicsItemChange | change, |
const QVariant & | value | ||
) |
Updates the node and its connected cables to reflect changes in state.
|
protected |
Handle key-press events.
void VuoRendererNode::layoutConnectedInputDrawers | ( | void | ) |
Calculates and sets the positions of the node's connected input drawers relative to the node.
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.
|
protectedvirtual |
Calculates and sets the positions of the node's child ports relative to the node.
|
protected |
Handle mouse double-click events.
|
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 VuoRendererMakeListNode.
void VuoRendererNode::replaceInputPort | ( | VuoRendererPort * | oldPort, |
VuoRendererPort * | newPort | ||
) |
Replaces input port old
with new
.
Affects only renderer detail ports (not base or compiler ports).
void VuoRendererNode::resetTimeLastExecuted | ( | ) |
Resets the time last executed to a value that causes the node to be painted as if activity-rendering were disabled.
void VuoRendererNode::setCacheModeForConnectedCables | ( | QGraphicsItem::CacheMode | mode | ) |
Sets the cache mode of this node's connected cables to mode
.
void VuoRendererNode::setCacheModeForNodeAndPorts | ( | QGraphicsItem::CacheMode | mode | ) |
Sets the cache mode of this node and its child ports to mode
.
void VuoRendererNode::setExecutionBegun | ( | ) |
Updates the node's execution state to indicate that it is currently executing.
void VuoRendererNode::setExecutionEnded | ( | ) |
Updates the node's execution state to indicate that it has just finished executing.
void VuoRendererNode::setMissingImplementation | ( | bool | missingImplementation | ) |
Sets whether the node is rendered as though its implementation is missing.
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.
void VuoRendererNode::setTitle | ( | string | title | ) |
Sets the title
for this node; re-lays-out its ports to accommodate the new name.
void VuoRendererNode::updateConnectedCableGeometry | ( | void | ) |
Schedules a redraw of this node's connected cables.
void VuoRendererNode::updateGeometry | ( | void | ) |
Schedules a redraw of this node.
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.
|
staticprotected |
The radius of rounded corners.
|
protected |
The list of input renderer ports belonging to this renderer node.
|
static |
The height of the node's title.
|
protected |
The list of output renderer ports belonging to this renderer node.
|
protected |
The object that sends signals on behalf of this renderer node.
|
protected |
The time at which this node's running counterpart last completed an execution.