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

Description

Provides a canvas upon which nodes and cables can be rendered.

Public Member Functions

 VuoRendererComposition (VuoComposition *baseComposition, bool renderMissingAsPresent=false, bool enableCaching=false)
 Creates a canvas upon which nodes and cables can be rendered.
 
void setBackgroundTransparent (bool transparent)
 Sets whether the composition should be rendered with a transparent background.
 
VuoRendererNodecreateRendererNode (VuoNode *baseNode)
 Creates a renderer detail for the base node.
 
void addNode (VuoNode *node)
 Adds a node to the canvas and the underlying composition.
 
void addCable (VuoCable *cable)
 Adds a cable to the canvas and the underlying composition.
 
void addPublishedInputCable (VuoCable *c)
 Adds a published input cable to the canvas and the underlying composition.
 
void addPublishedOutputCable (VuoCable *c)
 Adds a published output cable to the canvas and the underlying composition.
 
void removeNode (VuoRendererNode *rn)
 Removes a node from the canvas.
 
void removeCable (VuoRendererCable *rc)
 Removes a cable from the canvas.
 
void removePublishedInputCable (VuoRendererCable *rc)
 Removes a published input cable from the canvas and underlying composition.
 
void removePublishedOutputCable (VuoRendererCable *rc)
 Removes a published output cable from the canvas and underlying composition.
 
VuoRendererPublishedPortpublishPort (VuoPort *port, string name="", bool attemptMerge=false)
 Publishes this composition's internal port under the provided name, if possible; returns a pointer to the VuoRendererPublishedPort aliased to the internal port.
 
VuoCablecreatePublishedCable (VuoPort *vuoPseudoPort, VuoPort *internalPort)
 Creates a published cable connecting published pseudo-port vuoPort with internal port internalPort (in whichever direction appropriate).
 
void registerExternalPublishedPort (VuoPublishedPort *publishedPort, bool isInput)
 Registers a previously existing VuoPublishedPort as one of this composition's published ports.
 
int unregisterExternalPublishedPort (VuoPublishedPort *publishedPort, bool isInput)
 Removes a published input or output VuoRendererPublishedPort from the list of published ports associated with this composition.
 
void setPublishedPortName (VuoRendererPublishedPort *publishedPort, string name)
 Sets the name of the provided publishedPort to name; updates the composition's published pseudo-node and connected published cables accordingly.
 
string getUniquePublishedPortName (string baseName, bool isInput)
 Returns a string derived from the input baseName that is guaranteed to be unique either among the published input port names or among the published output port names for this composition, as specified by isInput.
 
vector< VuoRendererNode * > collapseTypecastNodes (void)
 Once all nodes and cables have been added to the scene, call this to convert each freestanding typecast node into a mini-node attached to its destination node.
 
VuoRendererTypecastPortcollapseTypecastNode (VuoRendererNode *rn)
 Convert a freestanding typecast node into a mini-node attached to its destination node; returns a pointer to the newly collapsed node.
 
void uncollapseTypecastNode (VuoRendererNode *typecastNode)
 Convert the collapsed typecast mini-node associated with the input typecastNode back into freestanding form.
 
VuoRendererNodeuncollapseTypecastNode (VuoRendererTypecastPort *typecast)
 Convert a collapsed typecast mini-node back into a freestanding node.
 
void clearInternalPortEligibilityHighlighting (void)
 Removes connection eligibility highlighting from all ports in the scene.
 
bool getRenderActivity (void)
 Returns the boolean indicating whether recent activity (e.g., node executions, event firings) by components within this composition should be reflected in the rendering of the composition.
 
- Public Member Functions inherited from VuoBaseDetail< VuoComposition >
 VuoBaseDetail (string description, VuoComposition *base)
 Creates a VuoComposition detail class.
 
VuoCompositiongetBase (void) const
 Returns the VuoComposition detail class instance's base class instance.
 
void setBase (VuoComposition *base)
 Sets the VuoComposition detail class instance's base class instance.
 

Static Public Member Functions

