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

Description

Renders a node in a VuoRendererGraph.

Public Types

enum  Type { node, detachedConstant, detachedDrawer, detachedTypecast }
 Specifies how this node is graphically represented.
 

Public Member Functions

 VuoRendererNode (VuoNode *baseNode, VuoRendererSignaler *signaler)
 Creates a renderer detail for the specified base node.
 
QRectF boundingRect (void) const
 Returns a rectangle that completely encloses the rendered node (accounting for the thick line width).
 
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
 Draws a standard node, including rectangular frame, and input and output ports.
 
void highlight (QPainter *painter)
 Highlights the node.
 
QRectF getNodeFrameRect (void) const
 Returns the horizontal offset necessary to prevent the drawer at portIndex from overlapping any drawers beneath it.
 
void setPortConnected (VuoRendererPort *rendererPort, bool isOutputPort, bool isConnected, bool hasData=false)
 Changes the portConnected value for the specified port on this node.
 
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.
 
QVariant itemChange (GraphicsItemChange change, const QVariant &value)
 Updates the node and its connected cables to reflect changes in position.
 
void updateGeometry (void)
 Schedules a redraw of this node.
 
void updateConnectedCableGeometry (void)
 Schedules a redraw of this node's connected cables.
 
set< VuoCable * > getConnectedCables (void)
 Returns the set of cables connected to this node.
 
set< VuoCable * > getConnectedInputCables (void)
 Returns the set of input cables connected to this node.
 
set< VuoCable * > getConnectedOutputCables (void)
 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.
 
- Public Member Functions inherited from VuoBaseDetail< VuoNode >
 VuoBaseDetail (string id, 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 Attributes

static const qreal thickPenWidth = 20
 Width, in pixels at 1:1 zoom, of the top and bottom node edges. Many other drawing metrics are based on this value.
 
static const qreal midPenWidth = VuoRendererNode::thickPenWidth/10.0
 Width, in pixels at 1:1 zoom, of stateful indicator bars and typecast port edges.
 

Additional Inherited Members

- 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.
 
- Protected Member Functions inherited from VuoRendererItem
void drawBoundingRect (QPainter *painter)
 Draws this item's bounding rect, for debugging.
 

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

set< VuoCable * > VuoRendererNode::getConnectedCables ( void  )

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 ( void  )

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 ( void  )

Returns the set of output cables connected to this node.

This includes:

  • Cables connected to any of the node's output ports.
VuoRendererPortList * VuoRendererNode::getInputPorts ( void  )

Returns this node's input ports, as a VuoRendererPortList.

See Also
VuoNode::getInputPorts()
QRectF VuoRendererNode::getNodeFrameRect ( void  ) const

Returns the horizontal offset necessary to prevent the drawer at portIndex from overlapping any drawers beneath it.

Determines and returns the size of the inner frame of a node having the specified attributes.

Note that this returns the inner frame, not an outer bounding box (i.e., it doesn't include the width of thick lines).

VuoRendererPortList * VuoRendererNode::getOutputPorts ( void  )

Returns this node's output ports, as a VuoRendererPortList.

See Also
VuoNode::getInputPorts()
void VuoRendererNode::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget 
)

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 use a QPainter transform to position the node.

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


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