4#include "Engine/Network/GeometryOperator.h"
5#include "Engine/Network/NetworkManager.h"
6#include "Engine/Network/OperatorTable.h"
7#include "Engine/UndoRedo/UndoCommand.h"
19 prm::PrmValues values;
30 savedParms_ = std::vector<SavedParameter>();
33 if (
auto prm = weakPrm.lock())
35 savedParms_.push_back({prm->getName(), prm->getValues()});
43 auto opInfo = op::OperatorTable::getOpInfo(typeName_);
49 nm().
moveNode(opId_, position_,
true);
52 for (
const auto& saved : savedParms_)
56 prm->setValues(saved.values);
63 UndoCommandType type()
const override {
return UndoCommandType::DeleteNode; }
67 std::string typeName_;
69 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:137
Definition DeleteNodeCommand.h:14
The unique runtime representation of a node.
Definition GeometryOperator.h:16
const op::OpInfo & getType() const
Returns the static type definition this node was created from.
Definition GeometryOperator.cpp:163
std::vector< std::weak_ptr< prm::NodeParameter > > getParameters()
Returns all parameters belonging to this node.
Definition GeometryOperator.cpp:151
Vector2 getPosition() const
Returns the node's position in the network graph.
Definition GeometryOperator.h:116
std::weak_ptr< prm::NodeParameter > getParameter(std::string_view parameterName)
Returns a parameter with the given name belonging to this node.
Definition GeometryOperator.cpp:107
void restoreOperator(OpId opId, op::OpInfo opInfo)
Restores a previously removed operator with a specific OpId.
Definition NetworkManager.cpp:74
void removeOperator(OpId opId, bool removeConnections=true)
Removes an operator from the network.
Definition NetworkManager.cpp:87
void moveNode(OpId opId, Vector2 newPos, bool skipUndo=false)
Moves a node to a new position, pushing an undo command.
Definition NetworkManager.cpp:42
GeometryOperator & getGeoOperator(nt::OpId opId)
Returns a reference to the GeometryOperator with the given OpId.
Definition NetworkManager.cpp:141
Definition UndoCommand.h:8
const std::string & getName() const
Returns the internal type name shared by all nodes of this type (eg. "copy_to_points")
Definition OpInfo.h:30