Vuo
1.0.0
|
Provides a canvas upon which nodes and cables can be rendered.
Public Types | |
enum | appExportResult { exportSuccess, exportBuildFailure, exportSaveFailure } |
Potential outcomes of an app export attempt: More... | |
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. | |
VuoRendererNode * | createRendererNode (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 and the underlying composition. | |
void | removeCable (VuoRendererCable *rc) |
Removes a cable from the canvas and the underlying composition. | |
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. | |
void | createAndConnectInputAttachments (VuoRendererNode *node, VuoCompiler *compiler) |
Creates and connects the appropriate input attachments to the provided node . | |
VuoRendererNode * | createAndConnectMakeListNode (VuoNode *toNode, VuoPort *toPort, VuoCompiler *compiler, VuoRendererCable *&rendererCable) |
Creates a "Make List" node, and creates a cable from the "Make List" node to the given input port. | |
void | createAndConnectDictionaryAttachmentsForNode (VuoNode *node, VuoCompiler *compiler, set< VuoRendererNode * > &createdNodes, set< VuoRendererCable * > &createdCables) |
Creates the nodes and connecting cables that the input node will need to provide it with an input dictionary of keys and values, to be attached to the node's "values" input port. | |
vector< string > | extractInputVariableListFromExpressionsConstant (string constant) |
Extracts the input variables from the provided "inputVariables" constant and returns the variables in an ordered list. | |
void | addPublishedPort (VuoPublishedPort *publishedPort, bool isInput) |
Adds an existing VuoPublishedPort as one of this composition's published ports. | |
int | removePublishedPort (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. | |
VuoRendererTypecastPort * | 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. | |
void | uncollapseTypecastNode (VuoRendererNode *typecastNode) |
Convert the collapsed typecast mini-node associated with the input typecastNode back into freestanding form. | |
VuoRendererNode * | uncollapseTypecastNode (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. | |
bool | getRenderHiddenCables (void) |
Returns a boolean indicating whether hidden cables within this composition are currently displayed. | |
void | setRenderHiddenCables (bool render) |
Sets the boolean indicating whether hidden cables within this composition are currently displayed. | |
QGraphicsItem::CacheMode | getCurrentDefaultCacheMode () |
Returns the current default cache mode for components of this composition, dependent on whether caching is enabled for this composition in general and on whether running composition activity is currently being reflected in the composition rendering. | |
string | takeSnapshot (void) |
Returns a string representation of the composition (to save its current state). | |
VuoRendererComposition::appExportResult | exportApp (const QString &savePath, VuoCompiler *compiler, string &errString) |
Exports the composition as an OS X .app bundle. | |
Public Member Functions inherited from VuoBaseDetail< VuoComposition > | |
VuoBaseDetail (string description, VuoComposition *base) | |
Creates a VuoComposition detail class. | |
VuoComposition * | getBase (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 | setComponentCaching (QGraphicsItem::CacheMode) |
Sets the caching mode for each applicable graphics item within the composition to the provided cache mode. | |
void | updateGeometryForAllComponents () |
Prepares every component in the composition to be repainted. | |
VuoRendererPublishedPort * | createRendererForPublishedPortInComposition (VuoPublishedPort *publishedPort) |
Creates a renderer detail for the pre-existing publishedPort , on the assumption that the published port provided already exists in the base composition and has an associated compiler detail. | |
Static Protected Member Functions | |
static bool | isSupportedAudioFile (string path) |
Returns a boolean indicating whether the file at the provided path is a supported audio file. | |
static bool | isSupportedImageFile (string path) |
Returns a boolean indicating whether the file at the provided path is a supported image file. | |
static bool | isSupportedMeshFile (string path) |
Returns a boolean indicating whether the file at the provided path is a supported mesh file. | |
static bool | isSupportedMovieFile (string path) |
Returns a boolean indicating whether the file at the provided path is a supported movie file. | |
static bool | isSupportedSceneFile (string path) |
Returns a boolean indicating whether the file at the provided path is a supported scene file. | |
Protected Attributes | |
VuoCompilerGraphvizParser * | parser |
The Graphviz parser instance used by this composition. | |
VuoRendererSignaler * | signaler |
The Qt signaler used by this composition. | |
bool | cachingEnabled |
Should item renderings be cached? | |
bool | renderHiddenCables |
Should cables be rendered even if they have been hidden (made "wireless")? | |
Potential outcomes of an app export attempt:
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.
baseComposition | The VuoComposition to which the new VuoRendererComposition detail class should be attached. |
renderMissingAsPresent | Sets whether node classes without implementations should be rendered as though their implementations are present. (Useful for prototyping node classes.) |
enableCaching | Sets whether item renderings should be cached. |
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::addPublishedPort | ( | VuoPublishedPort * | publishedPort, |
bool | isInput | ||
) |
Adds an existing VuoPublishedPort as one of this composition's published ports.
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::createAndConnectDictionaryAttachmentsForNode | ( | VuoNode * | node, |
VuoCompiler * | compiler, | ||
set< VuoRendererNode * > & | createdNodes, | ||
set< VuoRendererCable * > & | createdCables | ||
) |
Creates the nodes and connecting cables that the input node
will need to provide it with an input dictionary of keys and values, to be attached to the node's "values" input port.
node | The node that needs the dictionary attachments created. | |
compiler | A compiler used to get the attachment node classes. | |
[out] | createdNodes | The created nodes. |
[out] | createdCables | The created cables. |
void VuoRendererComposition::createAndConnectInputAttachments | ( | VuoRendererNode * | node, |
VuoCompiler * | compiler | ||
) |
Creates and connects the appropriate input attachments to the provided node
.
VuoRendererNode * VuoRendererComposition::createAndConnectMakeListNode | ( | VuoNode * | toNode, |
VuoPort * | toPort, | ||
VuoCompiler * | compiler, | ||
VuoRendererCable *& | rendererCable | ||
) |
Creates a "Make List" node, and creates a cable from the "Make List" node to the given input port.
toNode | The node that contains toPort . | |
toPort | The input port. Assumed to be a data-and-event input port carrying list data. | |
compiler | A compiler used to get the "Make List" node class. | |
[out] | rendererCable | The created cable. |
|
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.
|
protected |
Creates a renderer detail for the pre-existing publishedPort
, on the assumption that the published port provided already exists in the base composition and has an associated compiler detail.
VuoRendererNode * VuoRendererComposition::createRendererNode | ( | VuoNode * | baseNode | ) |
Creates a renderer detail for the base node.
VuoRendererComposition::appExportResult VuoRendererComposition::exportApp | ( | const QString & | savePath, |
VuoCompiler * | compiler, | ||
string & | errString | ||
) |
Exports the composition as an OS X .app bundle.
[in] | savePath | The path where the .app is to be saved. |
[in] | compiler | The compiler to be used to generate the composition executable. |
[out] | errString | The error message resulting from the export process, if any. |
appExportResult
value detailing the outcome of the export attempt. vector< string > VuoRendererComposition::extractInputVariableListFromExpressionsConstant | ( | string | constant | ) |
Extracts the input variables from the provided "inputVariables" constant
and returns the variables in an ordered list.
QGraphicsItem::CacheMode VuoRendererComposition::getCurrentDefaultCacheMode | ( | ) |
Returns the current default cache mode for components of this composition, dependent on whether caching is enabled for this composition in general and on whether running composition activity is currently being reflected in the composition rendering.
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.
bool VuoRendererComposition::getRenderHiddenCables | ( | void | ) |
Returns a boolean indicating whether hidden cables within this composition are currently displayed.
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
.
|
staticprotected |
Returns a boolean indicating whether the file at the provided path
is a supported audio file.
|
staticprotected |
Returns a boolean indicating whether the file at the provided path
is a supported image file.
|
staticprotected |
Returns a boolean indicating whether the file at the provided path
is a supported mesh file.
|
staticprotected |
Returns a boolean indicating whether the file at the provided path
is a supported movie file.
|
staticprotected |
Returns a boolean indicating whether the file at the provided path
is a supported scene file.
void VuoRendererComposition::removeCable | ( | VuoRendererCable * | rc | ) |
Removes a cable from the canvas and the underlying composition.
void VuoRendererComposition::removeNode | ( | VuoRendererNode * | rn | ) |
Removes a node from the canvas and the underlying composition.
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.
int VuoRendererComposition::removePublishedPort | ( | VuoPublishedPort * | publishedPort, |
bool | isInput | ||
) |
Removes a published input or output VuoRendererPublishedPort from the list of published ports associated with this composition.
void VuoRendererComposition::setBackgroundTransparent | ( | bool | transparent | ) |
Sets whether the composition should be rendered with a transparent background.
|
protected |
Sets the caching mode for each applicable graphics item within the composition to the provided cache mode.
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.
|
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::setRenderHiddenCables | ( | bool | render | ) |
Sets the boolean indicating whether hidden cables within this composition are currently displayed.
string VuoRendererComposition::takeSnapshot | ( | void | ) |
Returns a string representation of the composition (to save its current state).
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.
|
protected |
Prepares every component in the composition to be repainted.
|
protected |
Should item renderings be cached?
|
protected |
The Graphviz parser instance used by this composition.
|
protected |
Should cables be rendered even if they have been hidden (made "wireless")?
|
protected |
The Qt signaler used by this composition.