Vuo
1.2.0
|
Renders a node's port in a QGraphicsScene
.
Typically automatically created by a VuoRendererNode
instance.
Public Member Functions | |
VuoRendererPort (VuoPort *basePort, VuoRendererSignaler *signaler, bool isOutput, bool isRefreshPort, bool isFunctionPort) | |
Creates a renderer detail for the specified base port. | |
QRectF | boundingRect (void) const |
Returns the bounding rectangle of this port (and its optional name and plug). | |
QRectF | getNameRect (void) const |
Returns the cached bounding box of the port's label. | |
bool | hasPortAction (void) const |
Returns true if this port has a port action. | |
QRectF | getActionIndicatorRect (void) const |
Returns the bounding rectangle of the port action symbol. | |
QPainterPath | shape (void) const |
Returns the shape of the rendered port, for use in collision detection, hit tests, and QGraphicsScene::items() functions. | |
void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) |
Draws an input or output port (both standard ports and refresh/function ports). | |
bool | getEligibleForSelection (void) |
Returns a boolean indicating whether this port has been deemed eligible for selection based on its proximity to the cursor. | |
bool | isEligibleForConnection (void) |
Returns a boolean indicating whether this port is eligible for direct or typecast-assisted connection to the cable currently being dragged between ports. | |
void | setEligibleForDirectConnection (bool eligible) |
Sets the boolean indicating whether this port is eligible for direct connection to the cable currently being dragged between ports. | |
void | setEligibleForConnectionViaTypecast (bool eligible) |
Sets the boolean indicating whether this port is eligible for typecast-assisted connection to the cable currently being dragged between ports. | |
void | extendedHoverEnterEvent (bool cableDragUnderway=false, bool disableConnectedCableHighlight=false) |
Handle mouse hover start events generated by custom code making use of an extended hover range. | |
void | extendedHoverMoveEvent (bool cableDragUnderway=false, bool disableConnectedCableHighlight=false) |
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 | canConnectDirectlyWithoutSpecializationTo (VuoRendererPort *toPort, bool eventOnlyConnection) |
Returns a boolean indicating whether there may be a cable attached directly from this port to toPort , taking into account the respective port types (input vs. | |
bool | canConnectDirectlyWithSpecializationTo (VuoRendererPort *toPort, bool eventOnlyConnection) |
Returns a boolean indicating whether there may be a cable attached directly from this port to toPort , taking into account the respective port types (input vs. | |
bool | canConnectDirectlyWithSpecializationTo (VuoRendererPort *toPort, bool eventOnlyConnection, VuoRendererPort **portToSpecialize, string &specializedTypeName) |
Returns a boolean indicating whether there may be a cable attached directly from this port to toPort , taking into account the respective port types (input vs. | |
VuoCable * | getCableConnectedTo (VuoRendererPort *toPort) |
Returns the cable connecting this port to toPort , or NULL if not applicable. | |
bool | getInput (void) const |
Returns a boolean indicating whether this port is an input port. | |
bool | getOutput (void) const |
Returns a boolean indicating whether this port is an output port. | |
bool | getRefreshPort (void) const |
Returns true if this port is a refresh port. | |
bool | getFunctionPort (void) const |
Returns true if this port is a function port. | |
void | updateNameRect (void) |
Updates the cached bounding box of the port's label. | |
void | updateGeometry () |
Schedules a redraw of this port. | |
QVariant | itemChange (GraphicsItemChange change, const QVariant &value) |
Updates the port to reflect changes in state. | |
qreal | getInset (void) const |
Returns the inset that should be passed to getPortPath. | |
QPainterPath | getPortPath (qreal inset) const |
Returns a closed path representing the port's circle/triangle. | |
void | updatePortConstantPath () |
Calculates and updates the cached constant path for this port based on its current attributes. | |
VuoRendererInputDrawer * | getAttachedInputDrawer (void) const |
Returns the input drawer that is rendered as if it is attached to this port (whether or not it is in the underlying composition), or NULL if none. | |
virtual QRectF | getPortConstantTextRect (void) const |
Returns a rect enclosing the string representation of the port's constant value. | |
VuoType * | getDataType (void) const |
Returns the data type associated with this port, or NULL if there is no associated data type. | |
bool | isConstant (void) const |
Returns true if this port has a constant data value. | |
bool | effectivelyHasConnectedDataCable (bool includePublishedCables) const |
Returns true if this port has a connected cable that effectively carries data. | |
string | getConstantAsString (void) const |
Returns the string representation of this port's constant data value, or an empty string if it has none. | |
string | getConstantAsStringToRender (void) const |
Returns the string representation of this port's constant data value as it should be rendered in its constant data flag, or an empty string if it has no currently assigned constant data value. | |
string | getStringForRealValue (double value) const |
Given a real number, returns the string representation of the number as it should be rendered within a constant data flag. | |
void | setConstant (string constantValue) |
Sets this port's constant data value to that represented by the provided constantValue string. | |
string | getPortNameToRender () const |
Returns the name of the port as it should be rendered. | |
string | getPortNameToRenderWhenDisplayed () const |
Returns the name of the port as it should be rendered when it is to be rendered at all. | |
void | setPortNameToRender (string name) |
Sets the name of the port as it should be rendered. | |
bool | getPublishable () const |
Returns a boolean indicating whether this port is publishable. | |
vector < VuoRendererPublishedPort * > | getPublishedPorts () const |
Returns a vector of pointers to the externally visible published ports connected to this port. | |
vector < VuoRendererPublishedPort * > | getPublishedPortsConnectedByDataCarryingCables (void) const |
Returns a vector of pointers to the externally visible published ports connected to this port by data-carrying cables. | |
VuoNode::TintColor | getPortTint () const |
Returns the tint color to be used in rendering the port shape. | |
VuoRendererNode * | getUnderlyingParentNode (void) const |
Returns a pointer to the node to which this port belongs in the underlying Graphviz (.dot/.vuo) representation of the composition. | |
VuoRendererNode * | getRenderedParentNode (void) const |
Returns a pointer to the node currently rendered as this port's parent. | |
set< VuoRendererInputAttachment * > | getAllUnderlyingUpstreamInputAttachments (void) const |
Returns a set containing the input attachments connected directly or indirectly to this port in the underlying composition. | |
set< VuoRendererPort * > | getPortsConnectedWirelessly (bool includePublishedCables) const |
Returns the set of ports that have antennas connected by wireless cable to this one. | |
VuoRendererPort * | getTypecastParentPort () const |
Returns this port's typecast parent port, or NULL if it has none. | |
void | setTypecastParentPort (VuoRendererPort *typecastParentPort) |
Sets this port's typecast parent port. | |
bool | supportsDisconnectionByDragging (void) |
Returns a boolean indicating whether this port supports cable disconnection by dragging from the port. | |
void | resetTimeLastEventFired () |
Resets the time that the last event was fired to a value that causes the port to be painted as if activity-rendering were disabled. | |
void | setFiredEvent () |
Updates the port's state to indicate that it has just fired an event. | |
void | setFadePercentageSinceEventFired (qreal percentage) |
Updates the port's state to indicate that it fired an event at such a time that its fade percentage should now be equal to percentage . | |
void | setCacheModeForPortAndChildren (QGraphicsItem::CacheMode mode) |
Sets the cache mode of this port, and any child ports, to mode . | |
vector< QGraphicsItemAnimation * > | getAnimations () |
Returns the 'Show Events'-mode animations associated with this port. | |
void | setAnimated (bool animated) |
Sets the boolean indicating whether this port is an animation, and not itself a component of the base composition. | |
![]() | |
VuoBaseDetail (string description, VuoPort *base) | |
Creates a VuoNode detail class. | |
VuoPort * | getBase (void) const |
Returns the VuoNode detail class instance's base class instance. | |
void | setBase (VuoPort *base) |
Sets the VuoNode detail class instance's base class instance. | |
Static Public Member Functions | |
static QPainterPath | getPortConstantPath (QRectF innerPortRect, QString text, QPainterPath *outsetPath, bool isTypecast=false) |
Returns a path representing the frame of a port constant. | |
static QRectF | getPortRect (void) |
Returns a rectangle encompassing the port's circle. | |
static QString | getPortIdentifierRegExp () |
Returns a string representation of the regular expression that describes valid port identifiers. | |
static QString | sanitizePortIdentifier (QString portID) |
Sanitizes the provided portID to meet the requirements of a valid port identifier. | |
![]() | |
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 | portRadius = VuoRendererFonts::thickPenWidth*0.3625 |
Radius, in pixels at 1:1 zoom, of a circular port. | |
static const qreal | portSpacing = VuoRendererFonts::thickPenWidth*3.0/4.0 |
Vertical distance, in pixels at 1:1 zoom, between the center points of two ports. | |
static const qreal | portContainerMargin = VuoRendererFonts::thickPenWidth / 6. |
Vertical distance, in pixels at 1:1 zoom, between the outer edge of the first/last port and the node frame rect. | |
static const qreal | portInset = 1.4 |
The vertical and horizontal inset used when rendering a circular or refresh port shape within its outer port rect. | |
static const qreal | portInsetTriangular = 2.4 |
The vertical and horizontal inset used when rendering a triangular port shape (in the node body) within its outer port rect. | |
static const qreal | constantFlagHeight = VuoRendererFonts::thickPenWidth*0.6 |
Height, in pixels at 1:1 zoom, of a constant flag. | |
Protected Member Functions | |
void | mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) |
Handle mouse double-click events. | |
void | keyPressEvent (QKeyEvent *event) |
Handle key-press events. | |
bool | portNameRenderingEnabled (void) const |
Returns a boolean indicating whether the port name should be rendered along with this port, taking into account the port's own attributes as well as whether the port will be rendered within a published port sidebar. | |
void | updateEnabledStatus () |
Determines whether this port will accept mouse events based on the port's current attributes. | |
VuoRendererInputDrawer * | getAttachedInputDrawerRenderedWithHostPort (const VuoRendererPort *port) const |
Returns the input drawer that is rendered as if it is attached to targetHostPort (whether or not it is in the underlying composition), or NULL if none. | |
VuoRendererInputAttachment * | getUnderlyingInputAttachment (void) const |
Returns the input drawer attached to this port in the underlying composition (whether or not it is rendered as if it is), or NULL if none. | |
QRectF | getEventBarrierRect (void) const |
Returns a rectangle encompassing the port's event barrier. | |
QPainterPath | getFunctionPortGlyph (void) const |
Returns a path representing the glyph for function ports. | |
virtual QPainterPath | getWirelessAntennaPath () const |
Returns the path of the antenna that represents any connected wireless cables, or an empty path if not applicable. | |
bool | hasConnectedWirelessDataCable (bool includePublishedCables) const |
Returns true if this port has a connected data+event cable that should currently be rendered wirelessly. | |
bool | hasConnectedWirelessEventCable (bool includePublishedCables) const |
Returns true if this port has a connected event-only cable that should currently be rendered wirelessly. | |
VuoNode::TintColor | getWirelessAntennaTint () const |
Returns the tint color of the wireless antenna. | |
void | paintPortName (QPainter *painter, VuoRendererColors *colors) |
Paints the port's label. | |
void | paintEventBarrier (QPainter *painter, VuoRendererColors *colors) |
Paints the port's event wall or door. | |
void | paintActionIndicator (QPainter *painter, VuoRendererColors *colors) |
Draws the port action symbol (a triangle to the right of the port name) if this port has a port action. | |
void | paintWirelessAntenna (QPainter *painter, VuoRendererColors *colors) |
Draws the wireless antenna to represent any wireless cables connected to this port. | |
string | getDefaultPortNameToRender () |
Returns the default display name of the port. | |
string | getPointStringForCoords (QList< double >) const |
Given a list of coordinates, returns the string representation of the point consisting of those coordinate values as it should be rendered within a constant data flag. | |
![]() | |
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 | |
static QRectF | getPortConstantTextRectForText (QString text) |
Returns a rect enclosing the specified text . | |
static QPainterPath | getPortPath (qreal inset, VuoPortClass::PortType portType, bool isInputPort, bool carriesData) |
Returns a closed path representing the circle/triangle for a port with type portType . | |
![]() | |
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 . | |
Protected Attributes | |
bool | isRefreshPort |
Is this port a refresh port? | |
QRectF | nameRect |
The bounding box of the port's label when rendered on the canvas. | |
string | customizedPortName |
The name of the port as it should be rendered. | |
VuoRendererSignaler * | signaler |
The Qt signaler used by this port. | |
Friends | |
class | VuoRendererPublishedPort |
VuoRendererPublishedPort needs paint(...) and boundingRect() | |
class | TestVuoRenderer |
Additional Inherited Members | |
![]() | |
enum | activityState { notTrackingActivity = -1, activityInProgress = 0 } |
Special composition component activity states. More... | |
VuoRendererPort::VuoRendererPort | ( | VuoPort * | basePort, |
VuoRendererSignaler * | signaler, | ||
bool | isOutput, | ||
bool | isRefreshPort, | ||
bool | isFunctionPort | ||
) |
Creates a renderer detail for the specified base port.
QRectF VuoRendererPort::boundingRect | ( | void | ) | const |
Returns the bounding rectangle of this port (and its optional name and plug).
bool VuoRendererPort::canConnectDirectlyWithoutSpecializationTo | ( | VuoRendererPort * | toPort, |
bool | eventOnlyConnection | ||
) |
Returns a boolean indicating whether there may be a cable attached directly from this port to toPort
, taking into account the respective port types (input vs.
output; event-only vs. event+data; respective data types).
The eventOnlyConnection
argument should indicate whether the cable potentially connecting the two ports would be an always-event-only cable.
If the connection would require one or both ports to be specialized, returns false. (But see VuoRendererPort::canConnectDirectlyWithSpecializationTo
(...).)
bool VuoRendererPort::canConnectDirectlyWithSpecializationTo | ( | VuoRendererPort * | toPort, |
bool | eventOnlyConnection | ||
) |
Returns a boolean indicating whether there may be a cable attached directly from this port to toPort
, taking into account the respective port types (input vs.
output; event-only vs. event+data; respective data types), and the possibility that one port may be specialized in preparation for the connection.
The eventOnlyConnection
argument should indicate whether the cable potentially connecting the two ports would be an always-event-only cable.
Convenience function for VuoRendererPort::canConnectDirectlyWithSpecializationTo(const VuoRendererPort *toPort, VuoRendererPort **portToSpecialize, string &specializedTypeName), for use when only the returned boolean and none of the other output parameter values are needed.
bool VuoRendererPort::canConnectDirectlyWithSpecializationTo | ( | VuoRendererPort * | toPort, |
bool | eventOnlyConnection, | ||
VuoRendererPort ** | portToSpecialize, | ||
string & | specializedTypeName | ||
) |
Returns a boolean indicating whether there may be a cable attached directly from this port to toPort
, taking into account the respective port types (input vs.
output; event-only vs. event+data; respective data types), and the possibility that one port may be specialized in preparation for the connection.
[in] | toPort | The port to consider connecting to. |
[in] | eventOnlyConnection | A boolean indicating whether the connection under consideration would be always-event-only. |
[out] | portToSpecialize | The port, either this port or toPort , that will require specialization in order for the connection to be completed. Does not account for potential cascade effects. May be NULL, if the connection may be completed without specialization. |
[out] | specializedTypeName | The name of the specialized port type with which the generic port type is to be replaced. |
bool VuoRendererPort::effectivelyHasConnectedDataCable | ( | bool | includePublishedCables | ) | const |
Returns true if this port has a connected cable that effectively carries data.
For details on what it means to effectively carry data, see VuoRendererCable::effectivelyCarriesData().
void VuoRendererPort::extendedHoverEnterEvent | ( | bool | cableDragUnderway = false , |
bool | disableConnectedCableHighlight = false |
||
) |
Handle mouse hover start events generated by custom code making use of an extended hover range.
void VuoRendererPort::extendedHoverLeaveEvent | ( | ) |
Handle mouse hover leave events generated by custom code making use of an extended hover range.
void VuoRendererPort::extendedHoverMoveEvent | ( | bool | cableDragUnderway = false , |
bool | disableConnectedCableHighlight = false |
||
) |
Handle mouse hover move events generated by custom code making use of an extended hover range.
If the optional highlightOnlyIfConnectable
boolean is set to true, enable hover highlighting for this port only if the port is eligible for connection to the cable currently being connected.
QRectF VuoRendererPort::getActionIndicatorRect | ( | void | ) | const |
Returns the bounding rectangle of the port action symbol.
Assumes this port has a port action.
set< VuoRendererInputAttachment * > VuoRendererPort::getAllUnderlyingUpstreamInputAttachments | ( | void | ) | const |
Returns a set containing the input attachments connected directly or indirectly to this port in the underlying composition.
Assumption: A given port can have at most one input attachment.
vector< QGraphicsItemAnimation * > VuoRendererPort::getAnimations | ( | ) |
Returns the 'Show Events'-mode animations associated with this port.
VuoRendererInputDrawer * VuoRendererPort::getAttachedInputDrawer | ( | void | ) | const |
Returns the input drawer that is rendered as if it is attached to this port (whether or not it is in the underlying composition), or NULL if none.
|
protected |
Returns the input drawer that is rendered as if it is attached to targetHostPort
(whether or not it is in the underlying composition), or NULL if none.
VuoCable * VuoRendererPort::getCableConnectedTo | ( | VuoRendererPort * | toPort | ) |
Returns the cable connecting this port to toPort
, or NULL if not applicable.
string VuoRendererPort::getConstantAsString | ( | void | ) | const |
Returns the string representation of this port's constant data value, or an empty string if it has none.
string VuoRendererPort::getConstantAsStringToRender | ( | void | ) | const |
Returns the string representation of this port's constant data value as it should be rendered in its constant data flag, or an empty string if it has no currently assigned constant data value.
VuoType * VuoRendererPort::getDataType | ( | void | ) | const |
Returns the data type associated with this port, or NULL if there is no associated data type.
|
protected |
Returns the default display name of the port.
This may be overridden. (See VuoRendererPort::setPortNameToRender(string name)).
bool VuoRendererPort::getEligibleForSelection | ( | void | ) |
Returns a boolean indicating whether this port has been deemed eligible for selection based on its proximity to the cursor.
|
protected |
Returns a rectangle encompassing the port's event barrier.
bool VuoRendererPort::getFunctionPort | ( | void | ) | const |
Returns true if this port is a function port.
|
protected |
Returns a path representing the glyph for function ports.
bool VuoRendererPort::getInput | ( | void | ) | const |
Returns a boolean indicating whether this port is an input port.
qreal VuoRendererPort::getInset | ( | void | ) | const |
Returns the inset that should be passed to getPortPath.
QRectF VuoRendererPort::getNameRect | ( | void | ) | const |
Returns the cached bounding box of the port's label.
bool VuoRendererPort::getOutput | ( | void | ) | const |
Returns a boolean indicating whether this port is an output port.
|
protected |
Given a list of coordinates, returns the string representation of the point consisting of those coordinate values as it should be rendered within a constant data flag.
Helper function for VuoRendererPort::getConstantAsStringToRender()
.
|
static |
Returns a path representing the frame of a port constant.
If outsetPath
is not NULL, it is given a path that can be stroked with a pen of width 1 without overlapping the returned path.
|
virtual |
Returns a rect enclosing the string representation of the port's constant value.
If the port does not have a constant value, returns a null rect.
Reimplemented in VuoRendererTypecastPort.
|
staticprotected |
Returns a rect enclosing the specified text
.
|
static |
Returns a string representation of the regular expression that describes valid port identifiers.
See also VuoRendererPort::sanitizePortIdentifier(QString portID).
string VuoRendererPort::getPortNameToRender | ( | ) | const |
Returns the name of the port as it should be rendered.
This will be the empty string if name rendering is currently disabled for this port.
string VuoRendererPort::getPortNameToRenderWhenDisplayed | ( | ) | const |
Returns the name of the port as it should be rendered when it is to be rendered at all.
QPainterPath VuoRendererPort::getPortPath | ( | qreal | inset | ) | const |
Returns a closed path representing the port's circle/triangle.
Does not include constant flag (see getPortConstantPath
).
|
staticprotected |
Returns a closed path representing the circle/triangle for a port with type portType
.
Does not include constant flag (see getPortConstantPath
).
|
static |
Returns a rectangle encompassing the port's circle.
set< VuoRendererPort * > VuoRendererPort::getPortsConnectedWirelessly | ( | bool | includePublishedCables | ) | const |
Returns the set of ports that have antennas connected by wireless cable to this one.
VuoNode::TintColor VuoRendererPort::getPortTint | ( | ) | const |
Returns the tint color to be used in rendering the port shape.
bool VuoRendererPort::getPublishable | ( | ) | const |
Returns a boolean indicating whether this port is publishable.
vector< VuoRendererPublishedPort * > VuoRendererPort::getPublishedPorts | ( | void | ) | const |
Returns a vector of pointers to the externally visible published ports connected to this port.
vector< VuoRendererPublishedPort * > VuoRendererPort::getPublishedPortsConnectedByDataCarryingCables | ( | void | ) | const |
Returns a vector of pointers to the externally visible published ports connected to this port by data-carrying cables.
bool VuoRendererPort::getRefreshPort | ( | void | ) | const |
Returns true if this port is a refresh port.
VuoRendererNode * VuoRendererPort::getRenderedParentNode | ( | void | ) | const |
Returns a pointer to the node currently rendered as this port's parent.
For ports belonging to typecast nodes, this value will change depending whether the typecast is currently free-standing (in which case that is the node that will be returned) or collapsed (in which case the downstream node to which the typecast is attached is the one that will be returned).
string VuoRendererPort::getStringForRealValue | ( | double | value | ) | const |
Given a real number, returns the string representation of the number as it should be rendered within a constant data flag.
VuoRendererPort * VuoRendererPort::getTypecastParentPort | ( | ) | const |
Returns this port's typecast parent port, or NULL if it has none.
|
protected |
Returns the input drawer attached to this port in the underlying composition (whether or not it is rendered as if it is), or NULL if none.
VuoRendererNode * VuoRendererPort::getUnderlyingParentNode | ( | void | ) | const |
Returns a pointer to the node to which this port belongs in the underlying Graphviz (.dot/.vuo) representation of the composition.
For a given port, this value will never change. For typecast ports, this method will always return the original parent typecast node, regardless of whether the typecast is currently free-standing or collapsed.
|
protectedvirtual |
Returns the path of the antenna that represents any connected wireless cables, or an empty path if not applicable.
Reimplemented in VuoRendererPublishedPort.
|
protected |
Returns the tint color of the wireless antenna.
Tint output antennas the same color as their parent nodes. Tint input antennas the color of their wirelessly connected "From" ports, or leave untinted if there are multiple wirelessly connected "From" ports of conflicting tints.
|
protected |
Returns true if this port has a connected data+event cable that should currently be rendered wirelessly.
|
protected |
Returns true if this port has a connected event-only cable that should currently be rendered wirelessly.
bool VuoRendererPort::hasPortAction | ( | void | ) | const |
Returns true if this port has a port action.
bool VuoRendererPort::isConstant | ( | void | ) | const |
Returns true if this port has a constant data value.
bool VuoRendererPort::isEligibleForConnection | ( | void | ) |
Returns a boolean indicating whether this port is eligible for direct or typecast-assisted connection to the cable currently being dragged between ports.
QVariant VuoRendererPort::itemChange | ( | GraphicsItemChange | change, |
const QVariant & | value | ||
) |
Updates the port to reflect changes in state.
|
protected |
Handle key-press events.
|
protected |
Handle mouse double-click events.
void VuoRendererPort::paint | ( | QPainter * | painter, |
const QStyleOptionGraphicsItem * | option, | ||
QWidget * | widget | ||
) |
Draws an input or output port (both standard ports and refresh/function ports).
|
protected |
Draws the port action symbol (a triangle to the right of the port name) if this port has a port action.
|
protected |
Paints the port's event wall or door.
|
protected |
Paints the port's label.
|
protected |
Draws the wireless antenna to represent any wireless cables connected to this port.
|
protected |
Returns a boolean indicating whether the port name should be rendered along with this port, taking into account the port's own attributes as well as whether the port will be rendered within a published port sidebar.
void VuoRendererPort::resetTimeLastEventFired | ( | ) |
Resets the time that the last event was fired to a value that causes the port to be painted as if activity-rendering were disabled.
|
static |
Sanitizes the provided portID
to meet the requirements of a valid port identifier.
Sanitizes only by removing characters, never adding, so it is possible for sanitization to fail, in which case this function returns the empty string.
void VuoRendererPort::setAnimated | ( | bool | animated | ) |
Sets the boolean indicating whether this port is an animation, and not itself a component of the base composition.
void VuoRendererPort::setCacheModeForPortAndChildren | ( | QGraphicsItem::CacheMode | mode | ) |
Sets the cache mode of this port, and any child ports, to mode
.
void VuoRendererPort::setConstant | ( | string | constantValue | ) |
Sets this port's constant data value to that represented by the provided constantValue
string.
void VuoRendererPort::setEligibleForConnectionViaTypecast | ( | bool | eligible | ) |
Sets the boolean indicating whether this port is eligible for typecast-assisted connection to the cable currently being dragged between ports.
void VuoRendererPort::setEligibleForDirectConnection | ( | bool | eligible | ) |
Sets the boolean indicating whether this port is eligible for direct connection to the cable currently being dragged between ports.
void VuoRendererPort::setFadePercentageSinceEventFired | ( | qreal | percentage | ) |
Updates the port's state to indicate that it fired an event at such a time that its fade percentage should now be equal to percentage
.
void VuoRendererPort::setFiredEvent | ( | ) |
Updates the port's state to indicate that it has just fired an event.
void VuoRendererPort::setPortNameToRender | ( | string | name | ) |
Sets the name of the port as it should be rendered.
If set, it will override the default name of the port class.
void VuoRendererPort::setTypecastParentPort | ( | VuoRendererPort * | typecastParentPort | ) |
Sets this port's typecast parent port.
QPainterPath VuoRendererPort::shape | ( | void | ) | const |
Returns the shape of the rendered port, for use in collision detection, hit tests, and QGraphicsScene::items() functions.
bool VuoRendererPort::supportsDisconnectionByDragging | ( | void | ) |
Returns a boolean indicating whether this port supports cable disconnection by dragging from the port.
|
protected |
Determines whether this port will accept mouse events based on the port's current attributes.
void VuoRendererPort::updateGeometry | ( | ) |
Schedules a redraw of this port.
void VuoRendererPort::updateNameRect | ( | void | ) |
Updates the cached bounding box of the port's label.
void VuoRendererPort::updatePortConstantPath | ( | ) |
Calculates and updates the cached constant path for this port based on its current attributes.
|
friend |
VuoRendererPublishedPort needs paint(...) and boundingRect()
|
static |
Height, in pixels at 1:1 zoom, of a constant flag.
|
protected |
The name of the port as it should be rendered.
|
protected |
Is this port a refresh port?
|
protected |
The bounding box of the port's label when rendered on the canvas.
|
static |
Vertical distance, in pixels at 1:1 zoom, between the outer edge of the first/last port and the node frame rect.
|
static |
The vertical and horizontal inset used when rendering a circular or refresh port shape within its outer port rect.
|
static |
The vertical and horizontal inset used when rendering a triangular port shape (in the node body) within its outer port rect.
|
static |
Radius, in pixels at 1:1 zoom, of a circular port.
|
static |
Vertical distance, in pixels at 1:1 zoom, between the center points of two ports.
|
protected |
The Qt signaler used by this port.