Vuo  2.0.0
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Friends | List of all members
VuoEditorComposition Class Reference

Description

Handles drags-and-drops and performs node instantiation for the editor window.

Definition at line 34 of file VuoEditorComposition.hh.

Public Types

enum  targetComponentType { targetTypePort, targetTypeNodeHeader, targetTypeAny }
 Specifies the desired type of composition component to be returned from a search. More...
 
- Public Types inherited from VuoRendererComposition
enum  GridType { NoGrid, LineGrid, PointGrid }
 What kind of decorative grid to render on the canvas background. More...
 

Public Slots

void updateFeedbackErrors (VuoRendererPort *targetPort=NULL)
 Checks the composition, along with the cable being dragged (if any), for invalid feedback loops. More...
 
void renameSelectedNodes ()
 Triggers interactive re-naming of selected non-drawer nodes. More...
 
void deleteSelectedCompositionComponents ()
 Deletes currently selected nodes and cables. More...
 
void deleteSelectedCompositionComponents (string commandDescription)
 Deletes currently selected nodes and cables. More...
 
void togglePortPublicationStatus ()
 Publishes or unpublishes the port associated with the signal that activated this slot, as appropriate. More...
 
void tintSelectedItems (int tintColor)
 Sets the tint color of the selected nodes and comments to tintColor. More...
 
void selectAllCompositionComponents ()
 Selects all nodes, cables, and comments on the canvas. More...
 
void selectAllComments ()
 Selects all comments on the canvas. More...
 
void deselectAllCompositionComponents ()
 Deselects all nodes, cables, and comments on the canvas. More...
 
void moveSelectedItemsBy (qreal dx, qreal dy)
 Moves currently selected nodes and comments dx points horizontally and dy points vertically. More...
 
void updateGeometryForAllComponents ()
 Prepares every component in the composition to be repainted (slot version that simply calls the VuoRendererComposition non-slot version of the same method). More...
 
void emitSubcompositionEditRequested ()
 Workaround so that the "Edit Subcomposition" context menu item can emit a signal with argument when triggered. More...
 
void setPopoverEventsEnabled (bool enable)
 Sets the boolean indicating whether to display popovers for components within the canvas in response to mouse events from this point on. More...
 
void disablePopoverForPort (string)
 Closes the popover for the port with the provided portID. More...
 

Signals

void leftMouseButtonReleased (void)
 Emitted when the left mouse button is released. More...
 
void emptyCanvasLocationLeftClicked ()
 Emitted when the left mouse button is released on an empty region of the canvas. More...
 
void itemsMoved (set< VuoRendererNode * > nodes, set< VuoRendererComment * > comments, qreal dx, qreal dy, bool movedByDragging)
 Emitted in order to move nodes and comments. More...
 
void commentResized (VuoRendererComment *comment, qreal dx, qreal dy)
 Emitted when a comment is resized. More...
 
void selectedComponentsDuplicated ()
 Emitted in order to duplicate components. More...
 
void componentsAdded (QList< QGraphicsItem * > addedComponents, VuoEditorComposition *target)
 Emitted in order to add components. More...
 
void componentsRemoved (QList< QGraphicsItem * > removedComponents, string commandDescription="Remove")
 Emitted in order to remove components. More...
 
void cablesHidden (set< VuoRendererCable * > cables)
 Emitted when cables are to be hidden. More...
 
void selectedInternalCablesHidden ()
 Emitted when selected internal cables are to be hidden. More...
 
void cablesUnhidden (set< VuoRendererCable * > cables)
 Emitted when cables are to be unhidden. More...
 
void changeInHiddenCables ()
 Emitted when a hidden cable has been added to or removed from the composition. More...
 
void portPublicationRequested (VuoPort *port, bool forceEventOnlyPublication)
 Emitted when a port is to be published. More...
 
void portPublicationRequested (VuoPort *internalPort, VuoPublishedPort *externalPort, bool forceEventOnlyPublication, VuoPort *portToSpecialize, string specializedTypeName, string typecastToInsert, bool useUndoStackMacro)
 Emitted when an internal port is to be published in association with a specific external published port. More...
 
void portUnpublicationRequested (VuoPort *port)
 Emitted when a port is to be unpublished. More...
 
void publishedPortNameEditorRequested (VuoRendererPublishedPort *port, bool useUndoStack)
 Emitted when a published port name editor should be displayed. More...
 
void publishedPortModified ()
 Emitted when the composition has had published ports added, removed, or re-named. More...
 
void protocolPortChangesRequested (map< VuoPublishedPort *, string > publishedPortsToRename, set< VuoPublishedPort * > publishedPortsToRemove, vector< VuoPublishedPort * > publishedPortsToAdd, bool beginUndoStackMacro, bool endUndoStackMacro)
 Emitted when published ports need to be modified for compatibility with a newly activated protocol. More...
 
void activeProtocolChanged ()
 Emitted when the active protocol has changed. More...
 
void triggerThrottlingUpdated (VuoPort *port, enum VuoPortClass::EventThrottling eventThrottling)
 Emitted when a trigger port's event-throttling mode is to be updated. More...
 
void inputPortCountAdjustmentRequested (VuoRendererNode *node, int inputPortCountDelta, bool requestedByDragging)
 Emitted when a node is to have its port count adjusted. More...
 
void commentEditorRequested (VuoRendererComment *comment)
 Emitted in order to display a comment editor. More...
 
void commentZoomRequested (VuoRendererComment *comment)
 Emitted in order to zoom in on a comment. More...
 
void nodeSwapRequested (VuoRendererNode *node, string newNodeClassName)
 Emitted when a node is to be replaced with a new node of a similar class. More...
 
void specializePort (VuoRendererPort *port, string specializedTypeName)
 Emitted when a generic port is to be specialized. More...
 
void respecializePort (VuoRendererPort *port, string specializedTypeName)
 Emitted when a specialized port is to be re-specialized. More...
 
void unspecializePort (VuoRendererPort *port)
 Emitted when a specialized port is to be reverted to its generic origins. More...
 
void highlightPublishedPortDropLocationsRequested (VuoRendererPort *port, VuoRendererCable *cable)
 Emitted when eligible published port sidebar drop locations for port should be visually highlighted. More...
 
void clearPublishedPortDropLocationHighlightingRequested ()
 Emitted when eligible published port sidebar drop locations should no longer be highlighted. More...
 
void connectionCompletedByDragging (VuoRendererCable *cableInProgress, VuoRendererPort *targetPort, pair< VuoRendererCable *, VuoRendererCable * > cableArgs, VuoRendererNode *typecastNodeToDelete, pair< string, string > typeArgs, pair< VuoRendererPort *, VuoRendererPort * > portArgs)
 Emitted after a cable has been connected to a node. More...
 
void duplicationOperationCancelled ()
 Emitted in order to cancel duplication of components. More...
 
void inputEditorRequested (VuoRendererPort *port)
 Emitted in order to display an input editor. More...
 
void portConstantChangeRequested (VuoRendererPort *port, string value)
 Emitted in order to change the value of a port constant. More...
 
void nodeTitleEditorRequested (VuoRendererNode *node)
 Emitted in order to display a node title editor. More...
 
void subcompositionEditRequested (VuoRendererNode *node)
 Emitted in order to open a subcomposition for editing. More...
 
void textCodeEditRequested (VuoRendererNode *node)
 Emitted in order to open node class source code for editing. More...
 
void subcompositionInsertionRequested (QPointF scenePos)
 Emitted in order to insert a new subcomposition node at the provided scene position. More...
 
void commentInsertionRequested (QPointF scenePos)
 Emitted in order to insert a new comment at the provided scene position. More...
 
void tintSelectedItemsRequested (VuoNode::TintColor tintColor)
 Emitted when the user requests that the selected items be tinted. More...
 
void compositionStoppedItself ()
 Emitted when the user quits the composition or the composition crashes. More...
 
void buildStarted ()
 Emitted when starting to compile and link the composition. More...
 
void buildFinished (QString error)
 Emitted when finished attempting to compile and link the composition to run within the editor. If the build failed, the argument is an error message. More...
 
void stopFinished ()
 Emitted when finished stopping the composition. More...
 
void nodePopoverRequestedForClass (VuoNodeClass *nodeClass)
 Emitted when a node popover is to be displayed. More...
 
void popoverDetached ()
 Emitted when one of this composition's popovers has just been detached. More...
 
void compositionOnTop (bool)
 Emitted when the composition detects that it is or is no longer the topmost composition. More...
 
void applicationActive (bool)
 Emitted (if this composition is topmost) when the application has been activated or deactivated. More...
 
void refirePortChanged ()
 Emitted when the trigger port to be re-fired changes. More...
 
void cableDragInitiated ()
 Emitted when the user begins dragging a cable. More...
 
void cableDragEnded ()
 Emitted when the user ends a cable drag, whether a connection was completed or not. More...
 
void undoStackMacroBeginRequested (QString commandName)
 Emitted when the upcoming sequence of requested operations should be coalesced in an Undo stack macro. More...
 
void undoStackMacroEndRequested ()
 Emitted when the sequence of operations to be coalesced into an Undo stack macro has completed. More...
 
void refactorRequested ()
 Emitted when the selected nodes should be refactored into a subcomposition. More...
 

Public Member Functions

 VuoEditorComposition (VuoComposition *baseComposition)
 Creates an empty canvas upon which nodes and cables can be rendered. More...
 
void setCompiler (VuoCompiler *compiler)
 Specifies a compiler instance to be used by this composition (for, e.g., instantiating dropped nodes). More...
 
void setModuleManager (VuoModuleManager *moduleManager)
 Specifies the module manager used by this composition and its containing VuoEditorWindow. More...
 
VuoModuleManagergetModuleManager (void)
 Returns the module manager used by this composition and its containing VuoEditorWindow. More...
 
void setColor (bool isDark)
 Makes the widget dark. More...
 
void setInputEditorManager (VuoInputEditorManager *inputEditorManager)
 Specifies an input editor manager instance to be used by this composition (for, e.g., determining whether the port nearest a right-click has an available input editor and should therefore have a "Set Value" item in its context menu). More...
 
VuoInputEditorManagergetInputEditorManager ()
 Returns the input editor manager instance used by this composition (for, e.g., determining whether the port nearest a right-click has an available input editor and should therefore have a "Set Value" item in its context menu). More...
 
VuoRendererNodecreateNode (QString nodeClassName, string title="", double x=0, double y=0)
 Instantiates a node of class name nodeClassName. More...
 
VuoNodecreateBaseNode (VuoCompilerNodeClass *nodeClass, VuoNode *modelNode, string title="", double x=0, double y=0)
 Creates an instance of nodeClass if it is legal to add to this composition. More...
 
VuoNodecreateNodeWithMissingImplementation (VuoNodeClass *modelNodeClass, VuoNode *modelNode, string title="", double x=0, double y=0)
 Creates an instance of an implementation-less node class. More...
 
void addNode (VuoNode *node, bool nodeShouldBeRendered=true, bool nodeShouldBeGivenUniqueIdentifier=true)
 Adds a node to the canvas and registers the node and its ports in the composition's ID maps. More...
 
void removeNode (VuoRendererNode *rn, bool resetState=true)
 Removes a node from the canvas and disables all of its associated port popovers. More...
 
void replaceNode (VuoRendererNode *oldNode, VuoNode *newNode, bool transferConstantsAndCables)
 Replaces oldNode with newNode in the composition, performing the same cleanup/setup of editor state as VuoEditorComposition::removeNode and VuoEditorComposition::addNode. More...
 
void addCable (VuoCable *cable)
 Adds a cable to the canvas. More...
 
void removeCable (VuoRendererCable *rc)
 Removes a cable from the canvas. More...
 
VuoRendererNodecreateAndConnectMakeListNode (VuoNode *toNode, VuoPort *toPort, VuoRendererCable *&rendererCable)
 Creates a "Make List" node, and creates a cable from the "Make List" node to the given input port. More...
 
void createAndConnectDictionaryAttachmentsForNode (VuoNode *node, set< VuoRendererNode * > &createdRendererNodes, set< VuoRendererCable * > &createdRendererCables)
 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. More...
 
