Vuo  0.5.6
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
VuoRendererNode Class Reference

Description

Renders a node in a VuoRendererComposition.

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...
 

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.
 
VuoRendererNodegetProxyNode (void) const
 Returns this node's rendering proxy.
 
VuoRendererTypecastPortgetProxyCollapsedTypecast (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.
 
VuoRendererPortListgetInputPorts (void)
 Returns this node's input ports, as a VuoRendererPortList.
 
VuoRendererPortListgetOutputPorts (void)
 Returns this node's output ports, as a VuoRendererPortList.
 
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.
 
- Public Member Functions inherited from VuoBaseDetail< VuoNode >
 VuoBaseDetail (string description, VuoNode *base)
 Creates a VuoNode detail class.
 
VuoNodegetBase (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 QString generateNodeClassToolTipTitle (VuoNodeClass *nodeClass)
 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 Public Member Functions inherited from VuoRendererItem
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 = VuoRendererFonts::thickPenWidth
 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.
 
- Protected Member Functions inherited from VuoRendererItem
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.
 

Protected Attributes

VuoRendererSignalersignaler
 The object that sends signals on behalf of this renderer node.
 
VuoRendererPortListinputPorts
 The list of input renderer ports belonging to this renderer node.
 
VuoRendererPortListoutputPorts
 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.
 

Member Enumeration Documentation

Specifies how this node is graphically represented.

Constructor & Destructor Documentation

VuoRendererNode::VuoRendererNode ( VuoNode baseNode,
VuoRendererSignaler signaler 
)

Creates a renderer detail for the specified base node.

Todo:
support subcompositions - https://b33p.net/kosada/node/2639

Member Function Documentation

void VuoRendererNode::addInputPort ( VuoRendererPort newPort)

Adds input port port to the node.

Affects only renderer detail ports (not base or compiler ports).

QRectF VuoRendererNode::boundingRect ( void  ) const
virtual

Returns a rectangle that completely encloses the rendered node (accounting for the thick line width).

Reimplemented in VuoRendererMakeListNode.

QString VuoRendererNode::generateNodeClassToolTipTextBody ( VuoNodeClass nodeClass)
static

Generates a formatted description to be incorporated into the tooltip for the input nodeClass.

QString VuoRendererNode::generateNodeClassToolTipTitle ( VuoNodeClass nodeClass)
static

Generates a formatted title to be incorporated into the tooltip for the input nodeClass.

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:

  • Cables connected to any of the node's input ports.
  • Cables connected to the child port of any collapsed typecast attached to an input port.
  • Cables connected to any of the node's output ports.
set< VuoCable * > VuoRendererNode::getConnectedInputCables ( bool  includePublishedCables)

Returns the set of input cables connected to this node.

This includes:

  • Cables connected to any of the node's input ports.
  • Cables connected to the child port of any collapsed typecast attached to an input port.
set< VuoCable * > VuoRendererNode::getConnectedOutputCables ( bool  includePublishedCables)

Returns the set of output cables connected to this node.

This includes:

  • Cables connected to any of the node's output ports.
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.

See Also
VuoNode::getInputPorts()
QRectF VuoRendererNode::getNodeTitleBoundingRect ( void  ) const
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.

See Also
VuoNode::getInputPorts()
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.

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.

void VuoRendererNode::hoverEnterEvent ( QGraphicsSceneHoverEvent *  event)
protectedvirtual

Handle mouse hover start events.

void VuoRendererNode::hoverLeaveEvent ( QGraphicsSceneHoverEvent *  event)
protectedvirtual

Handle mouse hover leave events.

void VuoRendererNode::hoverMoveEvent ( QGraphicsSceneHoverEvent *  event)
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.

void VuoRendererNode::keyPressEvent ( QKeyEvent *  event)
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.

void VuoRendererNode::layoutPorts ( void  )
protectedvirtual

Calculates and sets the positions of the node's child ports relative to the node.

void VuoRendererNode::mouseDoubleClickEvent ( QGraphicsSceneMouseEvent *  event)
protected

Handle mouse double-click events.

void VuoRendererNode::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget 
)
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::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.

Member Data Documentation

VuoRendererPortList* VuoRendererNode::inputPorts
protected

The list of input renderer ports belonging to this renderer node.

const qreal VuoRendererNode::nodeTitleHeight = VuoRendererFonts::thickPenWidth
static

The height of the node's title.

VuoRendererPortList* VuoRendererNode::outputPorts
protected

The list of output renderer ports belonging to this renderer node.

VuoRendererSignaler* VuoRendererNode::signaler
protected

The object that sends signals on behalf of this renderer node.

qint64 VuoRendererNode::timeLastExecutionEnded
protected

The time at which this node's running counterpart last completed an execution.


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