Renders a cable in a VuoRendererComposition
.
Definition at line 21 of file VuoRendererCable.hh.
Public Member Functions | |
VuoRendererCable (VuoCable *baseCable) | |
Creates a renderer detail for the specified baseCable . More... | |
QRectF | boundingRect (void) const |
Returns a rectangle containing the rendered cable (including thick cable width). More... | |
QPainterPath | shape (void) const |
Returns the shape of the rendered cable, for use in collision detection, hit tests, and QGraphicsScene::items() functions. More... | |
QPainterPath | getCablePath (void) const |
Returns the curve along which this cable is drawn. More... | |
void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) |
Draws the cable on painter . More... | |
QPointF | getFloatingEndpointLoc () |
Returns the coordinates of the cable's floating endpoint, or a NULL QPointF if none. More... | |
void | setFloatingEndpointLoc (QPointF loc) |
Sets the coordinates of the cable's floating endpoint. More... | |
void | setFloatingEndpointAboveEventPort (bool aboveEventPort) |
Sets the boolean indicating whether this cable's floating endpoint is currently hovered over an event-only port. More... | |
bool | isFloatingEndpointAboveEventPort (void) |
Returns true if this cable's floating endpoint is currently hovered over an event-only port. More... | |
void | setFrom (VuoNode *fromNode, VuoPort *fromPort) |
Sets the node and port from which this cable is output, updating the connected renderer and base components. More... | |
void | setTo (VuoNode *toNode, VuoPort *toPort) |
Sets the node and port to which this cable is input, updating the connected renderer and base components. More... | |
bool | effectivelyCarriesData (void) const |
Returns a boolean indicating whether this cable should be rendered as if it carries data. More... | |
bool | getEffectivelyWireless () const |
Returns true if this cable is to be rendered as if it is wireless. More... | |
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. More... | |
void | removeFromScene () |
Removes a cable from the canvas and performs other necessary cleanup. More... | |
void | extendedHoverEnterEvent () |
Handle mouse hover start events generated by custom code making use of an extended hover range. More... | |
void | extendedHoverMoveEvent () |
Handle mouse hover move events generated by custom code making use of an extended hover range. More... | |
void | extendedHoverLeaveEvent () |
Handle mouse hover leave events generated by custom code making use of an extended hover range. More... | |
bool | yankZoneIncludes (QPointF scenePos) |
Returns a boolean indicating whether the cable may be disconnected by by dragging from scenePos . More... | |
VuoPort * | 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. More... | |
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. More... | |
bool | getPreviouslyAlwaysEventOnly () |
Returns the boolean indicating whether the cable was in forced event-only mode before it was most recently disconnected by dragging. More... | |
void | setPreviouslyAlwaysEventOnly (bool eventOnly) |
Sets the boolean indicating whether the cable was in forced event-only mode before it was most recently disconnected by dragging. More... | |
void | setHovered (bool hovered) |
Sets the boolean indicating that the cable is tinted to represent mouse hovering. More... | |
void | setEligibilityHighlight (VuoRendererColors::HighlightType eligibility) |
Sets whether this cable is currently being dragged. More... | |
void | updateGeometry (void) |
Schedules a redraw of this cable. More... | |
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. More... | |
VuoNode::TintColor | getTintColor (void) |
Returns the tint color of the cable. More... | |
bool | paintingDisabled (void) const |
Returns a boolean indicating whether painting is currently disabled for this cable. More... | |
QPainterPath | getCablePathForEndpoints (QPointF from, QPointF to) const |
Returns a cable's path, given its start and end points. More... | |
void | setCacheModeForCableAndConnectedPorts (QGraphicsItem::CacheMode mode) |
Sets the cache mode of this cable and its connected ports to mode . More... | |
void | setPortConstantsChanged () |
Call this when the constants on this cable's node's other ports have changed, so the cable path gets updated to escape them. 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< VuoCable > | |
VuoBaseDetail (string description, VuoCable *base) | |
Creates a detail class. More... | |
VuoCable * | getBase (void) const |
Returns the detail class instance's base class instance. More... | |
void | setBase (VuoCable *base) |
Sets the detail class instance's base class instance. More... | |
Static Public Member Functions | |
static void | getCableSpecs (bool cableCarriesData, qreal &cableWidth) |
Calculates the cableWidth for a cable, dependent on whether that cable carries data. 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 | cableWidth = 5 |
The width of a data-event cable. (Event-only cable width is determined by VuoRendererCable::getCableSpecs.) More... | |
static const qreal | cableYankRadius = 20 |
Radius from the endpoints of the cable in which yanking is permitted. More... | |
Additional Inherited Members | |
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... | |
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... | |
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... | |
VuoRendererCable::VuoRendererCable | ( | VuoCable * | baseCable | ) |
Creates a renderer detail for the specified baseCable
.
Definition at line 27 of file VuoRendererCable.cc.
QRectF VuoRendererCable::boundingRect | ( | void | ) | const |
Returns a rectangle containing the rendered cable (including thick cable width).
Definition at line 63 of file VuoRendererCable.cc.
bool VuoRendererCable::effectivelyCarriesData | ( | void | ) | const |
Returns a boolean indicating whether this cable should be rendered as if it carries data.
Definition at line 941 of file VuoRendererCable.cc.
void VuoRendererCable::extendedHoverEnterEvent | ( | ) |
Handle mouse hover start events generated by custom code making use of an extended hover range.
Definition at line 831 of file VuoRendererCable.cc.
void VuoRendererCable::extendedHoverLeaveEvent | ( | ) |
Handle mouse hover leave events generated by custom code making use of an extended hover range.
Definition at line 847 of file VuoRendererCable.cc.
void VuoRendererCable::extendedHoverMoveEvent | ( | ) |
Handle mouse hover move events generated by custom code making use of an extended hover range.
Definition at line 839 of file VuoRendererCable.cc.
QPainterPath VuoRendererCable::getCablePath | ( | void | ) | const |
Returns the curve along which this cable is drawn.
Definition at line 160 of file VuoRendererCable.cc.
QPainterPath VuoRendererCable::getCablePathForEndpoints | ( | QPointF | from, |
QPointF | to | ||
) | const |
Returns a cable's path, given its start and end points.
Also takes into account:
Definition at line 288 of file VuoRendererCable.cc.
|
static |
Calculates the cableWidth
for a cable, dependent on whether that cable carries data.
Definition at line 533 of file VuoRendererCable.cc.
bool VuoRendererCable::getEffectivelyWireless | ( | ) | const |
Returns true
if this cable is to be rendered as if it is wireless.
Definition at line 622 of file VuoRendererCable.cc.
QPointF VuoRendererCable::getFloatingEndpointLoc | ( | ) |
Returns the coordinates of the cable's floating endpoint, or a NULL QPointF if none.
Definition at line 689 of file VuoRendererCable.cc.
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.
Definition at line 866 of file VuoRendererCable.cc.
bool VuoRendererCable::getPreviouslyAlwaysEventOnly | ( | ) |
Returns the boolean indicating whether the cable was in forced event-only mode before it was most recently disconnected by dragging.
Definition at line 884 of file VuoRendererCable.cc.
VuoNode::TintColor VuoRendererCable::getTintColor | ( | void | ) |
Returns the tint color of the cable.
Tint the cable with the color of its "From" node.
Definition at line 380 of file VuoRendererCable.cc.
bool VuoRendererCable::isFloatingEndpointAboveEventPort | ( | void | ) |
Returns true if this cable's floating endpoint is currently hovered over an event-only port.
Definition at line 797 of file VuoRendererCable.cc.
void VuoRendererCable::paint | ( | QPainter * | painter, |
const QStyleOptionGraphicsItem * | option, | ||
QWidget * | widget | ||
) |
Draws the cable on painter
.
Definition at line 412 of file VuoRendererCable.cc.
bool VuoRendererCable::paintingDisabled | ( | void | ) | const |
Returns a boolean indicating whether painting is currently disabled for this cable.
Definition at line 544 of file VuoRendererCable.cc.
void VuoRendererCable::removeFromScene | ( | ) |
Removes a cable from the canvas and performs other necessary cleanup.
Definition at line 805 of file VuoRendererCable.cc.
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.
Definition at line 933 of file VuoRendererCable.cc.
void VuoRendererCable::setCacheModeForCableAndConnectedPorts | ( | QGraphicsItem::CacheMode | mode | ) |
Sets the cache mode of this cable and its connected ports to mode
.
Definition at line 660 of file VuoRendererCable.cc.
void VuoRendererCable::setEligibilityHighlight | ( | VuoRendererColors::HighlightType | eligibility | ) |
Sets whether this cable is currently being dragged.
Definition at line 916 of file VuoRendererCable.cc.
void VuoRendererCable::setFloatingEndpointAboveEventPort | ( | bool | aboveEventPort | ) |
Sets the boolean indicating whether this cable's floating endpoint is currently hovered over an event-only port.
Definition at line 789 of file VuoRendererCable.cc.
void VuoRendererCable::setFloatingEndpointLoc | ( | QPointF | loc | ) |
Sets the coordinates of the cable's floating endpoint.
Definition at line 780 of file VuoRendererCable.cc.
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.
Definition at line 875 of file VuoRendererCable.cc.
Sets the node and port from which this cable is output, updating the connected renderer and base components.
Definition at line 698 of file VuoRendererCable.cc.
void VuoRendererCable::setHovered | ( | bool | hovered | ) |
Sets the boolean indicating that the cable is tinted to represent mouse hovering.
Definition at line 901 of file VuoRendererCable.cc.
void VuoRendererCable::setPortConstantsChanged | ( | ) |
Call this when the constants on this cable's node's other ports have changed, so the cable path gets updated to escape them.
Definition at line 680 of file VuoRendererCable.cc.
void VuoRendererCable::setPreviouslyAlwaysEventOnly | ( | bool | eventOnly | ) |
Sets the boolean indicating whether the cable was in forced event-only mode before it was most recently disconnected by dragging.
Definition at line 893 of file VuoRendererCable.cc.
Sets the node and port to which this cable is input, updating the connected renderer and base components.
Definition at line 732 of file VuoRendererCable.cc.
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.
Definition at line 634 of file VuoRendererCable.cc.
QPainterPath VuoRendererCable::shape | ( | void | ) | const |
Returns the shape of the rendered cable, for use in collision detection, hit tests, and QGraphicsScene::items() functions.
Definition at line 87 of file VuoRendererCable.cc.
void VuoRendererCable::updateGeometry | ( | void | ) |
Schedules a redraw of this cable.
Definition at line 924 of file VuoRendererCable.cc.
bool VuoRendererCable::yankZoneIncludes | ( | QPointF | scenePos | ) |
Returns a boolean indicating whether the cable may be disconnected by by dragging from scenePos
.
Definition at line 856 of file VuoRendererCable.cc.
|
static |
The width of a data-event cable. (Event-only cable width is determined by VuoRendererCable::getCableSpecs.)
Definition at line 26 of file VuoRendererCable.hh.
|
static |
Radius from the endpoints of the cable in which yanking is permitted.
Definition at line 27 of file VuoRendererCable.hh.