QList< QGraphicsItem * > createAndConnectInputAttachments (VuoRendererNode *node, bool createButDoNotAdd=false, bool checkForPreexisting=true)
 Creates and connects the appropriate input attachments to the provided node. More...
 
void modifyComponents (void(^modify)(void))
 Wraps the call to modify in code that saves and restores the state of the composition, such as selected components. More...
 
bool requiresStructuralChangesAfterValueChangeAtPort (VuoRendererPort *port)
 Returns a boolean indicating whether a change in value at the provided port will trigger structural changes to the composition. More...
 
QAction * getContextMenuDeleteSelectedAction (void)
 Returns the context menu's action that deletes a component. More...
 
QMenu * getContextMenuTints (QMenu *parent=0)
 Returns a "Tint" submenu for the provided parent menu. More...
 
void populateChangeNodeMenu (QMenu *menu, VuoRendererNode *node, int matchLimit=0)
 Populates the "Change To" menu for the provided node with the requested number of matches if available, or however many non-zero-scoring matches are available if fewer. More...
 
set< VuoRendererCable * > getCablesInternalToSubcomposition (QList< QGraphicsItem * > subcompositionComponents)
 Returns the set of cables creating internal connections within the set of input subcompositionComponents. More...
 
VuoCablegetCableInProgress ()
 Returns the cable currently being dragged, or NULL if no cable is currently being dragged. More...
 
bool getCableInProgressWasNew ()
 Returns a boolean indicating whether the cable currently being dragged was only just created at the initiation of the drag. More...
 
bool getMenuSelectionInProgress ()
 Returns a boolean indicating whether selection from a context menu is currently in progress. More...
 
VuoRendererNodefindNearbyNodeHeader (QPointF scenePos)
 Returns the node whose header area scenePos falls within, or NULL if none. More...
 
QGraphicsItem * findNearbyComponent (QPointF scenePos, targetComponentType componentType=VuoEditorComposition::targetTypeAny, bool limitPortCollisionRange=true)
 Returns a pointer to the component (port, cable, node, or comment) that should be operated upon if the user were to click at position scenePos, or NULL if no component is within collision range. More...
 
VuoRendererPortfindTargetPortForCableDroppedOnNodeHeader (VuoRendererNode *node)
 Returns the port to which an event-only cable would be connected if the endpoint of cableInProgress were dropped onto the header of node. More...
 
VuoRendererPortfindDefaultPortForEventOnlyConnection (VuoRendererNode *node, bool inputPort)
 Returns the port to which an event-only cable should be connected by default. More...
 
QRectF internalItemsBoundingRect () const
 Calculates and returns the bounding rect of all internal composition components on the scene. More...
 
QRectF internalSelectedItemsBoundingRect () const
 Calculates and returns the bounding rect of all currenty selected composition nodes and cables. More...
 
QRectF internalSelectedItemsChildrenBoundingRect () const
 Calculates and returns the bounding rect of all currenty selected composition nodes, ports, and cables. More...
 
set< VuoRendererNode * > getSelectedNodes ()
 Returns the set of currently selected nodes. More...
 
set< VuoRendererComment * > getSelectedComments ()
 Returns the set of currently selected comments. More...
 
set< VuoRendererCable * > getSelectedCables (bool includePublishedCables)
 Returns the set of currently selected cables. More...
 
void cancelCableDrag (void)
 Cancel the current cable drag operation, if applicable. More...
 
void revertCableDrag (void)
 Revert the current cable drag operation, if applicable, without pushing the operation onto the Undo stack. More...
 
void clearHoverHighlighting ()
 Clear hover-highlighting of the previously highlighted composition component. More...
 
void repaintFeedbackErrorMarks ()
 Updates the renderings of any currently existing feedback error marks. More...
 
void setIgnoreApplicationStateChangeEvents (bool ignore)
 Sets the boolean indicating whether application state change events should currently be ignored. More...
 
