![]() |
Enzo
|
Abstract class used to create new operators. More...
#include <GeometryOpDef.h>
Public Member Functions | |
GeometryOpDef (nt::NetworkManager *network, op::OpInfo opInfo) | |
Sets up internal state. | |
virtual void | cookOp (op::Context context)=0 |
This function is called at runtime to create the output geometry. | |
geo::Geometry & | getOutputGeo (unsigned outputIndex) |
Returns the current output geometry. | |
void | throwError (std::string error) |
Stops the cook and displays an error. Use inside the cookOp function. | |
unsigned int | getMinInputs () const |
Returns the minimum number of input connections required for the node to function. Set by op::OpInfo when registering the operator. | |
unsigned int | getMaxInputs () const |
Returns the maximum number of input connections accepted by the node. Set by op::OpInfo when registering the operator. | |
unsigned int | getMaxOutputs () const |
Returns the number of available outputs the node provides. Set by op::OpInfo when registering the operator. | |
Protected Member Functions | |
bool | outputRequested (unsigned int outputIndex) |
void | setOutputGeometry (unsigned int outputIndex, enzo::geo::Geometry geometry) |
Protected Attributes | |
const op::OpInfo | opInfo_ |
nt::NetworkManager * | network_ |
Abstract class used to create new operators.
The operator definition is a base class from which new geometry operators are inherited from. It provides and abstracted interface, to read and write data about itself and the context it is being computed.
The class exposes utility functions for setting outputs and reading information about itself like the number of inputs.
The most important part of this node is the virtual cookOp member function. This must be overridden to implement the node's logic when being cooked. When a node is cooked it takes the optional input geometry from the context class and outputs new geometry based on the purpose of that operator.
|
pure virtual |
This function is called at runtime to create the output geometry.
enzo::geo::Geometry & enzo::nt::GeometryOpDef::getOutputGeo | ( | unsigned | outputIndex | ) |
Returns the current output geometry.
For use by the runtime Node Does not force a cook.
void enzo::nt::GeometryOpDef::throwError | ( | std::string | error | ) |