static void createAutoreleasePool (void)
 As a workaround for a bug in Qt 5.1.0-beta1 (https://b33p.net/kosada/node/4905), this function must be called to create the NSAutoreleasePool for a QApplication.
 

Protected Member Functions

void setRenderActivity (bool render)
 Sets the boolean indicating whether recent activity by components within this composition should be reflected in the rendering of the composition; if toggling from 'false' to 'true', resets the time of last activity for each component.
 
void repaintAllComponents ()
 Prepares every component in the composition to be repainted.
 

Protected Attributes

VuoCompilerGraphvizParserparser
 The Graphviz parser instance used by this composition.
 
map< string, VuoRendererNode * > nodeNameTaken
 An index of every node in the composition, keyed by the node's Graphviz identifier.
 
VuoRendererSignalersignaler
 The Qt signaler used by this composition.
 
bool cachingEnabled
 Should item renderings be cached?
 

Constructor & Destructor Documentation

VuoRendererComposition::VuoRendererComposition ( VuoComposition baseComposition,
bool  renderMissingAsPresent = false,
bool  enableCaching = false 
)

Creates a canvas upon which nodes and cables can be rendered.

The canvas initially contains the nodes, cables, and published ports in the base composition.

Parameters
baseCompositionThe VuoComposition to which the new VuoRendererComposition detail class should be attached.
renderMissingAsPresentSets whether node classes without implementations should be rendered as though their implementations are present. (Useful for prototyping node classes.)
enableCachingSets whether item renderings should be cached.

Member Function Documentation

void VuoRendererComposition::addCable ( VuoCable c)

Adds a cable to the canvas and the underlying composition.

If the cable doesn't have a renderer detail, one is created for it.

void VuoRendererComposition::addNode ( VuoNode n)

Adds a node to the canvas and the underlying composition.

If the node doesn't have a renderer detail, one is created for it.

If a node with the same graphviz identifier as this node is already in the canvas, changes the graphviz identifier of this node to be unique.

void VuoRendererComposition::addPublishedInputCable ( VuoCable c)

Adds a published input cable to the canvas and the underlying composition.

If the cable doesn't have a renderer detail, one is created for it.

void VuoRendererComposition::addPublishedOutputCable ( VuoCable c)

Adds a published output cable to the canvas and the underlying composition.

If the cable doesn't have a renderer detail, one is created for it.

void VuoRendererComposition::clearInternalPortEligibilityHighlighting ( void  )

Removes connection eligibility highlighting from all ports in the scene.

VuoRendererTypecastPort * VuoRendererComposition::collapseTypecastNode ( VuoRendererNode rn)

Convert a freestanding typecast node into a mini-node attached to its destination node; returns a pointer to the newly collapsed node.

vector< VuoRendererNode * > VuoRendererComposition::collapseTypecastNodes ( void  )

Once all nodes and cables have been added to the scene, call this to convert each freestanding typecast node into a mini-node attached to its destination node.

Returns a vector of pointers to the newly collapsed nodes.

void VuoRendererComposition::createAutoreleasePool ( void  )
static

As a workaround for a bug in Qt 5.1.0-beta1 (https://b33p.net/kosada/node/4905), this function must be called to create the NSAutoreleasePool for a QApplication.

VuoCable * VuoRendererComposition::createPublishedCable ( VuoPort vuoPseudoPort,
VuoPort internalPort 
)

Creates a published cable connecting published pseudo-port vuoPort with internal port internalPort (in whichever direction appropriate).

VuoRendererNode * VuoRendererComposition::createRendererNode ( VuoNode baseNode)

Creates a renderer detail for the base node.

bool VuoRendererComposition::getRenderActivity ( void  )

Returns the boolean indicating whether recent activity (e.g., node executions, event firings) by components within this composition should be reflected in the rendering of the composition.

string VuoRendererComposition::getUniquePublishedPortName ( string  baseName,
bool  isInput 
)

Returns a string derived from the input baseName that is guaranteed to be unique either among the published input port names or among the published output port names for this composition, as specified by isInput.

VuoRendererPublishedPort * VuoRendererComposition::publishPort ( VuoPort port,
string  name = "",
bool  attemptMerge = false 
)

Publishes this composition's internal port under the provided name, if possible; returns a pointer to the VuoRendererPublishedPort aliased to the internal port.

If the requested name is already taken by an existing external published port and attemptMerge is true, the existing external port will accommodate the new internal port provided that their types are compatible and the new port would not displace any previously connected port. Otherwise, the newly published internal port will be published under a unique name derived from the requested name.

void VuoRendererComposition::registerExternalPublishedPort ( VuoPublishedPort publishedPort,
bool  isInput 
)

Registers a previously existing VuoPublishedPort as one of this composition's published ports.

void VuoRendererComposition::removeCable ( VuoRendererCable rc)

Removes a cable from the canvas.

void VuoRendererComposition::removeNode ( VuoRendererNode rn)

Removes a node from the canvas.

void VuoRendererComposition::removePublishedInputCable ( VuoRendererCable rc)

Removes a published input cable from the canvas and underlying composition.

void VuoRendererComposition::removePublishedOutputCable ( VuoRendererCable rc)

Removes a published output cable from the canvas and underlying composition.

void VuoRendererComposition::repaintAllComponents ( )
protected

Prepares every component in the composition to be repainted.

void VuoRendererComposition::setBackgroundTransparent ( bool  transparent)

Sets whether the composition should be rendered with a transparent background.

void VuoRendererComposition::setPublishedPortName ( VuoRendererPublishedPort publishedPort,
string  name 
)

Sets the name of the provided publishedPort to name; updates the composition's published pseudo-node and connected published cables accordingly.

void VuoRendererComposition::setRenderActivity ( bool  render)
protected

Sets the boolean indicating whether recent activity by components within this composition should be reflected in the rendering of the composition; if toggling from 'false' to 'true', resets the time of last activity for each component.

void VuoRendererComposition::uncollapseTypecastNode ( VuoRendererNode typecastNode)

Convert the collapsed typecast mini-node associated with the input typecastNode back into freestanding form.

VuoRendererNode * VuoRendererComposition::uncollapseTypecastNode ( VuoRendererTypecastPort typecast)

Convert a collapsed typecast mini-node back into a freestanding node.

int VuoRendererComposition::unregisterExternalPublishedPort ( VuoPublishedPort publishedPort,
bool  isInput 
)

Removes a published input or output VuoRendererPublishedPort from the list of published ports associated with this composition.

Returns
The index within the list of published input port output ports at which the port was located, or -1 if not located.

Member Data Documentation

bool VuoRendererComposition::cachingEnabled
protected

Should item renderings be cached?

map<string, VuoRendererNode *> VuoRendererComposition::nodeNameTaken
protected

An index of every node in the composition, keyed by the node's Graphviz identifier.

VuoCompilerGraphvizParser* VuoRendererComposition::parser
protected

The Graphviz parser instance used by this composition.

VuoRendererSignaler* VuoRendererComposition::signaler
protected

The Qt signaler used by this composition.


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