Vuo  1.2.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
VuoRendererCable Class Reference

Description

Renders a cable in a VuoRendererComposition.

Public Member Functions

 VuoRendererCable (VuoCable *baseCable)
 Creates a renderer detail for the specified baseCable.
 
QRectF boundingRect (void) const
 Returns a rectangle containing the rendered cable (including thick cable width).
 
QPainterPath shape (void) const
 Returns the shape of the rendered cable, for use in collision detection, hit tests, and QGraphicsScene::items() functions.
 
QPainterPath getCablePath (void) const
 Returns the curve along which this cable is drawn.
 
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
 Draws the cable on painter.
 
QPointF getFloatingEndpointLoc ()
 Returns the coordinates of the cable's floating endpoint, or a NULL QPointF if none.
 
void setFloatingEndpointLoc (QPointF loc)
 Sets the coordinates of the cable's floating endpoint.
 
void setFloatingEndpointAboveEventPort (bool aboveEventPort)
 Sets the boolean indicating whether this cable's floating endpoint is currently hovered over an event-only port.
 
void setFrom (VuoNode *fromNode, VuoPort *fromPort)
 Sets the node and port from which this cable is output, updating the connected renderer and base components.
 
void setTo (VuoNode *toNode, VuoPort *toPort)
 Sets the node and port to which this cable is input, updating the connected renderer and base components.
 
bool effectivelyCarriesData (void) const
 Returns a boolean indicating whether this cable should be rendered as if it carries data.
 
bool getEffectivelyWireless () const
 Returns true if this cable is to be rendered as if it is wireless.
 
void setWireless (bool wireless)
 Sets the boolean indicating whether this cable has been explicitly marked by the user to be rendered as if it is wireless.
 
void removeFromScene ()
 Removes a cable from the canvas and performs other necessary cleanup.
 
void extendedHoverEnterEvent ()
 Handle mouse hover start events generated by custom code making use of an extended hover range.
 
void extendedHoverMoveEvent ()
 Handle mouse hover move events generated by custom code making use of an extended hover range.
 
void extendedHoverLeaveEvent ()
 Handle mouse hover leave events generated by custom code making use of an extended hover range.
 
bool yankZoneIncludes (QPointF scenePos)
 Returns a boolean indicating whether the cable may be disconnected by by dragging from scenePos.
 
VuoPortgetFloatingEndpointPreviousToPort ()
 Returns the cable's previous 'To' port (if the cable has since been disconnected from that port by dragging), or NULL if not applicable.
 
void setFloatingEndpointPreviousToPort (VuoPort *port)
 Sets the cable's previous 'To' port (if the cable has since been disconnected from that port by dragging), or NULL if not applicable.
 
void setHovered (bool hovered)
 Sets the boolean indicating that the cable is tinted to represent mouse hovering.
 
void updateGeometry (void)
 Schedules a redraw of this cable.
 
void resetTimeLastEventPropagated ()
 Resets the time that the last event was propagated through this cable to a value that causes the cable to be painted as if activity-rendering were disabled.
 
VuoNode::TintColor getTintColor (void)
 Returns the tint color of the cable.
 
bool paintingDisabled (void) const
 Returns a boolean indicating whether painting is currently disabled for this cable.
 
void setCacheModeForCableAndConnectedPorts (QGraphicsItem::CacheMode mode)
 Sets the cache mode of this cable and its connected ports to mode.
 
- Public Member Functions inherited from VuoBaseDetail< VuoCable >
 VuoBaseDetail (string description, VuoCable *base)
 Creates a VuoCable detail class.
 
VuoCablegetBase (void) const
 Returns the VuoCable detail class instance's base class instance.
 
void setBase (VuoCable *base)
 Sets the VuoCable detail class instance's base class instance.
 

Static Public Member Functions

static QPainterPath getCablePathForEndpoints (QPointF from, QPointF to)
 Returns a cable's path, given its start and end points.
 
static void getCableSpecs (bool cableCarriesData, qreal &cableWidth, qreal &cableHighlightWidth, qreal &cableHighlightOffset)
 Calculates the cableWidth, cableHighlightWidth, and cableHighlightOffset, for a cable, dependent on whether that cable carries data.
 
- Static Public Member Functions inherited from VuoRendererItem
static void setSnapToGrid (bool snap)
 Specifies whether graphics items should be snapped to a grid.
 
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 bool getSnapToGrid ()
 Retrieves the boolean indicating whether graphics items should be snapped to a grid.
 

Static Public Attributes

static const qreal cableWidth = VuoRendererFonts::thickPenWidth / 5.
 The width of a data-event cable. (Event-only cables are half this width.)
 
static const qreal cableHighlightWidth = VuoRendererCable::cableWidth / 3.
 The width of the highlight on a data-event cable.
 
static const qreal cableHighlightOffset = VuoRendererCable::cableHighlightWidth * 5./8.
 How far from the center of the data-event cable the highlight should be rendered.
 
static const qreal cableYankRadius = VuoRendererFonts::thickPenWidth
 Radius from the endpoints of the cable in which yanking is permitted.
 

Additional Inherited Members

- Public Types inherited from VuoRendererItem
enum  activityState { notTrackingActivity = -1, activityInProgress = 0 }
 Special composition component activity states. More...
 
- Protected Member Functions inherited from VuoRendererItem
void drawBoundingRect (QPainter *painter)
 Draws this item's bounding rect, for debugging.
 
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.
 
bool getRenderHiddenCables () const
 Retrieves the composition-wide boolean indicating whether hidden ("wireless") cables should be rendered as if they were not hidden.
 
