2#include "Engine/Operator/GeometryConnection.h"
3#include "Engine/Operator/OpInfo.h"
4#include "Engine/Operator/GeometryOpDef.h"
5#include "Engine/Operator/NodePacket.h"
6#include "Engine/Parameter/Parameter.h"
13std::weak_ptr<GeometryConnection> connectOperators(
enzo::nt::OpId inputOpId,
unsigned int inputIndex,
enzo::nt::OpId outputOpId,
unsigned int outputIndex);
49 std::shared_ptr<const enzo::NodePacket>
getOutputPacket(
unsigned int outputIndex)
const;
117 std::weak_ptr<prm::Parameter>
getParameter(std::string parameterName);
141 void dirtyNode(
bool dirtyDescendents=
true);
164 void initParameters();
167 std::vector<std::shared_ptr<nt::GeometryConnection>> inputConnections_;
168 std::vector<std::shared_ptr<nt::GeometryConnection>> outputConnections_;
169 std::vector<std::shared_ptr<prm::Parameter>> parameters_;
170 std::unique_ptr<enzo::nt::GeometryOpDef> opDef_;
173 bt::Vector2f position_{0.f, 0.f};
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
Directional edges to connect nodes.
Definition GeometryConnection.h:27
The unique runtime representation of a node.
Definition GeometryOperator.h:20
void addInputConnection(std::shared_ptr< nt::GeometryConnection > connection)
Adds a GeometryConnection to one of the inputs. Replacing old connections if needed.
Definition GeometryOperator.cpp:92
std::string getLabel()
NOT YET IMPLEMENTED. Returns the runtime label given to this node as a unique identifier within it's ...
Definition GeometryOperator.cpp:185
std::shared_ptr< const enzo::NodePacket > getOutputPacket(unsigned int outputIndex) const
Returns the current output geometry.
Definition GeometryOperator.cpp:87
boost::signals2::signal< void(nt::OpId opId, bool dirtyDescendents)> nodeDirtied
A signal emitted when the node is dirtied. This will usually notify the NetworkManager.
Definition GeometryOperator.h:161
unsigned int getMaxInputs() const
Returns the maximum number of input connections accepted by the node.
Definition GeometryOperator.cpp:235
std::vector< std::weak_ptr< GeometryConnection > > getInputConnections() const
Returns a vector containing weak pointers for all input connections.
Definition GeometryOperator.cpp:176
unsigned int getMaxOutputs() const
Returns the number of available outputs the node provides.
Definition GeometryOperator.cpp:239
unsigned int getMinInputs() const
Returns the minimum number of input connections required for the node to function....
Definition GeometryOperator.cpp:243
bool isDirty()
Returns true if the node is dirty and false if the node is clean (does not need cooking).
Definition GeometryOperator.cpp:71
void addOutputConnection(std::shared_ptr< nt::GeometryConnection > connection)
Adds a GeometryConnection to one of the outputs. Replacing old connections if needed.
Definition GeometryOperator.cpp:117
void removeInputConnection(unsigned int inputIndex)
Removes an input from the node's container.
Definition GeometryOperator.cpp:125
void removeOutputConnection(const nt::GeometryConnection *connection)
Removes an output from the node's container.
Definition GeometryOperator.cpp:141
void cookOp(op::Context context)
Computes the output geometry based on the cookOp definition in nt::GeometryOpDef. This is set by the ...
Definition GeometryOperator.cpp:77
void setPosition(bt::Vector2f pos)
Sets the node's position in the network graph.
Definition GeometryOperator.h:158
void dirtyNode(bool dirtyDescendents=true)
Marks the outputed geometry as outdated and notifies the network.
Definition GeometryOperator.cpp:64
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
GeometryOperator(const GeometryOperator &)=delete
Deleted copy constructor to avoid accidental copies.
std::vector< std::weak_ptr< GeometryConnection > > getOutputConnections() const
Returns a vector containing weak pointers for all output connections.
Definition GeometryOperator.cpp:191
GeometryOperator & operator=(const GeometryOperator &)=delete
Deleted copy assignment operator to avoid accidental copies.
GeometryOperator(enzo::nt::OpId opId, op::OpInfo opInfo)
Constructs a new node.
Definition GeometryOperator.cpp:43
std::weak_ptr< GeometryConnection > getInputConnection(size_t index) const
Returns an optional connection from a specific input index.
Definition GeometryOperator.cpp:202
std::vector< std::weak_ptr< prm::Parameter > > getParameters()
Returns all parameters belonging to this node.
Definition GeometryOperator.cpp:180
Provides network context for the cookOp function.
Definition Context.h:20