Helper functions for undoable actions.
Definition at line 26 of file VuoCommandCommon.hh.
Public Member Functions | |
VuoCommandCommon (VuoEditorWindow *window) | |
Creates a new undoable command. More... | |
~VuoCommandCommon () | |
Destructor. More... | |
void | setDescription (const char *formatString,...) __attribute__((format(printf |
Formats and stores a description, to be shown by VuoCommandCommon_redo and VuoCommandCommon_undo. More... | |
Static Public Member Functions | |
static void | addCable (VuoRendererCable *rc, VuoPort *fromPortAfterAdding, VuoPort *toPortAfterAdding, VuoEditorComposition *composition) |
Helper function for VuoCommandAdd::redo() and VuoCommandRemove::undo(). More... | |
static void | removeCable (VuoRendererCable *rc, VuoEditorComposition *composition) |
Helper function for VuoCommandRemove::redo() and VuoCommandAdd::undo(). More... | |
static void | updateCable (VuoRendererCable *rc, VuoPort *updatedFromPort, VuoPort *updatedToPort, VuoEditorComposition *composition, bool preserveDanglingCables=false) |
Helper function for VuoCommandConnect::redo(), VuoCommandConnect::undo(), VuoCommandRemove::redo(), and VuoCommandRemove::undo(). More... | |
static VuoPublishedPort * | publishInternalPort (VuoPort *internalPort, bool forceEventOnlyPublication, string publishedPortName, VuoEditorComposition *composition, bool attemptMerge) |
Publishes the internalPort under externally visible name publishedPortName , or under a derived name if an externally visible published port with that name already exists and attemptMerge is set to false. More... | |
static VuoPublishedPort * | publishInternalExternalPortCombination (VuoPort *internalPort, VuoPublishedPort *externalPort, bool forceEventOnlyPublication, VuoEditorComposition *composition) |
Publishes the internalPort in association with pre-existing externally visible published port externalPort , if possible. More... | |
static void | unpublishInternalExternalPortCombination (VuoPort *internalPort, VuoPublishedPort *externalPort, VuoEditorComposition *composition, bool unpublishIsolatedExternalPorts) |
Unpublishes the given internalPort in association with externally visible published port externalPort . More... | |
static VuoCompilerCompositionDiff * | addNodeReplacementToDiff (VuoCompilerCompositionDiff *diffInfo, VuoRendererNode *oldNode, VuoRendererNode *newNode, map< VuoPort *, VuoPort * > updatedPortForOriginalPort, VuoEditorComposition *composition) |
Adds information about a single node replacement and associated port mappings to a VuoCompositionDiff. More... | |
Protected Attributes | |
VuoEditorWindow * | window |
The window this command occurred in. More... | |
char * | description |
See setDescription. More... | |
VuoCommandCommon::VuoCommandCommon | ( | VuoEditorWindow * | window | ) |
Creates a new undoable command.
Definition at line 256 of file VuoCommandCommon.cc.
VuoCommandCommon::~VuoCommandCommon | ( | ) |
Destructor.
Definition at line 265 of file VuoCommandCommon.cc.
|
static |
Helper function for VuoCommandAdd::redo() and VuoCommandRemove::undo().
Adds a cable to the canvas.
Definition at line 28 of file VuoCommandCommon.cc.
|
static |
Adds information about a single node replacement and associated port mappings to a VuoCompositionDiff.
Used for live-coding updates, since some information can't be inferred from the composition snapshot:
Calculate
nodes, the mapping from old to new ports on the Make List
node that holds the variable values. Definition at line 221 of file VuoCommandCommon.cc.
|
static |
Publishes the internalPort
in association with pre-existing externally visible published port externalPort
, if possible.
If impossible (due, e.g., to conflicting types), publishes the internal port under a new name.
Definition at line 161 of file VuoCommandCommon.cc.
|
static |
Publishes the internalPort
under externally visible name publishedPortName
, or under a derived name if an externally visible published port with that name already exists and attemptMerge
is set to false.
internalPort | The port to publish. |
forceEventOnlyPublication | A boolean indicating whether the cable connecting the internal and external ports should be event-only regardless of whether the ports themselves carry data. |
publishedPortName | The externally-visible name to give the new published port. |
composition | The composition in which to publish the port. |
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. |
Definition at line 137 of file VuoCommandCommon.cc.
|
static |
Helper function for VuoCommandRemove::redo() and VuoCommandAdd::undo().
Removes a cable from the canvas.
Definition at line 57 of file VuoCommandCommon.cc.
void VuoCommandCommon::setDescription | ( | const char * | formatString, |
... | |||
) |
Formats and stores a description, to be shown by VuoCommandCommon_redo and VuoCommandCommon_undo.
Definition at line 273 of file VuoCommandCommon.cc.
|
static |
Unpublishes the given internalPort
in association with externally visible published port externalPort
.
If this leaves the external published port without connected internal ports and unpublishIsolatedExternalPorts
is true, the external port is unpublished as well.
Definition at line 182 of file VuoCommandCommon.cc.
|
static |
Helper function for VuoCommandConnect::redo(), VuoCommandConnect::undo(), VuoCommandRemove::redo(), and VuoCommandRemove::undo().
Connects the input cable rc
to the 'From' and 'To' ports specified in the input maps fromPortForCable
and toPortForCable
, respectively.
Note: This function should be called after any calls to addNode() or removeNode() that might affect the cable's endpoints, to ensure that the cable is added to or removed from the composition as appropriate.
Definition at line 75 of file VuoCommandCommon.cc.
|
static |
ID for VuoCommandAdd.
Definition at line 30 of file VuoCommandCommon.hh.
|
static |
ID for VuoCommandAddPublishedPort.
Definition at line 43 of file VuoCommandCommon.hh.
|
static |
ID for VuoCommandChangeNode.
Definition at line 49 of file VuoCommandCommon.hh.
|
static |
ID for VuoCommandConnect.
Definition at line 32 of file VuoCommandCommon.hh.
|
protected |
See setDescription.
Definition at line 66 of file VuoCommandCommon.hh.
|
static |
ID for VuoCommandMove.
Definition at line 29 of file VuoCommandCommon.hh.
|
static |
ID for VuoCommandPublishPort.
Definition at line 36 of file VuoCommandCommon.hh.
|
static |
ID for VuoCommandRemove.
Definition at line 31 of file VuoCommandCommon.hh.
|
static |
ID for VuoCommandRemoveProtocolPort.
Definition at line 44 of file VuoCommandCommon.hh.
|
static |
ID for VuoCommandReorderPublishedPorts.
Definition at line 45 of file VuoCommandCommon.hh.
|
static |
ID for VuoCommandReplaceNode.
Definition at line 39 of file VuoCommandCommon.hh.
|
static |
ID for VuoCommandResizeComment.
Definition at line 48 of file VuoCommandCommon.hh.
|
static |
ID for VuoCommandSetCableHidden.
Definition at line 42 of file VuoCommandCommon.hh.
|
static |
ID for VuoCommandSetCommentText.
Definition at line 47 of file VuoCommandCommon.hh.
|
static |
ID for VuoCommandSetItemTint.
Definition at line 38 of file VuoCommandCommon.hh.
|
static |
ID for VuoCommandSetMetadata.
Definition at line 46 of file VuoCommandCommon.hh.
|
static |
ID for VuoCommandSetNodeTitle.
Definition at line 34 of file VuoCommandCommon.hh.
|
static |
ID for VuoCommandSetPortConstant.
Definition at line 33 of file VuoCommandCommon.hh.
|
static |
ID for VuoCommandSetPublishedPortDetails.
Definition at line 41 of file VuoCommandCommon.hh.
|
static |
ID for VuoCommandSetPublishedPortName.
Definition at line 35 of file VuoCommandCommon.hh.
|
static |
ID for VuoCommandSetTriggerThrottling.
Definition at line 40 of file VuoCommandCommon.hh.
|
static |
ID for VuoCommandUnpublishPort.
Definition at line 37 of file VuoCommandCommon.hh.
|
protected |
The window this command occurred in.
Definition at line 65 of file VuoCommandCommon.hh.