2#include "Engine/Operator/GeometryConnection.h"
3#include "Engine/Operator/OpInfo.h"
4#include "Engine/Operator/GeometryOpDef.h"
5#include "Engine/Parameter/Parameter.h"
12std::weak_ptr<GeometryConnection> connectOperators(
enzo::nt::OpId inputOpId,
unsigned int inputIndex,
enzo::nt::OpId outputOpId,
unsigned int outputIndex);
109 std::optional<std::reference_wrapper<const GeometryConnection>>
getInputConnection(
size_t index)
const;
116 std::weak_ptr<prm::Parameter>
getParameter(std::string parameterName);
140 void dirtyNode(
bool dirtyDescendents=
true);
158 void initParameters();
161 std::vector<std::shared_ptr<nt::GeometryConnection>> inputConnections_;
162 std::vector<std::shared_ptr<nt::GeometryConnection>> outputConnections_;
163 std::vector<std::shared_ptr<prm::Parameter>> parameters_;
164 std::unique_ptr<enzo::nt::GeometryOpDef> opDef_;
Basic attribute, parameter, and node types for Enzo.
uint64_t OpId
The unique ID assigned to each node in the network.
Definition Types.h:80
Attribute based geometry container exchanged and modified by nodes.
Directional edges to connect nodes.
Definition GeometryConnection.h:27
The unique runtime representation of a node.
Definition GeometryOperator.h:19
void addInputConnection(std::shared_ptr< nt::GeometryConnection > connection)
Adds a GeometryConnection to one of the inputs. Replacing old connections if needed.
Definition GeometryOperator.cpp:79
std::string getLabel()
NOT YET IMPLEMENTED. Returns the runtime label given to this node as a unique identifier within it's ...
Definition GeometryOperator.cpp:167
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:155
unsigned int getMaxInputs() const
Returns the maximum number of input connections accepted by the node.
Definition GeometryOperator.cpp:217
std::vector< std::weak_ptr< const GeometryConnection > > getInputConnections() const
Returns a vector containing weak pointers for all input connections.
Definition GeometryOperator.cpp:158
geo::Geometry & getOutputGeo(unsigned int outputIndex) const
Returns the current output geometry.
Definition GeometryOperator.cpp:74
std::optional< std::reference_wrapper< const GeometryConnection > > getInputConnection(size_t index) const
Returns an optional connection from a specific input index.
Definition GeometryOperator.cpp:184
unsigned int getMaxOutputs() const
Returns the number of available outputs the node provides.
Definition GeometryOperator.cpp:221
unsigned int getMinInputs() const
Returns the minimum number of input connections required for the node to function....
Definition GeometryOperator.cpp:225
bool isDirty()
Returns true if the node is dirty and false if the node is clean (does not need cooking).
Definition GeometryOperator.cpp:61
void addOutputConnection(std::shared_ptr< nt::GeometryConnection > connection)
Adds a GeometryConnection to one of the outputs. Replacing old connections if needed.
Definition GeometryOperator.cpp:103
void removeInputConnection(unsigned int inputIndex)
Removes an input from the node's container.
Definition GeometryOperator.cpp:111
void removeOutputConnection(const nt::GeometryConnection *connection)
Removes an output from the node's container.
Definition GeometryOperator.cpp:127
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:67
std::vector< std::weak_ptr< const GeometryConnection > > getOutputConnections() const
Returns a vector containing weak pointers for all output connections.
Definition GeometryOperator.cpp:173
void dirtyNode(bool dirtyDescendents=true)
Marks the outputed geometry as outdated and notifies the network.
Definition GeometryOperator.cpp:54
std::weak_ptr< prm::Parameter > getParameter(std::string parameterName)
Returns a parameter with the given name belonging to this node.
Definition GeometryOperator.cpp:145
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:178
GeometryOperator(const GeometryOperator &)=delete
Deleted copy constructor to avoid accidental copies.
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:33
std::vector< std::weak_ptr< prm::Parameter > > getParameters()
Returns all parameters belonging to this node.
Definition GeometryOperator.cpp:162
Provides network context for the cookOp function.
Definition Context.h:20