Editor API
UnigineEditor public API
Editor::ReparentNodesAction Class Referencefinal

This class is used to represent any user's action changing nodes parents. More...

#include <Actions.h>

Inheritance diagram for Editor::ReparentNodesAction:
Editor::Action

Public Member Functions

 ReparentNodesAction (const Unigine::Vector< Unigine::NodePtr > &nodes, const Unigine::NodePtr &new_parent, int new_index=-1)
 Creates a new reparent action for the specified nodes. More...
 
 ~ReparentNodesAction () override
 
void apply () override
 Applies the reparent nodes action. More...
 
void undo () override
 Reverts the reparent nodes action. More...
 
void redo () override
 Redoes the previously undone reparent nodes action (reverses the undo method). More...
 
- Public Member Functions inherited from Editor::Action
 Action ()
 
virtual ~Action ()
 
virtual bool validate ()
 This method allows action to do some internal cleanup. Return value indicates whether the action is still sane. Whenever it returns false asset system will delete invalid action for good. More...
 
virtual bool modifiesWorld () const
 Indicates whether the action brings any changes to the scene. Actions like selection, for example, change nothing and shouldn't set world‘s "dirty state". For such actions this method would return 'false’. More...
 

Detailed Description

This class is used to represent any user's action changing nodes parents.

Constructor & Destructor Documentation

◆ ReparentNodesAction()

Editor::ReparentNodesAction::ReparentNodesAction ( const Unigine::Vector< Unigine::NodePtr > &  nodes,
const Unigine::NodePtr &  new_parent,
int  new_index = -1 
)
explicit

Creates a new reparent action for the specified nodes.

Parameters
nodesNodes affected by the reparent action.
new_parentNew parent to be set for the specified nodes.
new_indexIndex of the new parent node's child after which the specified nodes are to be added. The default -1 value adds nodes after the last child.

◆ ~ReparentNodesAction()

Editor::ReparentNodesAction::~ReparentNodesAction ( )
override

Member Function Documentation

◆ apply()

void Editor::ReparentNodesAction::apply ( )
overridevirtual

Applies the reparent nodes action.

Implements Editor::Action.

◆ redo()

void Editor::ReparentNodesAction::redo ( )
overridevirtual

Redoes the previously undone reparent nodes action (reverses the undo method).

Implements Editor::Action.

◆ undo()

void Editor::ReparentNodesAction::undo ( )
overridevirtual

Reverts the reparent nodes action.

Implements Editor::Action.