json_objectgetPortValueInRunningComposition (VuoPort *port)
 If the composition is running (or it's a subcomposition and the top-level composition is running), returns the current data value associated with the port. More...
 
string getIdentifierForStaticPort (VuoPort *staticPort, VuoNode *parentNode=NULL)
 Returns the identifier of the provided staticPort in the stored composition. More...
 
VuoPortgetPortWithStaticIdentifier (string portID)
 Returns the port registered to the composition under the provided portID. More...
 
void updateInternalPortConstant (string portID, string newValue, bool updateInRunningComposition)
 Updates the constant value of the internal input port with the provided portID to the newValue, in both the static and running copies of the composition (if applicable). More...
 
void updatePublishedPortConstant (string portName, string newValue, bool updateInRunningComposition)
 Updates the constant value of the internal input port with the provided portID to the newValue, in both the stored and running copies of the composition (if applicable). More...
 
void updatePortConstant (VuoCompilerPort *port, string newValue, bool updateInRunningComposition=true)
 Updates the provided port constant with the newValue in both the stored and running copies of the composition (if applicable). More...
 
void updateGenericPortTypes (void)
 Gives each group/network of connected generic ports a unique generic type; updates port popovers accordingly. More...
 
void createReplacementsToUnspecializePort (VuoPort *port, map< VuoNode *, string > &nodesToReplace, set< VuoCable * > &cablesToDelete)
 Outputs the composition components that would need to be modified in order to unspecialize the given port. More...
 
void run (string compositionSnapshot)
 Asynchronously compiles, links, and runs a composition created from the snapshot. More...
 
void stop (void)
 Asynchronously stops the running composition. More...
 
bool isRunning (void)
 Returns true if the composition is running. More...
 
void updateRunningComposition (string oldCompositionSnapshot, string newCompositionSnapshot, VuoCompilerCompositionDiff *diffInfo=nullptr, set< string > dependenciesUninstalled=set< string >())
 Asynchronously replaces the running composition (if any) with a composition created from newCompositionSnapshot. More...
 
void updateCompositionsThatContainThisSubcomposition (string newCompositionSnapshot)
 If this is a subcomposition, reloads it so that the node library and all compositions containing instances of it see the current (not-yet-saved) state of the subcomposition. More...
 
void syncInternalPortConstantInRunningComposition (string runningPortID)
 If the composition is running, tells the running composition to synchronize the constant value for the internal port with the provided ID to that of the associated port in the stored composition. More...
 
void syncPublishedPortConstantInRunningComposition (string portName)
 If the composition is running, tells the running composition to synchronize the constant value for the published port of the provided name to that of the associated port in the stored composition. More...
 
void updateInternalPortConstantInRunningComposition (VuoCompilerInputEventPort *port, string constant)
 If the composition is running, tells the composition to set a new constant value on the port. More...
 
void updateInternalPortConstantInSubcompositionInstances (string subcompositionPath, string portIdentifier, string constant)
 If the composition is running and contains one or more instances of the subcomposition whose source code is at subcompositionPath, tells the composition to set a new constant value on the port in each instance of the subcomposition. More...
 
void updatePublishedInputPortConstantInRunningComposition (VuoPublishedPort *port, string constant)
 If the composition is running, tells the composition to set a new constant value on the published input port. More...
 
void populateNodeAndPortIdentifierMappings ()
 Populates the mappings between nodes and ports in this composition and their stored and running identifiers. More...
 
VuoRendererPublishedPortpublishInternalPort (VuoPort *port, bool forceEventOnlyPublication, string name="", VuoType *type=NULL, bool attemptMerge=false, bool *mergePerformed=NULL)
 Publishes this composition's internal port under the provided name, if possible; returns a pointer to the VuoRendererPublishedPort aliased to the internal port. More...
 
VuoCablecreatePublishedCable (VuoPort *externalPort, VuoPort *internalPort, bool forceEventOnlyPublication)
 Creates a published cable connecting published externalPort with internal port internalPort (in whichever direction appropriate). More...
 
void addActiveProtocol (VuoProtocol *protocol, bool useUndoStack)
 Adds an active protocol for this composition, removing any previous active protocol. More...
 
bool removeActiveProtocol (VuoProtocol *protocol, VuoProtocol *replacementProtocol)
 Unsets the active protocol for this composition, pushing any necessary changes to published ports onto the Undo stack. More...
 
void removeActiveProtocolWithoutModifyingPorts (VuoProtocol *protocol)
 Deactivates the provided protocol for this composition, updating the isProtocolPort attribute of each affected port. More...
 
map< string, string > publishPorts (set< string > portsToPublish)
 Publishes the ports with the provided identifiers in order of their y-coordinates on canvas, from top to bottom. More...
 
string generateSpecialPublishedNameForPort (VuoPort *port)
 If the provided port is one of the handful of port types whose default published name should be something other than the port's own name, returns that specialized name. More...
 
VuoProtocolgetActiveProtocol ()
 Returns the active protocol for this composition. More...
 
VuoCompilerDrivergetDriverForActiveProtocol ()
 Returns the driver for the currently active protocol, or NULL if there is no active protocol or there is no driver available for the active protocol. More...
 
bool validateProtocol (VuoEditorWindow *window, bool isExportingMovie)
 Checks whether the composition superficially meets the requirements as an image filter/generator/transition protocol composition eligible for movie or plugin export. More...
 
void addPublishedPort (VuoPublishedPort *publishedPort, bool isPublishedInput, bool shouldUpdateUi=true)
 Adds an existing VuoPublishedPort as one of this composition's published ports. More...
 
int removePublishedPort (VuoPublishedPort *publishedPort, bool isPublishedInput, bool shouldUpdateUi=true)
 Removes a published input or output VuoRendererPublishedPort from the list of published ports associated with this composition. More...
 
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. More...
 
void leftMousePressEventAtNearbyItem (QGraphicsItem *nearbyItem, QGraphicsSceneMouseEvent *event)
 Handle a left mouse press event already determined to be within operable range of the provided nearbyItem. More...
 
QGraphicsItem * findNearbyPort (QPointF scenePos, bool limitPortCollisionRange=true)
 Returns a pointer to the port that should be operated upon if the user were to click at position scenePos, or NULL if no port is within collision range. More...
 
vector< string > findAvailableTypecastsToBridge (VuoRendererPort *fromPort, VuoRendererPublishedPort *toPublishedPort)
 Returns a list containing the names of all loaded typecast classes capable of bridging the connection from the internal fromPort to the published toPort. More...
 
vector< string > findAvailableTypecastsToBridge (VuoRendererPublishedPort *fromPublishedPort, VuoRendererPort *toPort)
 Returns a list containing the names of all loaded typecast classes capable of bridging the connection from the published fromPort to the internal toPort. More...
 
string selectTypecastToBridge (VuoRendererPublishedPort *fromPublishedPort, VuoRendererPort *toPort)
 Retrieves the list of loaded typecast classes capable of bridging the connection from published port fromPort to internal port toPort; returns one of the retrieved options. More...
 
string selectTypecastToBridge (VuoRendererPort *fromPort, VuoRendererPublishedPort *toPublishedPort)
 Retrieves the list of loaded typecast classes capable of bridging the connection from internal port fromPort to published port toPort; returns one of the retrieved options. More...
 
bool addCompatibleTypesToContextMenu (VuoRendererPort *genericPort, set< string > compatibleTypesInIsolation, set< string > compatibleTypesInContext, QMenu *contextMenu, bool addSeparatorBeforeSubmenu, bool limitToNodeSet, string nodeSetName="")
 Populates the contextMenu for the provided genericPort with the set of compatibleTypesInContext to which the port may be specialized within its current generic port network (or compatibleTypesInIsolation when the port is in isolation), organizing the compatible types by node set and associating each menu item with the data and slot necessary to accomplish the "Specialize" operation. More...
 
vector< string > getAllSpecializedTypeOptions (bool lists)
 Returns the full list of type names that should be listed as specialization options for a completely generic port. More...
 
void deleteSelectedNodes (string commandDescription="")
 Deletes currently selected nodes. More...
 
void clear ()
 Deletes all composition components. More...
 
VuoPortPopovergetActivePopoverForPort (string portID)
 Returns a pointer to the active popover for the port with the provided portID, if such a popover exists. More...
 
void enablePopoverForPort (VuoRendererPort *rp)
 Displays a new popover for the provided port. More...
 
void updatePortPopovers (VuoRendererNode *node=NULL)
 Updates the text of all active popovers associated with this composition. More...
 
void updateDataInPortPopoverFromRunningTopLevelComposition (VuoEditorComposition *popoverComposition, string popoverCompositionIdentifier, string portID)
 Updates the data value displayed in the port's popover, and subscribes to further updates for the port. More...
 
void updateDataInPortPopover (string portID)
 Updates the data value displayed in the port's popover, and subscribes to further updates for the port. More...
 
void movePopoversBy (int dx, int dy)
 Moves all popovers associated with this composition dx points horizontally and dy points vertically. More...
 
void disableNondetachedPortPopovers (VuoRendererNode *node=NULL, bool recordWhichPopoversClosed=false)
 Disables non-detached port popovers associated with this composition. More...
 
void disableStrandedPortPopovers ()
 Disables any port popover that does not currently have an associated port in the composition. More...
 
void disableErrorPopovers ()
 Disables all error popovers associated with this composition. More...
 
void disablePopovers ()
 Disables all popovers associated with this composition, whether they are detached or not. More...
 
void emitCompositionOnTop (bool top)
 Emits a compositionOnTop signal. More...
 
void emitPublishedPortNameEditorRequested (VuoRendererPublishedPort *port)
 Emits a publishedPortNameEditorRequested signal. More...
 
void receivedTelemetryInputPortUpdated (string compositionIdentifier, string portIdentifier, bool receivedEvent, bool receivedData, string dataSummary)
 This delegate method is invoked every time any input port receives an event or data. More...
 
void receivedTelemetryOutputPortUpdated (string compositionIdentifier, string portIdentifier, bool sentEvent, bool sentData, string dataSummary)
 This delegate method is invoked every time any output port transmits or fires an event. More...
 
void receivedTelemetryEventDropped (string compositionIdentifier, string portIdentifier)
 This delegate method is invoked every time any trigger port drops an event. More...
 
void receivedTelemetryNodeExecutionStarted (string compositionIdentifier, string nodeIdentifier)
 This delegate method is invoked every time a node has started executing. More...
 
void receivedTelemetryNodeExecutionFinished (string compositionIdentifier, string nodeIdentifier)
 This delegate method is invoked every time a node has finished executing. More...
 
void lostContactWithComposition (void)
 Called if the user quits the composition or the composition crashes. More...
 
bool getShowEventsMode ()
 Returns a boolean indicating whether this composition is currently in 'Show Events' mode. More...
 
void setShowEventsMode (bool showEventsMode)
 Sets the boolean indicating whether this composition is currently in 'Show Events' mode. More...
 
bool hasHiddenInternalCables ()
 Returns a boolean indicating whether the composition contains any hidden (wireless) internal cables. More...
 
bool hasHiddenPublishedCables ()
 Returns a boolean indicating whether the composition contains any hidden (wireless) published cables. More...
 
void setTriggerPortToRefire (VuoPort *port)
 Sets the trigger port to be fired when the user selects the "re-fire" option. More...
 
VuoPortgetTriggerPortToRefire ()
 Returns the trigger port to be fired when the user selects the "re-fire" option. More...
 
void refireTriggerPortEvent ()
 Fires another event from the trigger port that was most recently manually fired. More...
 
string takeSnapshot (void)
 Returns a string representation of the composition (to save its current state). More...
 
string generateCompositionHeader ()
 Generates a header containing this composition's metadata. More...
 
QString getFormattedName ()
 Returns the formatted name of the composition, either pre-formatted by the user or, otherwise, formatted automatically. More...
 
void beginDisplayingActivity (bool includePorts=true)
 Begin reflecting events and executions in the rendering of the composition. More...
 
void stopDisplayingActivity ()
 Stop reflecting events and executions in the rendering of the composition. More...
 
- Public Member Functions inherited from VuoRendererComposition
 VuoRendererComposition (VuoComposition *baseComposition, bool renderMissingAsPresent=false, bool enableCaching=false)
 Creates a canvas upon which nodes and cables can be rendered. More...
 
void addComponentsInCompositionToCanvas ()
 Add any nodes, cables, published ports, and published cables that are already in the base composition. More...
 
void setBackgroundTransparent (bool transparent)
 Sets whether the composition should be rendered with a transparent background. More...
 
VuoRendererNodecreateRendererNode (VuoNode *baseNode)
 Creates a renderer detail for the base node. More...
 
VuoRendererCommentcreateRendererComment (VuoComment *baseComment)
 Creates a renderer detail for the base comment. More...
 
void addNode (VuoNode *node, bool nodeShouldBeRendered=true, bool nodeShouldBeGivenUniqueIdentifier=true)
 Adds a node to the underlying composition and (if nodeShouldBeRendered is true), to the canvas. More...
 
void addCable (VuoCable *cable)
 Adds a cable to the canvas and the underlying composition. More...
 
void addComment (VuoComment *comment)
 Adds a comment to the canvas and the underlying composition. More...
 
void removeNode (VuoRendererNode *rn)
 Removes a node from the canvas and the underlying composition. More...
 
void removeCable (VuoRendererCable *rc)
 Removes a cable from the canvas and the underlying composition. More...
 
void removeComment (VuoRendererComment *rcomment)
 Removes a comment from the canvas and the underlying composition. More...
 
QList< QGraphicsItem * > createAndConnectInputAttachments (VuoRendererNode *node, VuoCompiler *compiler, bool createButDoNotAdd=false, bool checkForPreexisting=true)
 Creates and connects the appropriate input attachments to the provided node. More...
 
VuoRendererNodecreateAndConnectMakeListNode (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. More...
 
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. More...
 
vector< string > extractInputVariableListFromExpressionsConstant (string constant, string nodeClassName)
 Extracts the input variables from the provided "inputVariables" constant and returns the variables in an ordered list. More...
 
void addPublishedPort (VuoPublishedPort *publishedPort, bool isPublishedInput, VuoCompiler *compiler)
 Adds an existing VuoPublishedPort as one of this composition's published ports. More...
 
int removePublishedPort (VuoPublishedPort *publishedPort, bool isPublishedInput, VuoCompiler *compiler)
 Removes a published input or output VuoRendererPublishedPort from the list of published ports associated with this composition. More...
 
VuoRendererPublishedPortcreateRendererForPublishedPortInComposition (VuoPublishedPort *publishedPort, bool isPublishedInput)
 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. More...
 
void setPublishedPortName (VuoRendererPublishedPort *publishedPort, string name, VuoCompiler *compiler)
 Sets the name of the provided publishedPort to name; updates the composition's published pseudo-node and connected published cables accordingly. More...
 
string getUniquePublishedPortName (string baseName)
 Returns a string derived from the input baseName that is guaranteed to be unique among the published input and output port names for this composition. More...
 
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. More...
 
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. More...
 
void uncollapseTypecastNodes ()
 Convert all collapsed typecast mini-nodes in the composition back into freestanding form. More...
 
void uncollapseTypecastNode (VuoRendererNode *typecastNode)
 Convert the collapsed typecast mini-node associated with the input typecastNode back into freestanding form. More...
 
VuoRendererNodeuncollapseTypecastNode (VuoRendererTypecastPort *typecast)
 Convert a collapsed typecast mini-node back into a freestanding node. More...
 
void clearInternalPortEligibilityHighlighting (void)
 Removes connection eligibility highlighting from all ports and cables in the scene. More...
 
VuoNodegetPublishedInputNode (void)
 Returns the published input node associated with this composition. More...
 
VuoNodegetPublishedOutputNode (void)
 Returns the published output node associated with this composition. More...
 
bool getRenderNodeActivity (void)
 Returns the boolean indicating whether recent activity (e.g., node executions, search spotlighting) by nodes within this composition should be reflected in the rendering of the composition. More...
 
bool getRenderPortActivity (void)
 Returns the boolean indicating whether recent activity (e.g., trigger port executions) by ports within this composition should be reflected in the rendering of the composition. More...
 
bool getRenderHiddenCables (void)
 Returns a boolean indicating whether hidden cables within this composition are currently displayed. More...
 
void setRenderHiddenCables (bool render)
 Sets the boolean indicating whether hidden cables within this composition are currently displayed. More...
 
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. More...
 
map< VuoPort *, string > getPortConstantResourcePathsRelativeToDir (QDir newDir)
 Maps all relative resource paths referenced within this composition's port constants to the corresponding paths appropriate for use after the composition has been relocated to newDir. More...
 
string getAppIconResourcePathRelativeToDir (QDir newDir)
 Maps the relative path of the composition's app icon to the corresponding paths appropriate for use after the composition has been relocated to newDir. More...
 
void bundleResourceFiles (string targetResourceDir, bool tmpFilesOnly=false, QString bundledIconPath="")
 Copies resources referenced within the composition by relative URL into the provided targetResourceDir. More...
 
void modifyAllResourcePathsForBundle (void)
 Maps all relative resource paths referenced within this composition's port constants to the corresponding paths appropriate for use within the "Resources" directory of an exported bundle. More...
 
- Public Member Functions inherited from VuoBaseDetail< VuoComposition >
 VuoBaseDetail (string description, VuoComposition *base)
 Creates a detail class. More...
 
VuoCompositiongetBase (void) const
 Returns the detail class instance's base class instance. More...
 
void setBase (VuoComposition *base)
 Sets the detail class instance's base class instance. More...
 
- Public Member Functions inherited from VuoRunnerDelegate
virtual void receivedTelemetryStats (unsigned long utime, unsigned long stime)=0
 This delegate method is invoked twice per second, to provide a heartbeat indicating that the composition is still alive. More...
 
virtual void receivedTelemetryPublishedOutputPortUpdated (VuoRunner::Port *port, bool sentData, string dataSummary)=0
 This delegate method is invoked every time any published output port in the top-level composition transmits an event. More...
 
virtual void receivedTelemetryError (string message)=0
 This delegate method is invoked every time an uncaught error occurs in the composition. More...
 

Static Public Member Functions

static VuoNodegetUnderlyingParentNodeForPort (VuoPort *runningPort, VuoEditorComposition *composition)
 Returns the underlying parent node of the provided port within the provided composition. More...
 
static string getDefaultNameForPath (const string &compositionPath)
 Returns the name to be used for a composition located at compositionPath if the user hasn't specified a name. More...
 
static QString formatCompositionFileNameForDisplay (QString unformattedCompositionFileName)
 Formats the input unformattedCompositionFileName for human-readable display by stripping the .vuo extension, capitalizing the first word, and inserting spaces between CamelCase transitions. More...
 
static QString formatNodeSetNameForDisplay (QString nodeSetName)
 Formats the input nodeSetName for human-readable display. More...
 
- Static Public Member Functions inherited from VuoRendererComposition
static bool isTmpFile (string filePath)
 Returns a boolean indicating whether the provided filePath is within the /tmp directory (or a subdirectory thereof). More...
 
static void setGridOpacity (int opacity)
 Specifies the opacity at which grid lines/points should be rendered on the canvas. More...
 
static int getGridOpacity ()
 Returns the opacity at which grid lines should be rendered on the canvas. More...
 
static void setGridType (GridType type)
 Specifies the type of grid to render. More...
 
static QPoint quantizeToNearestGridLine (QPointF point, int gridSpacing)
 Quantizes the provided point to the nearest horizontal and vertical gridlines with the gridSpacing specified. More...
 
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. More...
 

Static Public Attributes

static const qreal componentCollisionRange = 10
 The search range used in locating composition components near the cursor. More...
 
- Static Public Attributes inherited from VuoRendererComposition
static const int majorGridLineSpacing = 4 * VuoRendererComposition::minorGridLineSpacing
 Distance, in pixels at 1:1 zoom, between major gridlines. More...
 
static const int minorGridLineSpacing = 15
 Distance, in pixels at 1:1 zoom, between minor gridlines. More...
 
static const string deprecatedDefaultDescription = "This composition does..."
 The default description assigned to compositions prior to Vuo 2.0. More...
 

Protected Member Functions

void dragEnterEvent (QGraphicsSceneDragDropEvent *event)
 Decide whether we can accept the dragged data. More...
 
void dragLeaveEvent (QGraphicsSceneDragDropEvent *event)
 Decide what to do with the dragged data as it leaves. More...
 
void dragMoveEvent (QGraphicsSceneDragDropEvent *event)
 Decide what to do with the moved drag-drop data. More...
 
void dropEvent (QGraphicsSceneDragDropEvent *event)
 Handle the dropped data. More...
 
void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event)
 Handle mouse double-click events. More...
 
void mousePressEvent (QGraphicsSceneMouseEvent *event)
 Handle mouse press events. More...
 
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event)
 Handle mouse release events. More...
 