QGraphicsItem::CacheMode getCurrentDefaultCacheMode () const
 Returns the current default cache mode for components of this composition.
 
- 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.
 

Constructor & Destructor Documentation

VuoRendererCable::VuoRendererCable ( VuoCable baseCable)

Creates a renderer detail for the specified baseCable.

Member Function Documentation

QRectF VuoRendererCable::boundingRect ( void  ) const

Returns a rectangle containing the rendered cable (including thick cable width).

bool VuoRendererCable::effectivelyCarriesData ( void  ) const

Returns a boolean indicating whether this cable should be rendered as if it carries data.

Note that the returned value may conflict with that returned by VuoCompilerCable::carriesData() for cables connected to published ports. This is because the vuoPsuedoPorts associated with, e.g., published input ports are always technically event-only trigger ports even if the published ports themselves have data. This method treats the vuoPseudoPort as if it has the same data type as its associated VuoPublishedPort, whereas VuoCompilerCable::carriesData() uses the vuoPseudoPort's technical data type.

void VuoRendererCable::extendedHoverEnterEvent ( )

Handle mouse hover start events generated by custom code making use of an extended hover range.

void VuoRendererCable::extendedHoverLeaveEvent ( )

Handle mouse hover leave events generated by custom code making use of an extended hover range.

void VuoRendererCable::extendedHoverMoveEvent ( )

Handle mouse hover move events generated by custom code making use of an extended hover range.

QPainterPath VuoRendererCable::getCablePath ( void  ) const

Returns the curve along which this cable is drawn.

QPainterPath VuoRendererCable::getCablePathForEndpoints ( QPointF  from,
QPointF  to 
)
static

Returns a cable's path, given its start and end points.

void VuoRendererCable::getCableSpecs ( bool  cableCarriesData,
qreal &  cableWidth,
qreal &  cableHighlightWidth,
qreal &  cableHighlightOffset 
)
static

Calculates the cableWidth, cableHighlightWidth, and cableHighlightOffset, for a cable, dependent on whether that cable carries data.

bool VuoRendererCable::getEffectivelyWireless ( ) const

Returns true if this cable is to be rendered as if it is wireless.

QPointF VuoRendererCable::getFloatingEndpointLoc ( )

Returns the coordinates of the cable's floating endpoint, or a NULL QPointF if none.

VuoPort * VuoRendererCable::getFloatingEndpointPreviousToPort ( )

Returns the cable's previous 'To' port (if the cable has since been disconnected from that port by dragging), or NULL if not applicable.

VuoNode::TintColor VuoRendererCable::getTintColor ( void  )

Returns the tint color of the cable.

Tint the cable with the color of its "From" node.

void VuoRendererCable::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget 
)

Draws the cable on painter.

bool VuoRendererCable::paintingDisabled ( void  ) const

Returns a boolean indicating whether painting is currently disabled for this cable.

void VuoRendererCable::removeFromScene ( )

Removes a cable from the canvas and performs other necessary cleanup.

void VuoRendererCable::resetTimeLastEventPropagated ( )

Resets the time that the last event was propagated through this cable to a value that causes the cable to be painted as if activity-rendering were disabled.

void VuoRendererCable::setCacheModeForCableAndConnectedPorts ( QGraphicsItem::CacheMode  mode)

Sets the cache mode of this cable and its connected ports to mode.

void VuoRendererCable::setFloatingEndpointAboveEventPort ( bool  aboveEventPort)

Sets the boolean indicating whether this cable's floating endpoint is currently hovered over an event-only port.

void VuoRendererCable::setFloatingEndpointLoc ( QPointF  loc)

Sets the coordinates of the cable's floating endpoint.

void VuoRendererCable::setFloatingEndpointPreviousToPort ( VuoPort port)

Sets the cable's previous 'To' port (if the cable has since been disconnected from that port by dragging), or NULL if not applicable.

void VuoRendererCable::setFrom ( VuoNode fromNode,
VuoPort fromPort 
)

Sets the node and port from which this cable is output, updating the connected renderer and base components.

void VuoRendererCable::setHovered ( bool  hovered)

Sets the boolean indicating that the cable is tinted to represent mouse hovering.

void VuoRendererCable::setTo ( VuoNode toNode,
VuoPort toPort 
)

Sets the node and port to which this cable is input, updating the connected renderer and base components.

void VuoRendererCable::setWireless ( bool  wireless)

Sets the boolean indicating whether this cable has been explicitly marked by the user to be rendered as if it is wireless.

QPainterPath VuoRendererCable::shape ( void  ) const

Returns the shape of the rendered cable, for use in collision detection, hit tests, and QGraphicsScene::items() functions.

void VuoRendererCable::updateGeometry ( void  )

Schedules a redraw of this cable.

bool VuoRendererCable::yankZoneIncludes ( QPointF  scenePos)

Returns a boolean indicating whether the cable may be disconnected by by dragging from scenePos.

Member Data Documentation

const qreal VuoRendererCable::cableHighlightOffset = VuoRendererCable::cableHighlightWidth * 5./8.
static

How far from the center of the data-event cable the highlight should be rendered.

const qreal VuoRendererCable::cableHighlightWidth = VuoRendererCable::cableWidth / 3.
static

The width of the highlight on a data-event cable.

const qreal VuoRendererCable::cableWidth = VuoRendererFonts::thickPenWidth / 5.
static

The width of a data-event cable. (Event-only cables are half this width.)

const qreal VuoRendererCable::cableYankRadius = VuoRendererFonts::thickPenWidth
static

Radius from the endpoints of the cable in which yanking is permitted.


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