3#include "Engine/UndoRedo/UndoCommand.h"
4#include "Engine/Network/NetworkManager.h"
5#include "Engine/Operator/OperatorTable.h"
18 prm::PrmValues values;
29 savedParms_ = std::vector<SavedParameter>();
32 if(
auto prm = weakPrm.lock())
34 savedParms_.push_back({prm->getName(), prm->getValues()});
42 auto opInfo = op::OperatorTable::getOpInfo(typeName_);
48 nm().
moveNode(opId_, position_,
true);
51 for(
const auto& saved : savedParms_)
55 prm->setValues(saved.values);
65 UndoCommandType type()
const override {
return UndoCommandType::DeleteNode; }
69 std::string typeName_;
70 bt::Vector2f position_;
71 std::vector<SavedParameter> savedParms_;
Basic attribute, parameter, and node types for Enzo.
uint64_t OpId
The unique ID assigned to each node in the network.
Definition Types.h:87
Definition DeleteNodeCommand.h:13
The unique runtime representation of a node.
Definition GeometryOperator.h:20
std::weak_ptr< prm::Parameter > getParameter(std::string parameterName)
Returns a parameter with the given name belonging to this node.
Definition GeometryOperator.cpp:163
std::string getTypeName()
Returns the name belonging to this type of node (eg. grid or transform). Not to be confused with the ...
Definition GeometryOperator.cpp:196
bt::Vector2f getPosition() const
Returns the node's position in the network graph.
Definition GeometryOperator.h:156
std::vector< std::weak_ptr< prm::Parameter > > getParameters()
Returns all parameters belonging to this node.
Definition GeometryOperator.cpp:180
void restoreOperator(OpId opId, op::OpInfo opInfo)
Restores a previously removed operator with a specific OpId.
Definition NetworkManager.cpp:69
void removeOperator(OpId opId)
Removes an operator and all its connections from the network.
Definition NetworkManager.cpp:84
GeometryOperator & getGeoOperator(nt::OpId opId)
Returns a reference to the GeometryOperator with the given OpId.
Definition NetworkManager.cpp:140
void moveNode(OpId opId, bt::Vector2f newPos, bool skipUndo=false)
Moves a node to a new position, pushing an undo command.
Definition NetworkManager.cpp:45
Definition UndoCommand.h:8