void mouseMoveEvent (QGraphicsSceneMouseEvent *event)
 Handle mouse move events. More...
 
void keyPressEvent (QKeyEvent *event)
 Handle keypress events. More...
 
void keyReleaseEvent (QKeyEvent *event)
 Handle key release events. More...
 
void contextMenuEvent (QGraphicsSceneContextMenuEvent *event)
 Display the context menu for the canvas or for a node, port, cable, or comment. More...
 
- Protected Member Functions inherited from VuoRendererComposition
void drawBackground (QPainter *painter, const QRectF &rect)
 Draws the background of the scene using painter, before any items and the foreground are drawn. More...
 
void setRenderActivity (bool render, bool includePortActivity=true)
 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. More...
 
void setComponentCaching (QGraphicsItem::CacheMode)
 Sets the caching mode for each applicable graphics item within the composition to the provided cache mode. More...
 
void updateGeometryForAllComponents ()
 Prepares every component in the composition to be repainted. More...
 
bool isPortPublished (VuoRendererPort *port)
 Returns true if the internal port is connected to a published port. More...
 

Friends

class TestVuoEditor
 

Additional Inherited Members

- Static Protected Member Functions inherited from VuoRendererComposition
static bool isSupportedAudioFile (string path)
 Returns a boolean indicating whether the file at the provided path is a supported audio file. More...
 
static bool isSupportedImageFile (string path)
 Returns a boolean indicating whether the file at the provided path is a supported image file. More...
 
static bool isSupportedMeshFile (string path)
 Returns a boolean indicating whether the file at the provided path is a supported mesh file. More...
 
static bool isSupportedMovieFile (string path)
 Returns a boolean indicating whether the file at the provided path is a supported movie file. More...
 
static bool isSupportedSceneFile (string path)
 Returns a boolean indicating whether the file at the provided path is a supported scene file. More...
 
static bool isSupportedFeedFile (string path)
 Returns a boolean indicating whether the file at the provided path is a supported feed file. More...
 
static bool isSupportedJsonFile (string path)
 Returns a boolean indicating whether the file at the provided path is a supported JSON file. More...
 
static bool isSupportedXmlFile (string path)
 Returns a boolean indicating whether the file at the provided path is a supported XML file. More...
 
static bool isSupportedTableFile (string path)
 Returns a boolean indicating whether the file at the provided path is a supported table file. More...
 
static bool isSupportedDataFile (string path)
 Returns a boolean indicating whether the file at the provided path is a supported data file. More...
 
static bool isSupportedAppFile (string path)
 Returns a boolean indicating whether the file at the provided path is a supported app file. More...
 
static bool isDirectory (string path)
 Returns a boolean indicating whether the provided path refers to a directory (excluding OS X app bundles). More...
 
- Protected Attributes inherited from VuoRendererComposition
VuoCompilerGraphvizParserparser
 The Graphviz parser instance used by this composition. More...
 
VuoRendererSignalersignaler
 The Qt signaler used by this composition. More...
 
VuoNodepublishedInputNode
 The published input node associated with this composition. More...
 
VuoNodepublishedOutputNode
 The published output node associated with this composition. More...
 
bool cachingEnabled
 Should item renderings be cached? More...
 
bool renderHiddenCables
 Should cables be rendered even if they have been hidden (made "wireless")? More...
 

Member Enumeration Documentation

◆ targetComponentType

Specifies the desired type of composition component to be returned from a search.

Definition at line 42 of file VuoEditorComposition.hh.

Constructor & Destructor Documentation

◆ VuoEditorComposition()

VuoEditorComposition::VuoEditorComposition ( VuoComposition baseComposition)
explicit

Creates an empty canvas upon which nodes and cables can be rendered.

Definition at line 70 of file VuoEditorComposition.cc.

Member Function Documentation

◆ activeProtocolChanged

void VuoEditorComposition::activeProtocolChanged ( )
signal

Emitted when the active protocol has changed.

◆ addActiveProtocol()

void VuoEditorComposition::addActiveProtocol ( VuoProtocol protocol,
bool  useUndoStack 
)

Adds an active protocol for this composition, removing any previous active protocol.

Updates the isProtocolPort attribute for each published port affected by the change in protocol.

If useUndoStack is true, pushes published port modifications onto the Undo stack. It is expected (and enforced) that useUndoStack will be true if any published ports are to be removed from the composition. A useUndoStack value of false would be expected during the original creation of a protocol composition, but never in response to user changes.

Definition at line 5276 of file VuoEditorComposition.cc.

◆ addCable()

void VuoEditorComposition::addCable ( VuoCable cable)

Adds a cable to the canvas.

Definition at line 518 of file VuoEditorComposition.cc.

◆ addCompatibleTypesToContextMenu()

bool VuoEditorComposition::addCompatibleTypesToContextMenu ( VuoRendererPort genericPort,
set< string >  compatibleTypesInIsolation,
set< string >  compatibleTypesInContext,
QMenu *  contextMenu,
bool  addSeparatorBeforeSubmenu,
bool  limitToNodeSet,
string  nodeSetName = "" 
)

Populates the contextMenu for the provided genericPort with the set of compatibleTypesInContext to which the port may be specialized within its current generic port network (or compatibleTypesInIsolation when the port is in isolation), organizing the compatible types by node set and associating each menu item with the data and slot necessary to accomplish the "Specialize" operation.

If limitToNodeSet is true, populates the menu only with types specific to the provided nodeSetName in a submenu named for that type.

  • If limitToNodeSet is true but the provided nodeSetName is empty, the compatible "Core" types are added to the main menu.
  • If limitToNodeSet is false, all compatible types (regardless of node set) are added to the main menu.

Returns a boolean indicating whether any content was actually added to the menu.

Definition at line 3761 of file VuoEditorComposition.cc.

◆ addNode()

void VuoEditorComposition::addNode ( VuoNode node,
bool  nodeShouldBeRendered = true,
bool  nodeShouldBeGivenUniqueIdentifier = true 
)

Adds a node to the canvas and registers the node and its ports in the composition's ID maps.

Definition at line 402 of file VuoEditorComposition.cc.

◆ addPublishedPort()

void VuoEditorComposition::addPublishedPort ( VuoPublishedPort publishedPort,
bool  isPublishedInput,
bool  shouldUpdateUi = true 
)

Adds an existing VuoPublishedPort as one of this composition's published ports.

Definition at line 5578 of file VuoEditorComposition.cc.

◆ applicationActive

void VuoEditorComposition::applicationActive ( bool  )
signal

Emitted (if this composition is topmost) when the application has been activated or deactivated.

◆ beginDisplayingActivity()

void VuoEditorComposition::beginDisplayingActivity ( bool  includePorts = true)

Begin reflecting events and executions in the rendering of the composition.

Definition at line 7166 of file VuoEditorComposition.cc.

◆ buildFinished

void VuoEditorComposition::buildFinished ( QString  error)
signal

Emitted when finished attempting to compile and link the composition to run within the editor. If the build failed, the argument is an error message.

◆ buildStarted

void VuoEditorComposition::buildStarted ( )
signal

Emitted when starting to compile and link the composition.

◆ cableDragEnded

void VuoEditorComposition::cableDragEnded ( )
signal

Emitted when the user ends a cable drag, whether a connection was completed or not.

◆ cableDragInitiated

void VuoEditorComposition::cableDragInitiated ( )
signal

Emitted when the user begins dragging a cable.

◆ cablesHidden

void VuoEditorComposition::cablesHidden ( set< VuoRendererCable * >  cables)
signal

Emitted when cables are to be hidden.

◆ cablesUnhidden

void VuoEditorComposition::cablesUnhidden ( set< VuoRendererCable * >  cables)
signal

Emitted when cables are to be unhidden.

◆ cancelCableDrag()

void VuoEditorComposition::cancelCableDrag ( void  )

Cancel the current cable drag operation, if applicable.

Definition at line 2585 of file VuoEditorComposition.cc.

◆ changeInHiddenCables

void VuoEditorComposition::changeInHiddenCables ( )
signal

Emitted when a hidden cable has been added to or removed from the composition.

◆ clear()

void VuoEditorComposition::clear ( void  )

Deletes all composition components.

Definition at line 707 of file VuoEditorComposition.cc.

◆ clearHoverHighlighting()

void VuoEditorComposition::clearHoverHighlighting ( )

Clear hover-highlighting of the previously highlighted composition component.

Definition at line 2859 of file VuoEditorComposition.cc.

◆ clearPublishedPortDropLocationHighlightingRequested

void VuoEditorComposition::clearPublishedPortDropLocationHighlightingRequested ( )
signal

Emitted when eligible published port sidebar drop locations should no longer be highlighted.

◆ commentEditorRequested

void VuoEditorComposition::commentEditorRequested ( VuoRendererComment comment)
signal

Emitted in order to display a comment editor.

◆ commentInsertionRequested

void VuoEditorComposition::commentInsertionRequested ( QPointF  scenePos)
signal

Emitted in order to insert a new comment at the provided scene position.

◆ commentResized

void VuoEditorComposition::commentResized ( VuoRendererComment comment,
qreal  dx,
qreal  dy 
)
signal

Emitted when a comment is resized.

◆ commentZoomRequested

void VuoEditorComposition::commentZoomRequested ( VuoRendererComment comment)
signal

Emitted in order to zoom in on a comment.

◆ componentsAdded

void VuoEditorComposition::componentsAdded ( QList< QGraphicsItem * >  addedComponents,
VuoEditorComposition target 
)
signal

Emitted in order to add components.

◆ componentsRemoved

void VuoEditorComposition::componentsRemoved ( QList< QGraphicsItem * >  removedComponents,
string  commandDescription = "Remove" 
)
signal

Emitted in order to remove components.

◆ compositionOnTop

void VuoEditorComposition::compositionOnTop ( bool  )
signal

Emitted when the composition detects that it is or is no longer the topmost composition.

◆ compositionStoppedItself

void VuoEditorComposition::compositionStoppedItself ( )
signal

Emitted when the user quits the composition or the composition crashes.

◆ connectionCompletedByDragging

void VuoEditorComposition::connectionCompletedByDragging ( VuoRendererCable cableInProgress,
VuoRendererPort targetPort,
pair< VuoRendererCable *, VuoRendererCable * >  cableArgs,
VuoRendererNode typecastNodeToDelete,
pair< string, string >  typeArgs,
pair< VuoRendererPort *, VuoRendererPort * >  portArgs 
)
signal

Emitted after a cable has been connected to a node.

◆ contextMenuEvent()

void VuoEditorComposition::contextMenuEvent ( QGraphicsSceneContextMenuEvent *  event)
protected

Display the context menu for the canvas or for a node, port, cable, or comment.

Definition at line 3045 of file VuoEditorComposition.cc.

◆ createAndConnectDictionaryAttachmentsForNode()

