Vuo  2.3.2
Classes | Public Member Functions | List of all members
VuoCommandReplaceNode Class Reference

Description

An undoable action for replacing a set of nodes with a provided set of replacements.

Definition at line 24 of file VuoCommandReplaceNode.hh.

Public Member Functions

 VuoCommandReplaceNode (VuoRendererNode *oldNode, VuoRendererNode *newNode, VuoEditorWindow *window, string commandDescription, bool preserveDanglingCables=false, bool resetConstantValues=false)
 Creates a command for replacing a set of nodes within a composition. More...
 
 VuoCommandReplaceNode (map< VuoRendererNode *, VuoRendererNode * > newNodeForOldNode, VuoEditorWindow *window, string commandDescription, bool preserveDanglingCables=false, bool resetConstantValues=false)
 Creates a command for replacing a set of nodes within a composition. More...
 
int id () const
 Returns the ID of this command. More...
 
void undo ()
 Restores the original nodes and their connected cables. More...
 
void redo ()
 Replaces the set of oldNodes with their newNode equivalents, re-wiring any connected cables to connect to ports of the same name belonging to the new node. More...
 
- Public Member Functions inherited from VuoCommandCommon
 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...
 

Additional Inherited Members

- Static Public Member Functions inherited from VuoCommandCommon
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 inherited from VuoCommandCommon
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 inherited from VuoCommandCommon
VuoEditorWindowwindow
 The window this command occurred in. More...
 
char * description
 See setDescription. More...
 

Constructor & Destructor Documentation

◆ VuoCommandReplaceNode() [1/2]

VuoCommandReplaceNode::VuoCommandReplaceNode ( VuoRendererNode oldNode,
VuoRendererNode newNode,
VuoEditorWindow window,
string  commandDescription,
bool  preserveDanglingCables = false,
bool  resetConstantValues = false 
)

Creates a command for replacing a set of nodes within a composition.

Definition at line 30 of file VuoCommandReplaceNode.cc.

◆ VuoCommandReplaceNode() [2/2]

VuoCommandReplaceNode::VuoCommandReplaceNode ( map< VuoRendererNode *, VuoRendererNode * >  newNodeForOldNode,
VuoEditorWindow window,
string  commandDescription,
bool  preserveDanglingCables = false,
bool  resetConstantValues = false 
)

Creates a command for replacing a set of nodes within a composition.

Definition at line 43 of file VuoCommandReplaceNode.cc.

Member Function Documentation

◆ id()

int VuoCommandReplaceNode::id ( ) const

Returns the ID of this command.

Definition at line 125 of file VuoCommandReplaceNode.cc.

◆ redo()

void VuoCommandReplaceNode::redo ( )

Replaces the set of oldNodes with their newNode equivalents, re-wiring any connected cables to connect to ports of the same name belonging to the new node.

Definition at line 134 of file VuoCommandReplaceNode.cc.

◆ undo()

void VuoCommandReplaceNode::undo ( )

Restores the original nodes and their connected cables.

Definition at line 150 of file VuoCommandReplaceNode.cc.


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