Editor API
UnigineEditor public API
Editor::EnableNodeAction Class Reference

This class is used to represent any user's action changing node's enabled state. More...

#include <Actions.h>

Inheritance diagram for Editor::EnableNodeAction:
Editor::Action

Public Member Functions

 EnableNodeAction (const Unigine::NodePtr &node, bool enabled)
 Creates a new enable node action for the specified node. More...
 
 EnableNodeAction (const Unigine::Vector< Unigine::NodePtr > &nodes, bool enabled)
 Creates a new enable action for the specified nodes. More...
 
void apply () override
 Applies the enable node action. More...
 
void undo () override
 Reverts the enable node action. More...
 
void redo () override
 Redoes the previously undone enable node action (reverses the undo method). More...
 
bool validate () override
 This method allows action to do some internal cleanup. Return value indicates whether the action is still sane. Whenever it returns false undo system will delete invalid action for good. More...
 
- Public Member Functions inherited from Editor::Action
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 node's enabled state.

Constructor & Destructor Documentation

◆ EnableNodeAction() [1/2]

Editor::EnableNodeAction::EnableNodeAction ( const Unigine::NodePtr &  node,
bool  enabled 
)
explicit

Creates a new enable node action for the specified node.

Parameters
nodeNode affected by the action.
enabledtrue if the action enables the specified node; otherwise, false.

◆ EnableNodeAction() [2/2]

Editor::EnableNodeAction::EnableNodeAction ( const Unigine::Vector< Unigine::NodePtr > &  nodes,
bool  enabled 
)

Creates a new enable action for the specified nodes.

Parameters
nodesNodes affected by the action.
enabledtrue if the action enables the specified nodes; otherwise, false.

Member Function Documentation

◆ apply()

void Editor::EnableNodeAction::apply ( )
overridevirtual

Applies the enable node action.

Implements Editor::Action.

◆ redo()

void Editor::EnableNodeAction::redo ( )
overridevirtual

Redoes the previously undone enable node action (reverses the undo method).

Implements Editor::Action.

◆ undo()

void Editor::EnableNodeAction::undo ( )
overridevirtual

Reverts the enable node action.

Implements Editor::Action.

◆ validate()

bool Editor::EnableNodeAction::validate ( )
overridevirtual

This method allows action to do some internal cleanup. Return value indicates whether the action is still sane. Whenever it returns false undo system will delete invalid action for good.

Reimplemented from Editor::Action.