void VuoEditorComposition::createAndConnectDictionaryAttachmentsForNode ( VuoNode node,
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.

Parameters
nodeThe node that needs the dictionary attachments created.
[out]createdNodesThe created nodes.
[out]createdCablesThe created cables.

Definition at line 548 of file VuoEditorComposition.cc.

◆ createAndConnectInputAttachments()

QList< QGraphicsItem * > VuoEditorComposition::createAndConnectInputAttachments ( VuoRendererNode node,
bool  createButDoNotAdd = false,
bool  checkForPreexisting = true 
)

Creates and connects the appropriate input attachments to the provided node.

Parameters
nodeThe node that needs the input attachments created.
createButDoNotAddA boolean specifying whether to create the attachments without adding them to the composition.
checkForPreexistingA boolean specifying whether to check for pre-existing attachments before proceeding to create new ones.

Definition at line 563 of file VuoEditorComposition.cc.

◆ createAndConnectMakeListNode()

VuoRendererNode * VuoEditorComposition::createAndConnectMakeListNode ( VuoNode toNode,
VuoPort toPort,
VuoRendererCable *&  rendererCable 
)

Creates a "Make List" node, and creates a cable from the "Make List" node to the given input port.

Parameters
toNodeThe node that contains toPort.
toPortThe input port. Assumed to be a data-and-event input port carrying list data.
[out]rendererCableThe created cable.
Returns
The created "Make List" node.

Definition at line 535 of file VuoEditorComposition.cc.

◆ createBaseNode()

VuoNode * VuoEditorComposition::createBaseNode ( VuoCompilerNodeClass nodeClass,
VuoNode modelNode,
string  title = "",
double  x = 0,
double  y = 0 
)

Creates an instance of nodeClass if it is legal to add to this composition.

Otherwise, creates an instance of a node class with the same name but no implementation.

Copies attributes from modelNode if provided, otherwise title, x, and y.

Definition at line 326 of file VuoEditorComposition.cc.

◆ createNode()

VuoRendererNode * VuoEditorComposition::createNode ( QString  nodeClassName,
string  title = "",
double  x = 0,
double  y = 0 
)

Instantiates a node of class name nodeClassName.

Definition at line 304 of file VuoEditorComposition.cc.

◆ createNodeWithMissingImplementation()

VuoNode * VuoEditorComposition::createNodeWithMissingImplementation ( VuoNodeClass modelNodeClass,
VuoNode modelNode,
string  title = "",
double  x = 0,
double  y = 0 
)

Creates an instance of an implementation-less node class.

For the node class, copies attributes from modelNodeClass. For the node, copies attributes from modelNode if provided, otherwise title, x, and y.

Definition at line 365 of file VuoEditorComposition.cc.

◆ createPublishedCable()

VuoCable * VuoEditorComposition::createPublishedCable ( VuoPort externalPort,
VuoPort internalPort,
bool  forceEventOnlyPublication 
)

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

Definition at line 5221 of file VuoEditorComposition.cc.

◆ createReplacementsToUnspecializePort()

void VuoEditorComposition::createReplacementsToUnspecializePort ( VuoPort portToUnspecialize,
map< VuoNode *, string > &  nodesToReplace,
set< VuoCable * > &  cablesToDelete 
)

Outputs the composition components that would need to be modified in order to unspecialize the given port.

Parameters
portToUnspecializeThe port to unspecialize.
nodesToReplaceThe nodes that would need to be replaced, and the names of the less-specialized node classes that would replace them.
cablesToDeleteThe cables (including published) that would need to be removed because they would become invalid, having a generic port on one end and a non-generic port on the other end.

Definition at line 1017 of file VuoEditorComposition.cc.

◆ deleteSelectedCompositionComponents [1/2]

void VuoEditorComposition::deleteSelectedCompositionComponents ( )
slot

Deletes currently selected nodes and cables.

Definition at line 667 of file VuoEditorComposition.cc.

◆ deleteSelectedCompositionComponents [2/2]

void VuoEditorComposition::deleteSelectedCompositionComponents ( string  commandDescription)
slot

Deletes currently selected nodes and cables.

Definition at line 675 of file VuoEditorComposition.cc.

◆ deleteSelectedNodes()

void VuoEditorComposition::deleteSelectedNodes ( string  commandDescription = "")

Deletes currently selected nodes.

Definition at line 692 of file VuoEditorComposition.cc.

◆ deselectAllCompositionComponents

void VuoEditorComposition::deselectAllCompositionComponents ( )
slot

Deselects all nodes, cables, and comments on the canvas.

Definition at line 1362 of file VuoEditorComposition.cc.

◆ disableErrorPopovers()

void VuoEditorComposition::disableErrorPopovers ( )

Disables all error popovers associated with this composition.

Definition at line 6556 of file VuoEditorComposition.cc.

◆ disableNondetachedPortPopovers()

void VuoEditorComposition::disableNondetachedPortPopovers ( VuoRendererNode node = NULL,
bool  recordWhichPopoversClosed = false 
)

Disables non-detached port popovers associated with this composition.

If an input node is provided, only non-detached popovers whose ports belong to that node are disabled.

Definition at line 6606 of file VuoEditorComposition.cc.

◆ disablePopoverForPort

void VuoEditorComposition::disablePopoverForPort ( string  portID)
slot

Closes the popover for the port with the provided portID.

The caller should be on the main thread and schedule this function synchronously on activePortPopoversQueue.

This function may only be called on dispatch queue activePortPopoversQueue.

Definition at line 6497 of file VuoEditorComposition.cc.

◆ disablePopovers()

void VuoEditorComposition::disablePopovers ( )

Disables all popovers associated with this composition, whether they are detached or not.

Definition at line 6547 of file VuoEditorComposition.cc.

◆ disableStrandedPortPopovers()

void VuoEditorComposition::disableStrandedPortPopovers ( )

Disables any port popover that does not currently have an associated port in the composition.

Definition at line 6588 of file VuoEditorComposition.cc.

◆ dragEnterEvent()

void VuoEditorComposition::dragEnterEvent ( QGraphicsSceneDragDropEvent *  event)
protected

Decide whether we can accept the dragged data.

Definition at line 1488 of file VuoEditorComposition.cc.

◆ dragLeaveEvent()

void VuoEditorComposition::dragLeaveEvent ( QGraphicsSceneDragDropEvent *  event)
protected

Decide what to do with the dragged data as it leaves.

Definition at line 1555 of file VuoEditorComposition.cc.

◆ dragMoveEvent()

void VuoEditorComposition::dragMoveEvent ( QGraphicsSceneDragDropEvent *  event)
protected

Decide what to do with the moved drag-drop data.

Definition at line 1563 of file VuoEditorComposition.cc.

◆ dropEvent()

void VuoEditorComposition::dropEvent ( QGraphicsSceneDragDropEvent *  event)
protected

Handle the dropped data.

Definition at line 1571 of file VuoEditorComposition.cc.

◆ duplicationOperationCancelled

void VuoEditorComposition::duplicationOperationCancelled ( )
signal

Emitted in order to cancel duplication of components.

◆ emitCompositionOnTop()

void VuoEditorComposition::emitCompositionOnTop ( bool  top)

Emits a compositionOnTop signal.

Definition at line 7447 of file VuoEditorComposition.cc.

◆ emitPublishedPortNameEditorRequested()

void VuoEditorComposition::emitPublishedPortNameEditorRequested ( VuoRendererPublishedPort port)

Emits a publishedPortNameEditorRequested signal.

Definition at line 7455 of file VuoEditorComposition.cc.

◆ emitSubcompositionEditRequested

void VuoEditorComposition::emitSubcompositionEditRequested ( )
slot

Workaround so that the "Edit Subcomposition" context menu item can emit a signal with argument when triggered.

Definition at line 3644 of file VuoEditorComposition.cc.

◆ emptyCanvasLocationLeftClicked

void VuoEditorComposition::emptyCanvasLocationLeftClicked ( )
signal

Emitted when the left mouse button is released on an empty region of the canvas.

◆ enablePopoverForPort()

void VuoEditorComposition::enablePopoverForPort ( VuoRendererPort rp)

Displays a new popover for the provided port.

Definition at line 6427 of file VuoEditorComposition.cc.

◆ findAvailableTypecastsToBridge() [1/2]

vector< string > VuoEditorComposition::findAvailableTypecastsToBridge ( VuoRendererPort fromPort,
VuoRendererPublishedPort toPublishedPort 
)

Returns a list containing the names of all loaded typecast classes capable of bridging the connection from the internal fromPort to the published toPort.

Definition at line 6221 of file VuoEditorComposition.cc.

◆ findAvailableTypecastsToBridge() [2/2]

vector< string > VuoEditorComposition::findAvailableTypecastsToBridge ( VuoRendererPublishedPort fromPublishedPort,
VuoRendererPort toPort 
)

Returns a list containing the names of all loaded typecast classes capable of bridging the connection from the published fromPort to the internal toPort.

Definition at line 6236 of file VuoEditorComposition.cc.

◆ findDefaultPortForEventOnlyConnection()

VuoRendererPort * VuoEditorComposition::findDefaultPortForEventOnlyConnection ( VuoRendererNode node,
bool  inputPort 
)

Returns the port to which an event-only cable should be connected by default.

If input is true, selects from the node's input ports; otherwise, selects from its output ports.

Definition at line 4074 of file VuoEditorComposition.cc.

◆ findNearbyComponent()

QGraphicsItem * VuoEditorComposition::findNearbyComponent ( QPointF  scenePos,
targetComponentType  targetType = VuoEditorComposition::targetTypeAny,
bool  limitPortCollisionRange = true 
)

Returns a pointer to the component (port, cable, node, or comment) that should be operated upon if the user were to click at position scenePos, or NULL if no component is within collision range.

The input targetType specifies what type of component to search for. Options are: VuoEditorComposition::targetTypePort (to include only ports), VuoEditorComposition::targetTypeNodeHeader (to include only node headers), or VuoEditorComposition::targetTypeAny (to include ports, cables, nodes, and comments) If limitPortCollisionRange is true, only the port circle and constant value flag, not the port's boundingRect as a whole, are taken into account for purposes of collision detection.

Definition at line 3895 of file VuoEditorComposition.cc.

◆ findNearbyNodeHeader()

VuoRendererNode * VuoEditorComposition::findNearbyNodeHeader ( QPointF  scenePos)

Returns the node whose header area scenePos falls within, or NULL if none.

Definition at line 3877 of file VuoEditorComposition.cc.

◆ findNearbyPort()

QGraphicsItem * VuoEditorComposition::findNearbyPort ( QPointF  scenePos,
bool  limitPortCollisionRange = true 
)

Returns a pointer to the port that should be operated upon if the user were to click at position scenePos, or NULL if no port is within collision range.

If limitPortCollisionRange is true, only the port circle and constant value flag, not the port's boundingRect as a whole, are taken into account for purposes of collision detection.

Definition at line 3869 of file VuoEditorComposition.cc.

◆ findTargetPortForCableDroppedOnNodeHeader()

VuoRendererPort * VuoEditorComposition::findTargetPortForCableDroppedOnNodeHeader ( VuoRendererNode node)

Returns the port to which an event-only cable would be connected if the endpoint of cableInProgress were dropped onto the header of node.

This is generally the node's first input or output port (depending on the direction of cableInProgress), but there's special handling for walled input ports and input ports with attached drawers or type-converters.

If the node has no input/output port or cableInProgress is NULL, this function returns NULL.

Definition at line 4055 of file VuoEditorComposition.cc.

◆ formatCompositionFileNameForDisplay()

QString VuoEditorComposition::formatCompositionFileNameForDisplay ( QString  unformattedCompositionFileName)
static

Formats the input unformattedCompositionFileName for human-readable display by stripping the .vuo extension, capitalizing the first word, and inserting spaces between CamelCase transitions.

Returns
The human-readable composition file name.

Definition at line 7293 of file VuoEditorComposition.cc.

◆ formatNodeSetNameForDisplay()

QString VuoEditorComposition::formatNodeSetNameForDisplay ( QString  nodeSetName)
static

Formats the input nodeSetName for human-readable display.

Returns
The human-readable node set name.

Definition at line 7321 of file VuoEditorComposition.cc.

◆ generateCompositionHeader()

string VuoEditorComposition::generateCompositionHeader ( )

Generates a header containing this composition's metadata.

Definition at line 7255 of file VuoEditorComposition.cc.

◆ generateSpecialPublishedNameForPort()

string VuoEditorComposition::generateSpecialPublishedNameForPort ( VuoPort port)

If the provided port is one of the handful of port types whose default published name should be something other than the port's own name, returns that specialized name.

Otherwise, returns the empty string.

Definition at line 7526 of file VuoEditorComposition.cc.

◆ getActivePopoverForPort()

VuoPortPopover * VuoEditorComposition::getActivePopoverForPort ( string  portID)

Returns a pointer to the active popover for the port with the provided portID, if such a popover exists.

Otherwise returns NULL.

This function may only be called on dispatch queue activePortPopoversQueue.

Definition at line 6399 of file VuoEditorComposition.cc.

◆ getActiveProtocol()

VuoProtocol * VuoEditorComposition::getActiveProtocol ( )

Returns the active protocol for this composition.

Definition at line 5558 of file VuoEditorComposition.cc.

◆ getAllSpecializedTypeOptions()

vector< string > VuoEditorComposition::getAllSpecializedTypeOptions ( bool  lists)

Returns the full list of type names that should be listed as specialization options for a completely generic port.

If lists is true, returns the list versions of those types; otherwise, returns the individual-element versions of the types.

Definition at line 3656 of file VuoEditorComposition.cc.

◆ getCableInProgress()

VuoCable * VuoEditorComposition::getCableInProgress ( )

Returns the cable currently being dragged, or NULL if no cable is currently being dragged.

Definition at line 1306 of file VuoEditorComposition.cc.

◆ getCableInProgressWasNew()

bool VuoEditorComposition::getCableInProgressWasNew ( )

Returns a boolean indicating whether the cable currently being dragged was only just created at the initiation of the drag.

Definition at line 1315 of file VuoEditorComposition.cc.

◆ getCablesInternalToSubcomposition()

set< VuoRendererCable * > VuoEditorComposition::getCablesInternalToSubcomposition ( QList< QGraphicsItem * >  subcompositionComponents)

Returns the set of cables creating internal connections within the set of input subcompositionComponents.

Definition at line 1278 of file VuoEditorComposition.cc.

◆ getContextMenuDeleteSelectedAction()

QAction * VuoEditorComposition::getContextMenuDeleteSelectedAction ( void  )

Returns the context menu's action that deletes a component.

Definition at line 4838 of file VuoEditorComposition.cc.

◆ getContextMenuTints()

QMenu * VuoEditorComposition::getContextMenuTints ( QMenu *  parent = 0)

Returns a "Tint" submenu for the provided parent menu.

Definition at line 4846 of file VuoEditorComposition.cc.

◆ getDefaultNameForPath()

string VuoEditorComposition::getDefaultNameForPath ( const string &  compositionPath)
static

Returns the name to be used for a composition located at compositionPath if the user hasn't specified a name.

Definition at line 7263 of file VuoEditorComposition.cc.

◆ getDriverForActiveProtocol()

VuoCompilerDriver * VuoEditorComposition::getDriverForActiveProtocol ( )

Returns the driver for the currently active protocol, or NULL if there is no active protocol or there is no driver available for the active protocol.

Definition at line 5567 of file VuoEditorComposition.cc.

◆ getFormattedName()

QString VuoEditorComposition::getFormattedName ( )

Returns the formatted name of the composition, either pre-formatted by the user or, otherwise, formatted automatically.

Returns
The human-readable composition file name.

Definition at line 7276 of file VuoEditorComposition.cc.

◆ getIdentifierForStaticPort()

string VuoEditorComposition::getIdentifierForStaticPort ( VuoPort staticPort,
VuoNode parentNode = NULL 
)

Returns the identifier of the provided staticPort in the stored composition.

If a parentNode is provided, uses that node identifier to help derive the port identifier. Otherwise, attempts to determine the parent node via renderer items.

Definition at line 6318 of file VuoEditorComposition.cc.

◆ getInputEditorManager()

VuoInputEditorManager * VuoEditorComposition::getInputEditorManager ( )

Returns the input editor manager instance used by this composition (for, e.g., determining whether the port nearest a right-click has an available input editor and should therefore have a "Set Value" item in its context menu).

Definition at line 296 of file VuoEditorComposition.cc.

◆ getMenuSelectionInProgress()

bool VuoEditorComposition::getMenuSelectionInProgress ( )

Returns a boolean indicating whether selection from a context menu is currently in progress.

Definition at line 1323 of file VuoEditorComposition.cc.

◆ getModuleManager()

VuoModuleManager * VuoEditorComposition::getModuleManager ( void  )

Returns the module manager used by this composition and its containing VuoEditorWindow.

Definition at line 276 of file VuoEditorComposition.cc.

◆ getPortValueInRunningComposition()

json_object * VuoEditorComposition::getPortValueInRunningComposition ( VuoPort port)

If the composition is running (or it's a subcomposition and the top-level composition is running), returns the current data value associated with the port.

Otherwise returns NULL.

Definition at line 6279 of file VuoEditorComposition.cc.

◆ getPortWithStaticIdentifier()

VuoPort * VuoEditorComposition::getPortWithStaticIdentifier ( string  portID)

Returns the port registered to the composition under the provided portID.

Definition at line 6353 of file VuoEditorComposition.cc.

◆ getSelectedCables()

set< VuoRendererCable * > VuoEditorComposition::getSelectedCables ( bool  includePublishedCables)

Returns the set of currently selected cables.

Definition at line 1470 of file VuoEditorComposition.cc.

◆ getSelectedComments()

set< VuoRendererComment * > VuoEditorComposition::getSelectedComments ( )

Returns the set of currently selected comments.

Definition at line 1452 of file VuoEditorComposition.cc.

◆ getSelectedNodes()

set< VuoRendererNode * > VuoEditorComposition::getSelectedNodes ( )

Returns the set of currently selected nodes.

Definition at line 1434 of file VuoEditorComposition.cc.

◆ getShowEventsMode()

bool VuoEditorComposition::getShowEventsMode ( )

Returns a boolean indicating whether this composition is currently in 'Show Events' mode.

Definition at line 6896 of file VuoEditorComposition.cc.

◆ getTriggerPortToRefire()

VuoPort * VuoEditorComposition::getTriggerPortToRefire ( )

Returns the trigger port to be fired when the user selects the "re-fire" option.

Definition at line 923 of file VuoEditorComposition.cc.

◆ getUnderlyingParentNodeForPort()

VuoNode * VuoEditorComposition::getUnderlyingParentNodeForPort ( VuoPort port,
VuoEditorComposition composition 
)
static

Returns the underlying parent node of the provided port within the provided composition.

The provided port and composition need not have allocations or renderers.

Definition at line 6363 of file VuoEditorComposition.cc.

◆ hasHiddenInternalCables()

bool VuoEditorComposition::hasHiddenInternalCables ( )

Returns a boolean indicating whether the composition contains any hidden (wireless) internal cables.

Definition at line 6939 of file VuoEditorComposition.cc.

◆ hasHiddenPublishedCables()

bool VuoEditorComposition::hasHiddenPublishedCables ( )

Returns a boolean indicating whether the composition contains any hidden (wireless) published cables.

Definition at line 6953 of file VuoEditorComposition.cc.

◆ highlightPublishedPortDropLocationsRequested

void VuoEditorComposition::highlightPublishedPortDropLocationsRequested ( VuoRendererPort port,
VuoRendererCable cable 
)
signal

Emitted when eligible published port sidebar drop locations for port should be visually highlighted.

◆ inputEditorRequested

void VuoEditorComposition::inputEditorRequested ( VuoRendererPort port)
signal

Emitted in order to display an input editor.

◆ inputPortCountAdjustmentRequested

void VuoEditorComposition::inputPortCountAdjustmentRequested ( VuoRendererNode node,
int  inputPortCountDelta,
bool  requestedByDragging 
)
signal

Emitted when a node is to have its port count adjusted.

◆ internalItemsBoundingRect()

QRectF VuoEditorComposition::internalItemsBoundingRect ( ) const

Calculates and returns the bounding rect of all internal composition components on the scene.

This excludes published cables.

Definition at line 4138 of file VuoEditorComposition.cc.

◆ internalSelectedItemsBoundingRect()

QRectF VuoEditorComposition::internalSelectedItemsBoundingRect ( ) const

Calculates and returns the bounding rect of all currenty selected composition nodes and cables.

This excludes constant flags and published cables.

Definition at line 4155 of file VuoEditorComposition.cc.

◆ internalSelectedItemsChildrenBoundingRect()

QRectF VuoEditorComposition::internalSelectedItemsChildrenBoundingRect ( ) const

Calculates and returns the bounding rect of all currenty selected composition nodes, ports, and cables.

This includes port constant flags and attached typecasts and drawers; it excludes published cables.

Definition at line 4173 of file VuoEditorComposition.cc.

◆ isRunning()

bool VuoEditorComposition::isRunning ( void  )

Returns true if the composition is running.

This function may be called on any dispatch queue except runCompositionQueue.

Definition at line 4518 of file VuoEditorComposition.cc.

◆ itemsMoved

void VuoEditorComposition::itemsMoved ( set< VuoRendererNode * >  nodes,
set< VuoRendererComment * >  comments,
qreal  dx,
qreal  dy,
bool  movedByDragging 
)
signal

Emitted in order to move nodes and comments.

◆ keyPressEvent()

void VuoEditorComposition::keyPressEvent ( QKeyEvent *  event)
protected

Handle keypress events.

Definition at line 2895 of file VuoEditorComposition.cc.

◆ keyReleaseEvent()

void VuoEditorComposition::keyReleaseEvent ( QKeyEvent *  event)
protected

Handle key release events.

Definition at line 3004 of file VuoEditorComposition.cc.

◆ leftMouseButtonReleased

void VuoEditorComposition::leftMouseButtonReleased ( void  )
signal

Emitted when the left mouse button is released.

◆ leftMousePressEventAtNearbyItem()

void VuoEditorComposition::leftMousePressEventAtNearbyItem ( QGraphicsItem *  nearbyItem,
QGraphicsSceneMouseEvent *  event 
)

Handle a left mouse press event already determined to be within operable range of the provided nearbyItem.

Definition at line 1825 of file VuoEditorComposition.cc.

◆ lostContactWithComposition()

void VuoEditorComposition::lostContactWithComposition ( void  )
virtual

Called if the user quits the composition or the composition crashes.

Updates the UI to show that the composition has stopped.

Implementation of the virtual VuoRunnerDelegate function.

Reimplemented from VuoRunnerDelegateAdapter.

Definition at line 6878 of file VuoEditorComposition.cc.

◆ modifyComponents()

void VuoEditorComposition::modifyComponents ( void(^)(void)  modify)

Wraps the call to modify in code that saves and restores the state of the composition, such as selected components.

Definition at line 580 of file VuoEditorComposition.cc.

◆ mouseDoubleClickEvent()

void VuoEditorComposition::mouseDoubleClickEvent ( QGraphicsSceneMouseEvent *  event)
protected

Handle mouse double-click events.

Definition at line 1772 of file VuoEditorComposition.cc.

◆ mouseMoveEvent()

void VuoEditorComposition::mouseMoveEvent ( QGraphicsSceneMouseEvent *  event)
protected

Handle mouse move events.

Definition at line 2634 of file VuoEditorComposition.cc.

◆ mousePressEvent()

void VuoEditorComposition::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
protected

Handle mouse press events.

Definition at line 1788 of file VuoEditorComposition.cc.

◆ mouseReleaseEvent()

void VuoEditorComposition::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event)
protected

Handle mouse release events.

Definition at line 2121 of file VuoEditorComposition.cc.

◆ movePopoversBy()

void VuoEditorComposition::movePopoversBy ( int  dx,
int  dy 
)

Moves all popovers associated with this composition dx points horizontally and dy points vertically.

Definition at line 6633 of file VuoEditorComposition.cc.

◆ moveSelectedItemsBy

void VuoEditorComposition::moveSelectedItemsBy ( qreal  dx,
qreal  dy 
)
slot

Moves currently selected nodes and comments dx points horizontally and dy points vertically.

Definition at line 1387 of file VuoEditorComposition.cc.

◆ nodePopoverRequestedForClass

void VuoEditorComposition::nodePopoverRequestedForClass ( VuoNodeClass nodeClass)
signal

Emitted when a node popover is to be displayed.

◆ nodeSwapRequested

void VuoEditorComposition::nodeSwapRequested ( VuoRendererNode node,
string  newNodeClassName 
)
signal

Emitted when a node is to be replaced with a new node of a similar class.

◆ nodeTitleEditorRequested

void VuoEditorComposition::nodeTitleEditorRequested ( VuoRendererNode node)
signal

Emitted in order to display a node title editor.

◆ popoverDetached

void VuoEditorComposition::popoverDetached ( )
signal

Emitted when one of this composition's popovers has just been detached.

◆ populateChangeNodeMenu()

void VuoEditorComposition::populateChangeNodeMenu ( QMenu *  menu,
VuoRendererNode node,
int  matchLimit = 0 
)

Populates the "Change To" menu for the provided node with the requested number of matches if available, or however many non-zero-scoring matches are available if fewer.

If a matchLimit less than 1 is specified, returns all available matches.

Definition at line 4895 of file VuoEditorComposition.cc.

◆ populateNodeAndPortIdentifierMappings()

void VuoEditorComposition::populateNodeAndPortIdentifierMappings ( )

Populates the mappings between nodes and ports in this composition and their stored and running identifiers.

Definition at line 7116 of file VuoEditorComposition.cc.

◆ portConstantChangeRequested

void VuoEditorComposition::portConstantChangeRequested ( VuoRendererPort port,
string  value 
)
signal

Emitted in order to change the value of a port constant.

◆ portPublicationRequested [1/2]

void VuoEditorComposition::portPublicationRequested ( VuoPort port,
bool  forceEventOnlyPublication 
)
signal

Emitted when a port is to be published.

◆ portPublicationRequested [2/2]

void VuoEditorComposition::portPublicationRequested ( VuoPort internalPort,
VuoPublishedPort externalPort,
bool  forceEventOnlyPublication,
VuoPort portToSpecialize,
string  specializedTypeName,
string  typecastToInsert,
bool  useUndoStackMacro 
)
signal

Emitted when an internal port is to be published in association with a specific external published port.

◆ portUnpublicationRequested

void VuoEditorComposition::portUnpublicationRequested ( VuoPort port)
signal

Emitted when a port is to be unpublished.

◆ protocolPortChangesRequested

void VuoEditorComposition::protocolPortChangesRequested ( map< VuoPublishedPort *, string >  publishedPortsToRename,
set< VuoPublishedPort * >  publishedPortsToRemove,
vector< VuoPublishedPort * >  publishedPortsToAdd,
bool  beginUndoStackMacro,
bool  endUndoStackMacro 
)
signal

Emitted when published ports need to be modified for compatibility with a newly activated protocol.

◆ publishedPortModified

void VuoEditorComposition::publishedPortModified ( )
signal

Emitted when the composition has had published ports added, removed, or re-named.

◆ publishedPortNameEditorRequested

void VuoEditorComposition::publishedPortNameEditorRequested ( VuoRendererPublishedPort port,
bool  useUndoStack 
)
signal

Emitted when a published port name editor should be displayed.

◆ publishInternalPort()

VuoRendererPublishedPort * VuoEditorComposition::publishInternalPort ( VuoPort port,
bool  forceEventOnlyPublication,
string  name = "",
VuoType type = NULL,
bool  attemptMerge = false,
bool *  mergePerformed = NULL 
)

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 shouldAttemptMerge 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, and with the type provided.

Parameters
portThe internal port to be published.
forceEventOnlyPublicationForces an event-only cable to the published port.
nameThe name under which the port is to be published, if possible.
typeThe desired data type of the external published port to be created.
attemptMergeA boolean indicating whether the port should be published in association with a pre-existing (rather than a newly created) external published port of the given name, if possible.
[out]mergePerformedA boolean indicating whether the port was published in association with a pre-existing (rather than a newly created) external published port.

Definition at line 5150 of file VuoEditorComposition.cc.

◆ publishPorts()

map< string, string > VuoEditorComposition::publishPorts ( set< string >  portsToPublish)

Publishes the ports with the provided identifiers in order of their y-coordinates on canvas, from top to bottom.

Returns the mappings between the original port identifiers and their published identifiers.

Definition at line 7490 of file VuoEditorComposition.cc.

◆ receivedTelemetryEventDropped()

void VuoEditorComposition::receivedTelemetryEventDropped ( string  compositionIdentifier,
string  portIdentifier 
)
virtual

This delegate method is invoked every time any trigger port drops an event.

Implementation of the virtual VuoRunnerDelegate function.

Implements VuoRunnerDelegate.

Definition at line 6800 of file VuoEditorComposition.cc.

◆ receivedTelemetryInputPortUpdated()

void VuoEditorComposition::receivedTelemetryInputPortUpdated ( string  compositionIdentifier,
string  portIdentifier,
bool  receivedEvent,
bool  receivedData,
string  dataSummary 
)
virtual

This delegate method is invoked every time any input port receives an event or data.

Implementation of the virtual VuoRunnerDelegate function.

Implements VuoRunnerDelegate.

Definition at line 6738 of file VuoEditorComposition.cc.

◆ receivedTelemetryNodeExecutionFinished()

void VuoEditorComposition::receivedTelemetryNodeExecutionFinished ( string  compositionIdentifier,
string  nodeIdentifier 
)
virtual

This delegate method is invoked every time a node has finished executing.

Implementation of the virtual VuoRunnerDelegate function.

Implements VuoRunnerDelegate.

Definition at line 6849 of file VuoEditorComposition.cc.

◆ receivedTelemetryNodeExecutionStarted()

void VuoEditorComposition::receivedTelemetryNodeExecutionStarted ( string  compositionIdentifier,
string  nodeIdentifier 
)
virtual

This delegate method is invoked every time a node has started executing.

Implementation of the virtual VuoRunnerDelegate function.

Implements VuoRunnerDelegate.

Definition at line 6822 of file VuoEditorComposition.cc.

◆ receivedTelemetryOutputPortUpdated()

void VuoEditorComposition::receivedTelemetryOutputPortUpdated ( string  compositionIdentifier,
string  portIdentifier,
bool  sentEvent,
bool  sentData,
string  dataSummary 
)
virtual

This delegate method is invoked every time any output port transmits or fires an event.

Implementation of the virtual VuoRunnerDelegate function.

Implements VuoRunnerDelegate.

Definition at line 6764 of file VuoEditorComposition.cc.

◆ refactorRequested

void VuoEditorComposition::refactorRequested ( )
signal

Emitted when the selected nodes should be refactored into a subcomposition.

◆ refirePortChanged

void VuoEditorComposition::refirePortChanged ( )
signal

Emitted when the trigger port to be re-fired changes.

◆ refireTriggerPortEvent()

void VuoEditorComposition::refireTriggerPortEvent ( )

Fires another event from the trigger port that was most recently manually fired.

Definition at line 915 of file VuoEditorComposition.cc.

◆ removeActiveProtocol()

bool VuoEditorComposition::removeActiveProtocol ( VuoProtocol protocol,
VuoProtocol replacementProtocol 
)

Unsets the active protocol for this composition, pushing any necessary changes to published ports onto the Undo stack.

Also makes the necessary changes to the composition's set of published ports to ensure that the composition will no longer be deemed compliant with the removed protocol:

  • Protocol ports with no internally connected ports will be removed.
  • If no protocol ports are eligible to be removed, all protocol ports will instead be renamed.

If the removed protocol is to be replaced with a replacementProtocol, protocol ports common to both protocols are left unmodified. This function does not actually activate the new protocol.

Returns a boolean indicating whether any changes to the composition's published ports were in fact made.

Definition at line 5430 of file VuoEditorComposition.cc.

◆ removeActiveProtocolWithoutModifyingPorts()

void VuoEditorComposition::removeActiveProtocolWithoutModifyingPorts ( VuoProtocol protocol)

Deactivates the provided protocol for this composition, updating the isProtocolPort attribute of each affected port.

Definition at line 5522 of file VuoEditorComposition.cc.

◆ removeCable()

void VuoEditorComposition::removeCable ( VuoRendererCable rc)

Removes a cable from the canvas.

Definition at line 506 of file VuoEditorComposition.cc.

◆ removeNode()

void VuoEditorComposition::removeNode ( VuoRendererNode rn,
bool  resetState = true 
)

Removes a node from the canvas and disables all of its associated port popovers.

If resetState is true, all references to the node in the current editing session (open popovers, trigger port marked for autofiring) are removed.

Definition at line 413 of file VuoEditorComposition.cc.

◆ removePublishedPort()

int VuoEditorComposition::removePublishedPort ( VuoPublishedPort publishedPort,
bool  isPublishedInput,
bool  shouldUpdateUi = true 
)

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.

Definition at line 5596 of file VuoEditorComposition.cc.

◆ renameSelectedNodes

void VuoEditorComposition::renameSelectedNodes ( )
slot

Triggers interactive re-naming of selected non-drawer nodes.

Definition at line 1253 of file VuoEditorComposition.cc.

◆ repaintFeedbackErrorMarks()

void VuoEditorComposition::repaintFeedbackErrorMarks ( )

Updates the renderings of any currently existing feedback error marks.

Definition at line 4445 of file VuoEditorComposition.cc.

◆ replaceNode()

void VuoEditorComposition::replaceNode ( VuoRendererNode oldNode,
VuoNode newNode,
bool  transferConstantsAndCables 
)

Replaces oldNode with newNode in the composition, performing the same cleanup/setup of editor state as VuoEditorComposition::removeNode and VuoEditorComposition::addNode.

If transferConstantsAndCables is true, transfers cable and published port connections from oldNode to newNode where port names and data types correspond. Severs the rest.

If transferConstantsAndCables is true, transfers constant input port values from oldNode to newNode where port names and data types correspond.

Definition at line 436 of file VuoEditorComposition.cc.

◆ requiresStructuralChangesAfterValueChangeAtPort()

bool VuoEditorComposition::requiresStructuralChangesAfterValueChangeAtPort ( VuoRendererPort port)

Returns a boolean indicating whether a change in value at the provided port will trigger structural changes to the composition.

Definition at line 650 of file VuoEditorComposition.cc.

◆ respecializePort

void VuoEditorComposition::respecializePort ( VuoRendererPort port,
string  specializedTypeName 
)
signal

Emitted when a specialized port is to be re-specialized.

◆ revertCableDrag()

void VuoEditorComposition::revertCableDrag ( void  )

Revert the current cable drag operation, if applicable, without pushing the operation onto the Undo stack.

To be used when the user disconnects and reconnects a cable (without changing its data-carrying status) to the same port within a single mouse drag, or cancels an in-progress cable drag.

Definition at line 2610 of file VuoEditorComposition.cc.

◆ run()

void VuoEditorComposition::run ( string  compositionSnapshot)

Asynchronously compiles, links, and runs a composition created from the snapshot.

Assumes the composition is not already running.

Definition at line 4532 of file VuoEditorComposition.cc.

◆ selectAllComments

void VuoEditorComposition::selectAllComments ( )
slot

Selects all comments on the canvas.

Definition at line 1347 of file VuoEditorComposition.cc.

◆ selectAllCompositionComponents

void VuoEditorComposition::selectAllCompositionComponents ( )
slot

Selects all nodes, cables, and comments on the canvas.

Definition at line 1331 of file VuoEditorComposition.cc.

◆ selectedComponentsDuplicated

void VuoEditorComposition::selectedComponentsDuplicated ( )
signal

Emitted in order to duplicate components.

◆ selectedInternalCablesHidden

void VuoEditorComposition::selectedInternalCablesHidden ( )
signal

Emitted when selected internal cables are to be hidden.

◆ selectTypecastToBridge() [1/2]

string VuoEditorComposition::selectTypecastToBridge ( VuoRendererPublishedPort fromPublishedPort,
VuoRendererPort toPort 
)

Retrieves the list of loaded typecast classes capable of bridging the connection from published port fromPort to internal port toPort; returns one of the retrieved options.

Definition at line 6152 of file VuoEditorComposition.cc.

◆ selectTypecastToBridge() [2/2]

string VuoEditorComposition::selectTypecastToBridge ( VuoRendererPort fromPort,
VuoRendererPublishedPort toPublishedPort 
)

Retrieves the list of loaded typecast classes capable of bridging the connection from internal port fromPort to published port toPort; returns one of the retrieved options.

Definition at line 6143 of file VuoEditorComposition.cc.

◆ setColor()

void VuoEditorComposition::setColor ( bool  isDark)

Makes the widget dark.

Definition at line 7474 of file VuoEditorComposition.cc.

◆ setCompiler()

void VuoEditorComposition::setCompiler ( VuoCompiler compiler)

Specifies a compiler instance to be used by this composition (for, e.g., instantiating dropped nodes).

Definition at line 259 of file VuoEditorComposition.cc.

◆ setIgnoreApplicationStateChangeEvents()

void VuoEditorComposition::setIgnoreApplicationStateChangeEvents ( bool  ignore)

Sets the boolean indicating whether application state change events should currently be ignored.

Definition at line 7097 of file VuoEditorComposition.cc.

◆ setInputEditorManager()

void VuoEditorComposition::setInputEditorManager ( VuoInputEditorManager inputEditorManager)

Specifies an input editor manager instance to be used by this composition (for, e.g., determining whether the port nearest a right-click has an available input editor and should therefore have a "Set Value" item in its context menu).

Definition at line 286 of file VuoEditorComposition.cc.

◆ setModuleManager()

void VuoEditorComposition::setModuleManager ( VuoModuleManager moduleManager)

Specifies the module manager used by this composition and its containing VuoEditorWindow.

Definition at line 267 of file VuoEditorComposition.cc.

◆ setPopoverEventsEnabled

void VuoEditorComposition::setPopoverEventsEnabled ( bool  enable)
slot

Sets the boolean indicating whether to display popovers for components within the canvas in response to mouse events from this point on.

This will not affect existing popovers.

Definition at line 7107 of file VuoEditorComposition.cc.

◆ setPublishedPortName()

void VuoEditorComposition::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.

Definition at line 5614 of file VuoEditorComposition.cc.

◆ setShowEventsMode()

void VuoEditorComposition::setShowEventsMode ( bool  showEventsMode)

Sets the boolean indicating whether this composition is currently in 'Show Events' mode.

Definition at line 6904 of file VuoEditorComposition.cc.

◆ setTriggerPortToRefire()

void VuoEditorComposition::setTriggerPortToRefire ( VuoPort port)

Sets the trigger port to be fired when the user selects the "re-fire" option.

Definition at line 935 of file VuoEditorComposition.cc.

◆ specializePort

void VuoEditorComposition::specializePort ( VuoRendererPort port,
string  specializedTypeName 
)
signal

Emitted when a generic port is to be specialized.

◆ stop()

void VuoEditorComposition::stop ( void  )

Asynchronously stops the running composition.

Assumes the composition is running.

Definition at line 4598 of file VuoEditorComposition.cc.

◆ stopDisplayingActivity()

void VuoEditorComposition::stopDisplayingActivity ( )

Stop reflecting events and executions in the rendering of the composition.

Definition at line 7175 of file VuoEditorComposition.cc.

◆ stopFinished

void VuoEditorComposition::stopFinished ( )
signal

Emitted when finished stopping the composition.

◆ subcompositionEditRequested

void VuoEditorComposition::subcompositionEditRequested ( VuoRendererNode node)
signal

Emitted in order to open a subcomposition for editing.

◆ subcompositionInsertionRequested

void VuoEditorComposition::subcompositionInsertionRequested ( QPointF  scenePos)
signal

Emitted in order to insert a new subcomposition node at the provided scene position.

◆ syncInternalPortConstantInRunningComposition()

void VuoEditorComposition::syncInternalPortConstantInRunningComposition ( string  runningPortID)

If the composition is running, tells the running composition to synchronize the constant value for the internal port with the provided ID to that of the associated port in the stored composition.

Definition at line 4711 of file VuoEditorComposition.cc.

◆ syncPublishedPortConstantInRunningComposition()

void VuoEditorComposition::syncPublishedPortConstantInRunningComposition ( string  portName)

If the composition is running, tells the running composition to synchronize the constant value for the published port of the provided name to that of the associated port in the stored composition.

Definition at line 4749 of file VuoEditorComposition.cc.

◆ takeSnapshot()

string VuoEditorComposition::takeSnapshot ( void  )

Returns a string representation of the composition (to save its current state).

Definition at line 7247 of file VuoEditorComposition.cc.

◆ textCodeEditRequested

void VuoEditorComposition::textCodeEditRequested ( VuoRendererNode node)
signal

Emitted in order to open node class source code for editing.

◆ tintSelectedItems

void VuoEditorComposition::tintSelectedItems ( int  tintColor)
slot

Sets the tint color of the selected nodes and comments to tintColor.

Definition at line 1245 of file VuoEditorComposition.cc.

◆ tintSelectedItemsRequested

void VuoEditorComposition::tintSelectedItemsRequested ( VuoNode::TintColor  tintColor)
signal

Emitted when the user requests that the selected items be tinted.

◆ togglePortPublicationStatus

void VuoEditorComposition::togglePortPublicationStatus ( )
slot

Publishes or unpublishes the port associated with the signal that activated this slot, as appropriate.

Definition at line 784 of file VuoEditorComposition.cc.

◆ triggerThrottlingUpdated

void VuoEditorComposition::triggerThrottlingUpdated ( VuoPort port,
enum VuoPortClass::EventThrottling  eventThrottling 
)
signal

Emitted when a trigger port's event-throttling mode is to be updated.

◆ undoStackMacroBeginRequested

void VuoEditorComposition::undoStackMacroBeginRequested ( QString  commandName)
signal

Emitted when the upcoming sequence of requested operations should be coalesced in an Undo stack macro.

◆ undoStackMacroEndRequested

void VuoEditorComposition::undoStackMacroEndRequested ( )
signal

Emitted when the sequence of operations to be coalesced into an Undo stack macro has completed.

◆ unspecializePort

void VuoEditorComposition::unspecializePort ( VuoRendererPort port)
signal

Emitted when a specialized port is to be reverted to its generic origins.

◆ updateCompositionsThatContainThisSubcomposition()

void VuoEditorComposition::updateCompositionsThatContainThisSubcomposition ( string  newCompositionSnapshot)

If this is a subcomposition, reloads it so that the node library and all compositions containing instances of it see the current (not-yet-saved) state of the subcomposition.

Definition at line 4698 of file VuoEditorComposition.cc.

◆ updateDataInPortPopover()

void VuoEditorComposition::updateDataInPortPopover ( string  portID)

Updates the data value displayed in the port's popover, and subscribes to further updates for the port.

Parameters
portIDA port in the current composition (this).

This function may be called on any dispatch queue except runCompositionQueue.

Definition at line 6723 of file VuoEditorComposition.cc.

◆ updateDataInPortPopoverFromRunningTopLevelComposition()

void VuoEditorComposition::updateDataInPortPopoverFromRunningTopLevelComposition ( VuoEditorComposition popoverComposition,
string  popoverCompositionIdentifier,
string  portID 
)

Updates the data value displayed in the port's popover, and subscribes to further updates for the port.

Call this function only when this is a top-level composition and only when it's running.

Parameters
popoverCompositionThe (sub)composition containing the port.
popoverCompositionIdentifierThe identifier of the (sub)composition containing the port.
portIDThe port whose popover is to be updated.

This function may only be called on dispatch queue runCompositionQueue.

Definition at line 6694 of file VuoEditorComposition.cc.

◆ updateFeedbackErrors

void VuoEditorComposition::updateFeedbackErrors ( VuoRendererPort targetPort = NULL)
slot

Checks the composition, along with the cable being dragged (if any), for invalid feedback loops.

Updates the rendered compositions's error markings.

Parameters
targetPortIf there is a cable drag in progress, the port (if any) that the cable would connect to if dropped at its current position. Otherwise null.

Definition at line 4267 of file VuoEditorComposition.cc.

◆ updateGenericPortTypes()

void VuoEditorComposition::updateGenericPortTypes ( void  )

Gives each group/network of connected generic ports a unique generic type; updates port popovers accordingly.

Definition at line 4254 of file VuoEditorComposition.cc.

◆ updateGeometryForAllComponents

void VuoEditorComposition::updateGeometryForAllComponents ( )
slot

Prepares every component in the composition to be repainted (slot version that simply calls the VuoRendererComposition non-slot version of the same method).

Definition at line 6888 of file VuoEditorComposition.cc.

◆ updateInternalPortConstant()

void VuoEditorComposition::updateInternalPortConstant ( string  portID,
string  newValue,
bool  updateInRunningComposition 
)

Updates the constant value of the internal input port with the provided portID to the newValue, in both the static and running copies of the composition (if applicable).

Definition at line 4203 of file VuoEditorComposition.cc.

◆ updateInternalPortConstantInRunningComposition()

void VuoEditorComposition::updateInternalPortConstantInRunningComposition ( VuoCompilerInputEventPort port,
string  constant 
)

If the composition is running, tells the composition to set a new constant value on the port.

Definition at line 4762 of file VuoEditorComposition.cc.

◆ updateInternalPortConstantInSubcompositionInstances()

void VuoEditorComposition::updateInternalPortConstantInSubcompositionInstances ( string  subcompositionPath,
string  portIdentifier,
string  constant 
)

If the composition is running and contains one or more instances of the subcomposition whose source code is at subcompositionPath, tells the composition to set a new constant value on the port in each instance of the subcomposition.

Definition at line 4799 of file VuoEditorComposition.cc.

◆ updatePortConstant()

void VuoEditorComposition::updatePortConstant ( VuoCompilerPort port,
string  newValue,
bool  updateInRunningComposition = true 
)

Updates the provided port constant with the newValue in both the stored and running copies of the composition (if applicable).

Definition at line 4229 of file VuoEditorComposition.cc.

◆ updatePortPopovers()

void VuoEditorComposition::updatePortPopovers ( VuoRendererNode node = NULL)

Updates the text of all active popovers associated with this composition.

If an input node is provided, only popovers whose ports belong to that node are disabled.

Definition at line 6668 of file VuoEditorComposition.cc.

◆ updatePublishedInputPortConstantInRunningComposition()

void VuoEditorComposition::updatePublishedInputPortConstantInRunningComposition ( VuoPublishedPort port,
string  constant 
)

If the composition is running, tells the composition to set a new constant value on the published input port.

Definition at line 4817 of file VuoEditorComposition.cc.

◆ updatePublishedPortConstant()

void VuoEditorComposition::updatePublishedPortConstant ( string  portName,
string  newValue,
bool  updateInRunningComposition 
)

Updates the constant value of the internal input port with the provided portID to the newValue, in both the stored and running copies of the composition (if applicable).

Definition at line 4216 of file VuoEditorComposition.cc.

◆ updateRunningComposition()

void VuoEditorComposition::updateRunningComposition ( string  oldCompositionSnapshot,
string  newCompositionSnapshot,
VuoCompilerCompositionDiff diffInfo = nullptr,
set< string >  dependenciesUninstalled = set<string>() 
)

Asynchronously replaces the running composition (if any) with a composition created from newCompositionSnapshot.

Parameters
oldCompositionSnapshotA snapshot of the currently running composition (which may include minor changes made since the composition was last run/updated, for which the running composition did not need to be updated).
newCompositionSnapshotA snapshot of the composition to run.
diffInfoMappings from the old composition to the new composition. This function becomes responsible for destroying it.
dependenciesUninstalledModule keys of dependencies of the composition that have been uninstalled. This may include dependencies of dependencies, which would not be detected by VuoCompilerComposition::check. If this is not empty, the composition will stop with an error.

Definition at line 4648 of file VuoEditorComposition.cc.

◆ validateProtocol()

bool VuoEditorComposition::validateProtocol ( VuoEditorWindow window,
bool  isExportingMovie 
)

Checks whether the composition superficially meets the requirements as an image filter/generator/transition protocol composition eligible for movie or plugin export.

This check may be used to prevent the most commonly anticipated situations in which export might fail; it is not authoritative.

If a problem is detected, shows an error dialog and returns false.

For Image Filters, checks whether the image and outputImage ports both have a connected cable.

For Image Generators, checks whether the time and outputImage ports both have a connected cable.

For Image Transitions, checks whether the progress and outputImage ports both have a connected cable.

Definition at line 7197 of file VuoEditorComposition.cc.

Member Data Documentation

◆ componentCollisionRange

const qreal VuoEditorComposition::componentCollisionRange = 10
static

The search range used in locating composition components near the cursor.

Definition at line 49 of file VuoEditorComposition.hh.


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