Vuo  2.3.2
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
VuoCommandCommon Class Reference

Description

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 VuoPublishedPortpublishInternalPort (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 VuoPublishedPortpublishInternalExternalPortCombination (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 VuoCompilerCompositionDiffaddNodeReplacementToDiff (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...
 

Static Public Attributes

static const int moveCommandID = 1
 ID for VuoCommandMove. More...
 
static const int addCommandID = 2
 ID for VuoCommandAdd. More...
 
static const int removeCommandID = 3
 ID for VuoCommandRemove. More...
 
static const int connectCommandID = 4
 ID for VuoCommandConnect. More...
 
static const int setPortConstantCommandID = 5
 ID for VuoCommandSetPortConstant. More...
 
static const int setNodeTitleCommandID = 6
 ID for VuoCommandSetNodeTitle. More...
 
static const int setPublishedPortNameCommandID = 7
 ID for VuoCommandSetPublishedPortName. More...
 
static const int publishPortCommandID = 8
 ID for VuoCommandPublishPort. More...
 
static const int unpublishPortCommandID = 9
 ID for VuoCommandUnpublishPort. More...
 
static const int setItemTintCommandID = 10
 ID for VuoCommandSetItemTint. More...
 
static const int replaceNodeCommandID = 11
 ID for VuoCommandReplaceNode. More...
 
static const int setTriggerThrottlingCommandID = 12
 ID for VuoCommandSetTriggerThrottling. More...
 
static const int setPublishedPortDetailsCommandID = 13
 ID for VuoCommandSetPublishedPortDetails. More...
 
static const int setCableHiddenCommandID = 14
 ID for VuoCommandSetCableHidden. More...
 
static const int addPublishedPortCommandID = 15
 ID for VuoCommandAddPublishedPort. More...
 
static const int removeProtocolPortCommandID = 16
 ID for VuoCommandRemoveProtocolPort. More...
 
static const int reorderPublishedPortsCommandID = 17
 ID for VuoCommandReorderPublishedPorts. More...
 
static const int setMetadataCommandID = 18
 ID for VuoCommandSetMetadata. More...
 
static const int setCommentTextCommandID = 19
 ID for VuoCommandSetCommentText. More...
 
static const int resizeCommentCommandID = 20
 ID for VuoCommandResizeComment. More...
 
static const int changeNodeCommandID = 21
 ID for VuoCommandChangeNode. More...
 

Protected Attributes

VuoEditorWindowwindow
 The window this command occurred in. More...
 
char * description
 See setDescription. More...
 

Constructor & Destructor Documentation

◆ VuoCommandCommon()

VuoCommandCommon::VuoCommandCommon ( VuoEditorWindow window)

Creates a new undoable command.

Definition at line 256 of file VuoCommandCommon.cc.

◆ ~VuoCommandCommon()

VuoCommandCommon::~VuoCommandCommon ( )

Destructor.

Definition at line 265 of file VuoCommandCommon.cc.

Member Function Documentation

◆ addCable()

void VuoCommandCommon::addCable ( VuoRendererCable rc,
VuoPort fromPortAfterAdding,
VuoPort toPortAfterAdding,
VuoEditorComposition composition 
)
static

Helper function for VuoCommandAdd::redo() and VuoCommandRemove::undo().

Adds a cable to the canvas.

Definition at line 28 of file VuoCommandCommon.cc.

◆ addNodeReplacementToDiff()

VuoCompilerCompositionDiff * VuoCommandCommon::addNodeReplacementToDiff ( VuoCompilerCompositionDiff diffInfo,
VuoRendererNode oldNode,
VuoRendererNode newNode,
map< VuoPort *, VuoPort * >  updatedPortForOriginalPort,
VuoEditorComposition composition 
)
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:

  • the fact that a node was replaced if its node class hasn't changed;
  • for 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.

◆ publishInternalExternalPortCombination()

VuoPublishedPort * VuoCommandCommon::publishInternalExternalPortCombination ( VuoPort internalPort,
VuoPublishedPort externalPort,
bool  forceEventOnlyPublication,
VuoEditorComposition composition 
)
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.

Returns
A pointer to the resulting externally visible VuoPublishedPort object.

Definition at line 161 of file VuoCommandCommon.cc.

◆ publishInternalPort()

VuoPublishedPort * VuoCommandCommon::publishInternalPort ( VuoPort internalPort,
bool  forceEventOnlyPublication,
string  publishedPortName,
VuoEditorComposition composition,
bool  attemptMerge 
)
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.

Parameters
internalPortThe port to publish.
forceEventOnlyPublicationA boolean indicating whether the cable connecting the internal and external ports should be event-only regardless of whether the ports themselves carry data.
publishedPortNameThe externally-visible name to give the new published port.
compositionThe composition in which to publish the port.
attemptMergeA boolean indicating whether the port should be published in association with a pre-existing (rather than a newly created) external published port of the given name, if possible.
Returns
A pointer to the resulting externally visible VuoPublishedPort object.

Definition at line 137 of file VuoCommandCommon.cc.

◆ removeCable()

void VuoCommandCommon::removeCable ( VuoRendererCable rc,
VuoEditorComposition composition 
)
static

Helper function for VuoCommandRemove::redo() and VuoCommandAdd::undo().

Removes a cable from the canvas.

Definition at line 57 of file VuoCommandCommon.cc.

◆ setDescription()

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.

◆ unpublishInternalExternalPortCombination()

void VuoCommandCommon::unpublishInternalExternalPortCombination ( VuoPort internalPort,
VuoPublishedPort externalPort,
VuoEditorComposition composition,
bool  unpublishIsolatedExternalPorts 
)
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.

◆ updateCable()

void VuoCommandCommon::updateCable ( VuoRendererCable rc,
VuoPort updatedFromPort,
VuoPort updatedToPort,
VuoEditorComposition composition,
bool  preserveDanglingCables = false 
)
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.

Member Data Documentation

◆ addCommandID

const int VuoCommandCommon::addCommandID = 2
static

ID for VuoCommandAdd.

Definition at line 30 of file VuoCommandCommon.hh.

◆ addPublishedPortCommandID

const int VuoCommandCommon::addPublishedPortCommandID = 15
static

ID for VuoCommandAddPublishedPort.

Definition at line 43 of file VuoCommandCommon.hh.

◆ changeNodeCommandID

const int VuoCommandCommon::changeNodeCommandID = 21
static

ID for VuoCommandChangeNode.

Definition at line 49 of file VuoCommandCommon.hh.

◆ connectCommandID

const int VuoCommandCommon::connectCommandID = 4
static

ID for VuoCommandConnect.

Definition at line 32 of file VuoCommandCommon.hh.

◆ description

char* VuoCommandCommon::description
protected

See setDescription.

Definition at line 66 of file VuoCommandCommon.hh.

◆ moveCommandID

const int VuoCommandCommon::moveCommandID = 1
static

ID for VuoCommandMove.

Definition at line 29 of file VuoCommandCommon.hh.

◆ publishPortCommandID

const int VuoCommandCommon::publishPortCommandID = 8
static

ID for VuoCommandPublishPort.

Definition at line 36 of file VuoCommandCommon.hh.

◆ removeCommandID

const int VuoCommandCommon::removeCommandID = 3
static

ID for VuoCommandRemove.

Definition at line 31 of file VuoCommandCommon.hh.

◆ removeProtocolPortCommandID

const int VuoCommandCommon::removeProtocolPortCommandID = 16
static

ID for VuoCommandRemoveProtocolPort.

Definition at line 44 of file VuoCommandCommon.hh.

◆ reorderPublishedPortsCommandID

const int VuoCommandCommon::reorderPublishedPortsCommandID = 17
static

ID for VuoCommandReorderPublishedPorts.

Definition at line 45 of file VuoCommandCommon.hh.

◆ replaceNodeCommandID

const int VuoCommandCommon::replaceNodeCommandID = 11
static

ID for VuoCommandReplaceNode.

Definition at line 39 of file VuoCommandCommon.hh.

◆ resizeCommentCommandID

const int VuoCommandCommon::resizeCommentCommandID = 20
static

ID for VuoCommandResizeComment.

Definition at line 48 of file VuoCommandCommon.hh.

◆ setCableHiddenCommandID

const int VuoCommandCommon::setCableHiddenCommandID = 14
static

ID for VuoCommandSetCableHidden.

Definition at line 42 of file VuoCommandCommon.hh.

◆ setCommentTextCommandID

const int VuoCommandCommon::setCommentTextCommandID = 19
static

ID for VuoCommandSetCommentText.

Definition at line 47 of file VuoCommandCommon.hh.

◆ setItemTintCommandID

const int VuoCommandCommon::setItemTintCommandID = 10
static

ID for VuoCommandSetItemTint.

Definition at line 38 of file VuoCommandCommon.hh.

◆ setMetadataCommandID

const int VuoCommandCommon::setMetadataCommandID = 18
static

ID for VuoCommandSetMetadata.

Definition at line 46 of file VuoCommandCommon.hh.

◆ setNodeTitleCommandID

const int VuoCommandCommon::setNodeTitleCommandID = 6
static

ID for VuoCommandSetNodeTitle.

Definition at line 34 of file VuoCommandCommon.hh.

◆ setPortConstantCommandID

const int VuoCommandCommon::setPortConstantCommandID = 5
static

ID for VuoCommandSetPortConstant.

Definition at line 33 of file VuoCommandCommon.hh.

◆ setPublishedPortDetailsCommandID

const int VuoCommandCommon::setPublishedPortDetailsCommandID = 13
static

ID for VuoCommandSetPublishedPortDetails.

Definition at line 41 of file VuoCommandCommon.hh.

◆ setPublishedPortNameCommandID

const int VuoCommandCommon::setPublishedPortNameCommandID = 7
static

ID for VuoCommandSetPublishedPortName.

Definition at line 35 of file VuoCommandCommon.hh.

◆ setTriggerThrottlingCommandID

const int VuoCommandCommon::setTriggerThrottlingCommandID = 12
static

ID for VuoCommandSetTriggerThrottling.

Definition at line 40 of file VuoCommandCommon.hh.

◆ unpublishPortCommandID

const int VuoCommandCommon::unpublishPortCommandID = 9
static

ID for VuoCommandUnpublishPort.

Definition at line 37 of file VuoCommandCommon.hh.

◆ window

VuoEditorWindow* VuoCommandCommon::window
protected

The window this command occurred in.

Definition at line 65 of file VuoCommandCommon.hh.


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