Handles drags-and-drops and performs node instantiation for the editor window.
Definition at line 36 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, comments, and cables. More... | |
void | deleteSelectedCompositionComponents (string commandDescription) |
Deletes currently selected nodes, comments, and cables. More... | |
void | togglePortPublicationStatus () |
Publishes or unpublishes the port associated with the signal that activated this slot, as appropriate. 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 | emitNodeSourceEditorRequested () |
Workaround so that the "Edit {Composition/Shader/Node}" 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 | highlightPublishedSidebarDropLocationsRequested (VuoRendererPort *port, bool eventOnlyConnection) |
Emitted when eligible published port sidebar drop locations for port should be visually highlighted. More... | |
void | clearPublishedSidebarDropLocationHighlightingRequested () |
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 | nodeSourceEditorRequested (VuoRendererNode *node) |
Emitted in order to open an editable node's source file. 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 (VuoMainWindow *window, 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... | |
VuoCompiler * | getCompiler () |
Returns the compiler instance being used by this composition. More... | |
void | setModuleManager (VuoModuleManager *moduleManager) |
Specifies the module manager used by this composition and its containing VuoEditorWindow. More... | |
VuoModuleManager * | getModuleManager (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... | |
VuoInputEditorManager * | 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). More... | |
VuoRendererNode * | createNode (QString nodeClassName, string title="", double x=0, double y=0) |
Instantiates a node of class name nodeClassName . More... | |
VuoNode * | 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. More... | |
VuoNode * | createNodeWithMissingImplementation (VuoNodeClass *modelNodeClass, VuoNode *modelNode, string title="", double x=0, double y=0) |
Creates an instance of an implementation-less node class. More... | |
void | updateNodeImplementationInPlace (VuoRendererNode *oldNode, VuoNode *newNode) |
Replaces oldNode with newNode in the composition in response to an updated node class implementation. 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) |
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, bool emitHiddenCableNotification=true) |
Adds a cable to the canvas. More... | |
void | removeCable (VuoRendererCable *rc, bool emitHiddenCableNotification=true) |
Removes a cable from the canvas. More... | |
VuoRendererNode * | 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. 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) |
Creates and connects the appropriate input attachments to the provided node . More... | |
set< QGraphicsItem * > | getDependentAttachmentsForNode (VuoRendererNode *rn, bool includeCoattachments) |
Returns the set of connected attachments upstream of the provided node, meaning that if the node is deleted, the attachments should be as well. 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... | |
void | performStructuralChangesAfterValueChangeAtPort (VuoEditorWindow *editorWindow, QUndoStack *undoStack, VuoRendererPort *port, string originalEditingSessionValue, string finalEditingSessionValue) |
Replaces nodes, if needed, to accommodate the new port value. 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... | |
VuoCable * | getCableInProgress () |
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... | |
VuoRendererNode * | findNearbyNodeHeader (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... | |
VuoRendererPort * | 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. More... | |
VuoRendererPort * | findDefaultPortForEventOnlyConnection (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 | clearCableEndpointEligibilityHighlighting () |
Clears highlighting of eligible cable connection endpoints. 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_object * | 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. More... | |
VuoPort * | getPortWithStaticIdentifier (string portID) |
Returns the port registered to the composition under the provided portID . 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, bool shouldOutputNodesToReplace, 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... | |
VuoRendererPublishedPort * | 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. More... | |
VuoCable * | createPublishedCable (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... | |
VuoProtocol * | getActiveProtocol () |
Returns the active protocol for this composition. More... | |
VuoCompilerDriver * | 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. 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... | |
VuoRendererColors::HighlightType | getEligibilityHighlightingForPort (VuoRendererPort *portToHighlight, VuoRendererPort *fixedPort, bool eventOnlyConnection, map< string, VuoCompilerType * > &types) |
Returns the appropriate eligibility highlighting for the specified portToHighlight given that the fixedPort will be at the other end of the cable connection. More... | |
vector< string > | findBridgingSolutions (VuoRendererPort *fromPort, VuoRendererPort *toPort, bool toPortIsDragDestination, map< string, VuoCompilerType * > &types) |
Convenience function for the other version of VuoEditorComposition::findBridgingSolutions(), when all that matters is whether a bridging solution between two ports exists, not what the solution is. More... | |
bool | selectBridgingSolution (VuoRendererPort *fromPort, VuoRendererPort *toPort, bool toPortIsDragDestination, VuoRendererPort **portToSpecialize, string &specializedTypeName, string &typecastToInsert) |
Prompts the user to select a bridging (typeconversion and/or (re-)specialization) solution to connect the provided ports. More... | |
QList< QAction * > | getCompatibleTypesForMenu (VuoRendererPort *genericPort, set< string > compatibleTypesInIsolation, set< string > compatibleTypesInContext, bool limitToNodeSet, string nodeSetName="", QMenu *menu=NULL) |
Constructs a list of actions, each of which represents a compatible type 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 action with the data and slot necessary to accomplish the "Specialize" operation. More... | |
void | addTypeActionsToMenu (QList< QAction * > actionList, QMenu *menu) |
Sorts and adds the provided list of actions representing Vuo types to the specified menu. 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... | |
VuoPortPopover * | getActivePopoverForPort (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... | |
VuoPort * | getTriggerPortToRefire () |
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... | |
QString | formatTypeNameForDisplay (VuoType *type) |
Formats the input type name for human-readable display. More... | |
string | getDefaultPublishedPortNameForType (VuoType *type) |
Returns a suggested name for a published port of the provided type. 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... | |
VuoRendererNode * | createRendererNode (VuoNode *baseNode) |
Creates a renderer detail for the base node. More... | |
VuoRendererComment * | createRendererComment (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) |
Creates and connects the appropriate input attachments to the provided node . More... | |
VuoRendererNode * | createAndConnectMakeListNode (VuoNode *toNode, VuoPort *toPort, VuoCompiler *compiler, VuoRendererCable *&rendererCable) |
Creates a "Make List" node, and creates a cable from the "Make List" node to the given input port. 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... | |
VuoRendererPublishedPort * | createRendererForPublishedPortInComposition (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... | |
VuoRendererTypecastPort * | collapseTypecastNode (VuoRendererNode *rn) |
Convert a freestanding typecast node into a mini-node attached to its destination node; returns a pointer to the newly collapsed node. 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... | |
VuoRendererNode * | uncollapseTypecastNode (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... | |
VuoNode * | getPublishedInputNode (void) |
Returns the published input node associated with this composition. More... | |
VuoNode * | getPublishedOutputNode (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... | |
VuoComposition * | getBase (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 string | getIdentifierForStaticPort (VuoPort *staticPort, VuoNode *parentNode=NULL) |
If staticPort is a published port, returns its name (without the node identifier + colon). More... | |
static VuoNode * | getUnderlyingParentNodeForPort (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 |
class | TestEditorCommands |
Additional Inherited Members | |
Static Protected Member Functions inherited from VuoRendererComposition | |
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 | |
VuoCompilerGraphvizParser * | parser |
The Graphviz parser instance used by this composition. More... | |
VuoRendererSignaler * | signaler |
The Qt signaler used by this composition. More... | |
VuoNode * | publishedInputNode |
The published input node associated with this composition. More... | |
VuoNode * | publishedOutputNode |
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... | |
Specifies the desired type of composition component to be returned from a search.
Definition at line 44 of file VuoEditorComposition.hh.
|
explicit |
Creates an empty canvas upon which nodes and cables can be rendered.
Definition at line 76 of file VuoEditorComposition.cc.
|
signal |
Emitted when the active protocol has changed.
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 5606 of file VuoEditorComposition.cc.
void VuoEditorComposition::addCable | ( | VuoCable * | cable, |
bool | emitHiddenCableNotification = true |
||
) |
Adds a cable to the canvas.
Definition at line 598 of file VuoEditorComposition.cc.
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 409 of file VuoEditorComposition.cc.
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 5908 of file VuoEditorComposition.cc.
void VuoEditorComposition::addTypeActionsToMenu | ( | QList< QAction * > | actionList, |
QMenu * | menu | ||
) |
Sorts and adds the provided list of actions representing Vuo types to the specified menu.
Definition at line 4152 of file VuoEditorComposition.cc.
|
signal |
Emitted (if this composition is topmost) when the application has been activated or deactivated.
void VuoEditorComposition::beginDisplayingActivity | ( | bool | includePorts = true | ) |
Begin reflecting events and executions in the rendering of the composition.
Definition at line 7854 of file VuoEditorComposition.cc.
|
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.
|
signal |
Emitted when starting to compile and link the composition.
|
signal |
Emitted when the user ends a cable drag, whether a connection was completed or not.
|
signal |
Emitted when the user begins dragging a cable.
|
signal |
Emitted when cables are to be hidden.
|
signal |
Emitted when cables are to be unhidden.
void VuoEditorComposition::cancelCableDrag | ( | void | ) |
Cancel the current cable drag operation, if applicable.
Definition at line 2775 of file VuoEditorComposition.cc.
|
signal |
Emitted when a hidden cable has been added to or removed from the composition.
void VuoEditorComposition::clear | ( | ) |
Deletes all composition components.
Definition at line 894 of file VuoEditorComposition.cc.
void VuoEditorComposition::clearCableEndpointEligibilityHighlighting | ( | ) |
Clears highlighting of eligible cable connection endpoints.
Definition at line 6419 of file VuoEditorComposition.cc.
void VuoEditorComposition::clearHoverHighlighting | ( | ) |
Clear hover-highlighting of the previously highlighted composition component.
Definition at line 3051 of file VuoEditorComposition.cc.
|
signal |
Emitted when eligible published port sidebar drop locations should no longer be highlighted.
|
signal |
Emitted in order to display a comment editor.
|
signal |
Emitted in order to insert a new comment at the provided scene position.
|
signal |
Emitted when a comment is resized.
|
signal |
Emitted in order to zoom in on a comment.
|
signal |
Emitted in order to add components.
|
signal |
Emitted in order to remove components.
|
signal |
Emitted when the composition detects that it is or is no longer the topmost composition.
|
signal |
Emitted when the user quits the composition or the composition crashes.
|
signal |
Emitted after a cable has been connected to a node.
|
protected |
Display the context menu for the canvas or for a node, port, cable, or comment.
Definition at line 3226 of file VuoEditorComposition.cc.
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.
node | The node that needs the dictionary attachments created. | |
[out] | createdNodes | The created nodes. |
[out] | createdCables | The created cables. |
Definition at line 628 of file VuoEditorComposition.cc.
QList< QGraphicsItem * > VuoEditorComposition::createAndConnectInputAttachments | ( | VuoRendererNode * | node, |
bool | createButDoNotAdd = false |
||
) |
Creates and connects the appropriate input attachments to the provided node
.
node | The node that needs the input attachments created. |
createButDoNotAdd | A boolean specifying whether to create the attachments without adding them to the composition. |
Definition at line 641 of file VuoEditorComposition.cc.
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.
toNode | The node that contains toPort . | |
toPort | The input port. Assumed to be a data-and-event input port carrying list data. | |
[out] | rendererCable | The created cable. |
Definition at line 615 of file VuoEditorComposition.cc.
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 329 of file VuoEditorComposition.cc.
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.
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 368 of file VuoEditorComposition.cc.
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 5551 of file VuoEditorComposition.cc.
void VuoEditorComposition::createReplacementsToUnspecializePort | ( | VuoPort * | portToUnspecialize, |
bool | shouldOutputNodesToReplace, | ||
map< VuoNode *, string > & | nodesToReplace, | ||
set< VuoCable * > & | cablesToDelete | ||
) |
Outputs the composition components that would need to be modified in order to unspecialize the given port.
portToUnspecialize | The port to unspecialize. |
shouldOutputNodesToReplace | If true, nodesToReplace will be populated. |
nodesToReplace | The nodes that would need to be replaced, and the names of the less-specialized node classes that would replace them. |
cablesToDelete | The 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 1206 of file VuoEditorComposition.cc.
|
slot |
Deletes currently selected nodes, comments, and cables.
Definition at line 854 of file VuoEditorComposition.cc.
|
slot |
Deletes currently selected nodes, comments, and cables.
Definition at line 862 of file VuoEditorComposition.cc.
void VuoEditorComposition::deleteSelectedNodes | ( | string | commandDescription = "" | ) |
Deletes currently selected nodes.
Definition at line 879 of file VuoEditorComposition.cc.
|
slot |
Deselects all nodes, cables, and comments on the canvas.
Definition at line 1512 of file VuoEditorComposition.cc.
void VuoEditorComposition::disableErrorPopovers | ( | ) |
Disables all error popovers associated with this composition.
Definition at line 7259 of file VuoEditorComposition.cc.
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 7320 of file VuoEditorComposition.cc.
|
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 7194 of file VuoEditorComposition.cc.
void VuoEditorComposition::disablePopovers | ( | ) |
Disables all popovers associated with this composition, whether they are detached or not.
Definition at line 7250 of file VuoEditorComposition.cc.
void VuoEditorComposition::disableStrandedPortPopovers | ( | ) |
Disables any port popover that does not currently have an associated port in the composition.
Definition at line 7301 of file VuoEditorComposition.cc.
|
protected |
Decide whether we can accept the dragged data.
Definition at line 1640 of file VuoEditorComposition.cc.
|
protected |
Decide what to do with the dragged data as it leaves.
Definition at line 1710 of file VuoEditorComposition.cc.
|
protected |
Decide what to do with the moved drag-drop data.
Definition at line 1718 of file VuoEditorComposition.cc.
|
protected |
Handle the dropped data.
Definition at line 1726 of file VuoEditorComposition.cc.
|
signal |
Emitted in order to cancel duplication of components.
void VuoEditorComposition::emitCompositionOnTop | ( | bool | top | ) |
Emits a compositionOnTop
signal.
Definition at line 8216 of file VuoEditorComposition.cc.
|
slot |
Workaround so that the "Edit {Composition/Shader/Node}" context menu item can emit a signal with argument when triggered.
Definition at line 3730 of file VuoEditorComposition.cc.
void VuoEditorComposition::emitPublishedPortNameEditorRequested | ( | VuoRendererPublishedPort * | port | ) |
Emits a publishedPortNameEditorRequested
signal.
Definition at line 8224 of file VuoEditorComposition.cc.
|
signal |
Emitted when the left mouse button is released on an empty region of the canvas.
void VuoEditorComposition::enablePopoverForPort | ( | VuoRendererPort * | rp | ) |
Displays a new popover for the provided port
.
Definition at line 7115 of file VuoEditorComposition.cc.
vector< string > VuoEditorComposition::findBridgingSolutions | ( | VuoRendererPort * | fromPort, |
VuoRendererPort * | toPort, | ||
bool | toPortIsDragDestination, | ||
map< string, VuoCompilerType * > & | types | ||
) |
Convenience function for the other version of VuoEditorComposition::findBridgingSolutions(), when all that matters is whether a bridging solution between two ports exists, not what the solution is.
fromPort | The output port that will provide the source data for typeconversion. |
toPort | The input port that will accept the typeconverted data. |
toPortIsDragDestination | Whether the cable connection is being completed at the toPort (as in a forward cable drag) as opposed to the fromPort (as in a backward cable drag), which may be the tie-breaking factor in deciding which port to attempt to specialize. |
types | All loaded types (VuoCompiler::getTypes). |
Returns a vector containing the names of all loaded typecast classes that, in combination with potential respecialization of the fromPort
or toPort
, are capable of bridging the connection between the two ports. An empty string in place of a typecast name means that the ports can be bridged without typeconversion (but still might require specialization). An empty vector means that no bridging solutions were found.
Definition at line 6573 of file VuoEditorComposition.cc.
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 4398 of file VuoEditorComposition.cc.
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 4219 of file VuoEditorComposition.cc.
VuoRendererNode * VuoEditorComposition::findNearbyNodeHeader | ( | QPointF | scenePos | ) |
Returns the node whose header area scenePos falls within, or NULL if none.
Definition at line 4201 of file VuoEditorComposition.cc.
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 4193 of file VuoEditorComposition.cc.
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 4379 of file VuoEditorComposition.cc.
|
static |
Formats the input unformattedCompositionFileName
for human-readable display by stripping the .vuo extension, capitalizing the first word, and inserting spaces between CamelCase transitions.
Definition at line 7981 of file VuoEditorComposition.cc.
|
static |
Formats the input nodeSetName
for human-readable display.
Definition at line 8009 of file VuoEditorComposition.cc.
QString VuoEditorComposition::formatTypeNameForDisplay | ( | VuoType * | type | ) |
Formats the input type
name for human-readable display.
Definition at line 8054 of file VuoEditorComposition.cc.
string VuoEditorComposition::generateCompositionHeader | ( | ) |
Generates a header containing this composition's metadata.
Definition at line 7943 of file VuoEditorComposition.cc.
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 8297 of file VuoEditorComposition.cc.
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 7087 of file VuoEditorComposition.cc.
VuoProtocol * VuoEditorComposition::getActiveProtocol | ( | ) |
Returns the active protocol for this composition.
Definition at line 5888 of file VuoEditorComposition.cc.
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 3919 of file VuoEditorComposition.cc.
VuoCable * VuoEditorComposition::getCableInProgress | ( | ) |
Returns the cable currently being dragged, or NULL if no cable is currently being dragged.
Definition at line 1456 of file VuoEditorComposition.cc.
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 1465 of file VuoEditorComposition.cc.
set< VuoRendererCable * > VuoEditorComposition::getCablesInternalToSubcomposition | ( | QList< QGraphicsItem * > | subcompositionComponents | ) |
Returns the set of cables creating internal connections within the set of input subcompositionComponents
.
Definition at line 1428 of file VuoEditorComposition.cc.
QList< QAction * > VuoEditorComposition::getCompatibleTypesForMenu | ( | VuoRendererPort * | genericPort, |
set< string > | compatibleTypesInIsolation, | ||
set< string > | compatibleTypesInContext, | ||
bool | limitToNodeSet, | ||
string | nodeSetName = "" , |
||
QMenu * | menu = NULL |
||
) |
Constructs a list of actions, each of which represents a compatible type 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 action with the data and slot necessary to accomplish the "Specialize" operation.
If limitToNodeSet
is true
, includes only types specific to the provided nodeSetName
in a submenu named for that type.
limitToNodeSet
is true
but the provided nodeSetName
is empty, the compatible "Core" types are included in the top-level list.limitToNodeSet
is false
, all compatible types (regardless of node set) are included in the top-level list.If a menu is provided, any submenus or actions created will be initialized with the provided menu as their parent (although not added to the menu).
Returns the generated list of actions, which may be used to populate a menu.
Definition at line 4029 of file VuoEditorComposition.cc.
VuoCompiler * VuoEditorComposition::getCompiler | ( | void | ) |
Returns the compiler instance being used by this composition.
Definition at line 259 of file VuoEditorComposition.cc.
QAction * VuoEditorComposition::getContextMenuDeleteSelectedAction | ( | void | ) |
Returns the context menu's action that deletes a component.
Definition at line 5159 of file VuoEditorComposition.cc.
QMenu * VuoEditorComposition::getContextMenuTints | ( | QMenu * | parent = 0 | ) |
Returns a "Tint" submenu for the provided parent menu.
Definition at line 5167 of file VuoEditorComposition.cc.
|
static |
Returns the name to be used for a composition located at compositionPath if the user hasn't specified a name.
Definition at line 7951 of file VuoEditorComposition.cc.
string VuoEditorComposition::getDefaultPublishedPortNameForType | ( | VuoType * | type | ) |
Returns a suggested name for a published port of the provided type.
Definition at line 8079 of file VuoEditorComposition.cc.
set< QGraphicsItem * > VuoEditorComposition::getDependentAttachmentsForNode | ( | VuoRendererNode * | rn, |
bool | includeCoattachments | ||
) |
Returns the set of connected attachments upstream of the provided node, meaning that if the node is deleted, the attachments should be as well.
rn | The renderer node whose attachments should be returned. |
includeCoattachments | If the node is itself an attachment, include sibling attachments. |
Definition at line 661 of file VuoEditorComposition.cc.
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 5897 of file VuoEditorComposition.cc.
VuoRendererColors::HighlightType VuoEditorComposition::getEligibilityHighlightingForPort | ( | VuoRendererPort * | portToHighlight, |
VuoRendererPort * | fixedPort, | ||
bool | eventOnlyConnection, | ||
map< string, VuoCompilerType * > & | types | ||
) |
Returns the appropriate eligibility highlighting for the specified portToHighlight
given that the fixedPort
will be at the other end of the cable connection.
portToHighlight | The port to have connection eligibility highlighting applied. |
fixedPort | The port already selected for connection, and against which eligibility is to be checked. |
eventOnlyConnection | If true, determines eligibility as if the ports will be connected with a cable that is event-only regardless of the data-carrying status of the ports. |
types | All loaded types (VuoCompiler::getTypes). |
Definition at line 6076 of file VuoEditorComposition.cc.
QString VuoEditorComposition::getFormattedName | ( | ) |
Returns the formatted name of the composition, either pre-formatted by the user or, otherwise, formatted automatically.
Definition at line 7964 of file VuoEditorComposition.cc.
|
static |
If staticPort
is a published port, returns its name (without the node identifier + colon).
If staticPort
is an internal port, returns its identifier (including the node identifier + colon) 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 7002 of file VuoEditorComposition.cc.
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.
bool VuoEditorComposition::getMenuSelectionInProgress | ( | ) |
Returns a boolean indicating whether selection from a context menu is currently in progress.
Definition at line 1473 of file VuoEditorComposition.cc.
VuoModuleManager * VuoEditorComposition::getModuleManager | ( | void | ) |
Returns the module manager used by this composition and its containing VuoEditorWindow.
Definition at line 276 of file VuoEditorComposition.cc.
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 6961 of file VuoEditorComposition.cc.
VuoPort * VuoEditorComposition::getPortWithStaticIdentifier | ( | string | portID | ) |
Returns the port registered to the composition under the provided portID
.
Definition at line 7037 of file VuoEditorComposition.cc.
set< VuoRendererCable * > VuoEditorComposition::getSelectedCables | ( | bool | includePublishedCables | ) |
Returns the set of currently selected cables.
Definition at line 1622 of file VuoEditorComposition.cc.
set< VuoRendererComment * > VuoEditorComposition::getSelectedComments | ( | ) |
Returns the set of currently selected comments.
Definition at line 1604 of file VuoEditorComposition.cc.
set< VuoRendererNode * > VuoEditorComposition::getSelectedNodes | ( | ) |
Returns the set of currently selected nodes.
Definition at line 1586 of file VuoEditorComposition.cc.
bool VuoEditorComposition::getShowEventsMode | ( | ) |
Returns a boolean indicating whether this composition is currently in 'Show Events' mode.
Definition at line 7635 of file VuoEditorComposition.cc.
VuoPort * VuoEditorComposition::getTriggerPortToRefire | ( | ) |
Returns the trigger port to be fired when the user selects the "re-fire" option.
Definition at line 1108 of file VuoEditorComposition.cc.
|
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 7051 of file VuoEditorComposition.cc.
bool VuoEditorComposition::hasHiddenInternalCables | ( | ) |
Returns a boolean indicating whether the composition contains any hidden (wireless) internal cables.
Definition at line 7678 of file VuoEditorComposition.cc.
bool VuoEditorComposition::hasHiddenPublishedCables | ( | ) |
Returns a boolean indicating whether the composition contains any hidden (wireless) published cables.
Definition at line 7692 of file VuoEditorComposition.cc.
|
signal |
Emitted when eligible published port sidebar drop locations for port
should be visually highlighted.
|
signal |
Emitted in order to display an input editor.
|
signal |
Emitted when a node is to have its port count adjusted.
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 4462 of file VuoEditorComposition.cc.
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 4479 of file VuoEditorComposition.cc.
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 4497 of file VuoEditorComposition.cc.
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 4833 of file VuoEditorComposition.cc.
|
signal |
Emitted in order to move nodes and comments.
|
protected |
Handle keypress events.
Definition at line 3087 of file VuoEditorComposition.cc.
|
protected |
Handle key release events.
Definition at line 3196 of file VuoEditorComposition.cc.
|
signal |
Emitted when the left mouse button is released.
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 1987 of file VuoEditorComposition.cc.
|
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 7617 of file VuoEditorComposition.cc.
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 689 of file VuoEditorComposition.cc.
|
protected |
Handle mouse double-click events.
Definition at line 1934 of file VuoEditorComposition.cc.
|
protected |
Handle mouse move events.
Definition at line 2824 of file VuoEditorComposition.cc.
|
protected |
Handle mouse press events.
Definition at line 1950 of file VuoEditorComposition.cc.
|
protected |
Handle mouse release events.
Definition at line 2283 of file VuoEditorComposition.cc.
void VuoEditorComposition::movePopoversBy | ( | int | dx, |
int | dy | ||
) |
Moves all popovers associated with this composition dx
points horizontally and dy
points vertically.
Definition at line 7357 of file VuoEditorComposition.cc.
|
slot |
Moves currently selected nodes and comments dx
points horizontally and dy
points vertically.
Definition at line 1539 of file VuoEditorComposition.cc.
|
signal |
Emitted when a node popover is to be displayed.
|
signal |
Emitted in order to open an editable node's source file.
|
signal |
Emitted when a node is to be replaced with a new node of a similar class.
|
signal |
Emitted in order to display a node title editor.
void VuoEditorComposition::performStructuralChangesAfterValueChangeAtPort | ( | VuoEditorWindow * | editorWindow, |
QUndoStack * | undoStack, | ||
VuoRendererPort * | port, | ||
string | originalEditingSessionValue, | ||
string | finalEditingSessionValue | ||
) |
Replaces nodes, if needed, to accommodate the new port value.
Definition at line 778 of file VuoEditorComposition.cc.
|
signal |
Emitted when one of this composition's popovers has just been detached.
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 5216 of file VuoEditorComposition.cc.
|
signal |
Emitted in order to change the value of a port constant.
|
signal |
Emitted when an internal port is to be published in association with a specific external published port.
|
signal |
Emitted when a port is to be published.
|
signal |
Emitted when a port is to be unpublished.
|
signal |
Emitted when published ports need to be modified for compatibility with a newly activated protocol.
|
signal |
Emitted when the composition has had published ports added, removed, or re-named.
|
signal |
Emitted when a published port name editor should be displayed.
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.
port | The internal port to be published. | |
forceEventOnlyPublication | Forces an event-only cable to the published port. | |
name | The name under which the port is to be published, if possible. | |
type | The desired data type of the external published port to be created. | |
attemptMerge | A 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] | mergePerformed | A boolean indicating whether the port was published in association with a pre-existing (rather than a newly created) external published port. |
Definition at line 5480 of file VuoEditorComposition.cc.
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 8261 of file VuoEditorComposition.cc.
|
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 7547 of file VuoEditorComposition.cc.
|
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 7494 of file VuoEditorComposition.cc.
|
virtual |
This delegate method is invoked every time a node has finished executing.
Implementation of the virtual VuoRunnerDelegate function.
Implements VuoRunnerDelegate.
Definition at line 7592 of file VuoEditorComposition.cc.
|
virtual |
This delegate method is invoked every time a node has started executing.
Implementation of the virtual VuoRunnerDelegate function.
Implements VuoRunnerDelegate.
Definition at line 7569 of file VuoEditorComposition.cc.
|
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 7515 of file VuoEditorComposition.cc.
|
signal |
Emitted when the selected nodes should be refactored into a subcomposition.
|
signal |
Emitted when the trigger port to be re-fired changes.
void VuoEditorComposition::refireTriggerPortEvent | ( | ) |
Fires another event from the trigger port that was most recently manually fired.
Definition at line 1100 of file VuoEditorComposition.cc.
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:
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 5760 of file VuoEditorComposition.cc.
void VuoEditorComposition::removeActiveProtocolWithoutModifyingPorts | ( | VuoProtocol * | protocol | ) |
Deactivates the provided protocol for this composition, updating the isProtocolPort
attribute of each affected port.
Definition at line 5852 of file VuoEditorComposition.cc.
void VuoEditorComposition::removeCable | ( | VuoRendererCable * | rc, |
bool | emitHiddenCableNotification = true |
||
) |
Removes a cable from the canvas.
Definition at line 586 of file VuoEditorComposition.cc.
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 420 of file VuoEditorComposition.cc.
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.
Definition at line 5924 of file VuoEditorComposition.cc.
|
slot |
Triggers interactive re-naming of selected non-drawer nodes.
Definition at line 1403 of file VuoEditorComposition.cc.
void VuoEditorComposition::repaintFeedbackErrorMarks | ( | ) |
Updates the renderings of any currently existing feedback error marks.
Definition at line 4760 of file VuoEditorComposition.cc.
void VuoEditorComposition::replaceNode | ( | VuoRendererNode * | oldNode, |
VuoNode * | newNode | ||
) |
Replaces oldNode with newNode in the composition, performing the same cleanup/setup of editor state as VuoEditorComposition::removeNode and VuoEditorComposition::addNode.
Definition at line 561 of file VuoEditorComposition.cc.
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 761 of file VuoEditorComposition.cc.
|
signal |
Emitted when a specialized port is to be re-specialized.
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 2800 of file VuoEditorComposition.cc.
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 4847 of file VuoEditorComposition.cc.
|
slot |
Selects all comments on the canvas.
Definition at line 1497 of file VuoEditorComposition.cc.
|
slot |
Selects all nodes, cables, and comments on the canvas.
Definition at line 1481 of file VuoEditorComposition.cc.
bool VuoEditorComposition::selectBridgingSolution | ( | VuoRendererPort * | fromPort, |
VuoRendererPort * | toPort, | ||
bool | toPortIsDragDestination, | ||
VuoRendererPort ** | portToSpecialize, | ||
string & | specializedTypeName, | ||
string & | typecastToInsert | ||
) |
Prompts the user to select a bridging (typeconversion and/or (re-)specialization) solution to connect the provided ports.
fromPort | The output port that will provide the source data for typeconversion. | |
toPort | The input port that will accept the typeconverted data. | |
toPortIsDragDestination | Whether the cable connection is being completed at the toPort (as in a forward cable drag) as opposed to the fromPort (as in a backward cable drag), which may be the tie-breaking factor in deciding which port to attempt to specialize. | |
[out] | portToSpecialize | The port, either fromPort or toPort , that will require specialization in order for the connection to be completed. Does not account for potential cascade effects. NULL if the connection can be completed without specialization. |
[out] | specializedTypeName | The name of the specialized port type with which the generic port type is to be replaced. Empty string if the connection can be completed without specialization. |
[out] | typecastToInsert | The class name of the typecast to be inserted in order to complete the connection. Empty string if typeconversion is unnecessary. |
Returns true if a solution was selected, and false otherwise.
Definition at line 6443 of file VuoEditorComposition.cc.
|
signal |
Emitted in order to duplicate components.
|
signal |
Emitted when selected internal cables are to be hidden.
void VuoEditorComposition::setColor | ( | bool | isDark | ) |
Makes the widget dark.
Definition at line 8245 of file VuoEditorComposition.cc.
void VuoEditorComposition::setCompiler | ( | VuoCompiler * | compiler | ) |
Specifies a compiler instance to be used by this composition (for, e.g., instantiating dropped nodes).
Definition at line 251 of file VuoEditorComposition.cc.
void VuoEditorComposition::setIgnoreApplicationStateChangeEvents | ( | bool | ignore | ) |
Sets the boolean indicating whether application state change events should currently be ignored.
Definition at line 7836 of file VuoEditorComposition.cc.
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.
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.
|
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 7846 of file VuoEditorComposition.cc.
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 5942 of file VuoEditorComposition.cc.
void VuoEditorComposition::setShowEventsMode | ( | bool | showEventsMode | ) |
Sets the boolean indicating whether this composition is currently in 'Show Events' mode.
Definition at line 7643 of file VuoEditorComposition.cc.
void VuoEditorComposition::setTriggerPortToRefire | ( | VuoPort * | port | ) |
Sets the trigger port to be fired when the user selects the "re-fire" option.
Definition at line 1123 of file VuoEditorComposition.cc.
|
signal |
Emitted when a generic port is to be specialized.
void VuoEditorComposition::stop | ( | void | ) |
Asynchronously stops the running composition.
Assumes the composition is running.
Definition at line 4913 of file VuoEditorComposition.cc.
void VuoEditorComposition::stopDisplayingActivity | ( | ) |
Stop reflecting events and executions in the rendering of the composition.
Definition at line 7863 of file VuoEditorComposition.cc.
|
signal |
Emitted when finished stopping the composition.
|
signal |
Emitted in order to insert a new subcomposition node at the provided scene position.
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 5033 of file VuoEditorComposition.cc.
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 5071 of file VuoEditorComposition.cc.
string VuoEditorComposition::takeSnapshot | ( | void | ) |
Returns a string representation of the composition (to save its current state).
Definition at line 7935 of file VuoEditorComposition.cc.
|
signal |
Emitted when the user requests that the selected items be tinted.
|
slot |
Publishes or unpublishes the port associated with the signal that activated this slot, as appropriate.
Definition at line 969 of file VuoEditorComposition.cc.
|
signal |
Emitted when a trigger port's event-throttling mode is to be updated.
|
signal |
Emitted when the upcoming sequence of requested operations should be coalesced in an Undo stack macro.
|
signal |
Emitted when the sequence of operations to be coalesced into an Undo stack macro has completed.
|
signal |
Emitted when a specialized port is to be reverted to its generic origins.
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 5020 of file VuoEditorComposition.cc.
void VuoEditorComposition::updateDataInPortPopover | ( | string | portID | ) |
Updates the data value displayed in the port's popover, and subscribes to further updates for the port.
portID | A port in the current composition (this ). |
This function may be called on any dispatch queue except runCompositionQueue
.
Definition at line 7479 of file VuoEditorComposition.cc.
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.
popoverComposition | The (sub)composition containing the port. |
popoverCompositionIdentifier | The identifier of the (sub)composition containing the port. |
portID | The port whose popover is to be updated. |
This function may only be called on dispatch queue runCompositionQueue
.
Definition at line 7446 of file VuoEditorComposition.cc.
|
slot |
Checks the composition, along with the cable being dragged (if any), for invalid feedback loops.
Updates the rendered compositions's error markings.
targetPort | If 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 4578 of file VuoEditorComposition.cc.
void VuoEditorComposition::updateGenericPortTypes | ( | void | ) |
Gives each group/network of connected generic ports a unique generic type; updates port popovers accordingly.
Definition at line 4565 of file VuoEditorComposition.cc.
|
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 7627 of file VuoEditorComposition.cc.
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 5084 of file VuoEditorComposition.cc.
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 5120 of file VuoEditorComposition.cc.
void VuoEditorComposition::updateNodeImplementationInPlace | ( | VuoRendererNode * | oldNode, |
VuoNode * | newNode | ||
) |
Replaces oldNode with newNode in the composition in response to an updated node class implementation.
Transfers cable and published port connections from oldNode to newNode where port names and data types correspond. Severs the rest.
Transfers constant input port values from oldNode to newNode where port names and data types correspond.
Removes any drawers stranded by the replacement.
Definition at line 446 of file VuoEditorComposition.cc.
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 4540 of file VuoEditorComposition.cc.
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 7411 of file VuoEditorComposition.cc.
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 5138 of file VuoEditorComposition.cc.
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 4527 of file VuoEditorComposition.cc.
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
.
oldCompositionSnapshot | A 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). |
newCompositionSnapshot | A snapshot of the composition to run. |
diffInfo | Mappings from the old composition to the new composition. This function becomes responsible for destroying it. |
dependenciesUninstalled | Module 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 4964 of file VuoEditorComposition.cc.
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 7885 of file VuoEditorComposition.cc.
|
static |
The search range used in locating composition components near the cursor.
Definition at line 51 of file VuoEditorComposition.hh.