Enzo
Loading...
Searching...
No Matches
GeometryOpDef.h
1#pragma once
2#include "Engine/Operator/NodePacket.h"
3#include "Engine/Operator/Context.h"
4#include "Engine/Types.h"
5#include <boost/config.hpp>
6#include <memory>
7#include <vector>
8#include "Engine/Operator/OpInfo.h"
9
10
11// forward declaration
12namespace enzo::nt {class NetworkManager;}
13
14namespace enzo::nt
15{
16class NetworkManager;
17
33class BOOST_SYMBOL_EXPORT GeometryOpDef
34{
35public:
40 virtual ~GeometryOpDef() {};
41
49 virtual void cookOp(op::Context context) = 0;
50
59 std::shared_ptr<const enzo::NodePacket> getOutputPacket(unsigned outputIndex);
60
65 void throwError(std::string error);
66
68 unsigned int getMinInputs() const;
70 unsigned int getMaxInputs() const;
72 unsigned int getMaxOutputs() const;
73private:
74 std::vector<std::shared_ptr<const enzo::NodePacket>> outputPackets_;
75
76protected:
77 const op::OpInfo opInfo_;
78 nt::NetworkManager* network_;
79 bool outputRequested(unsigned int outputIndex);
80 // TODO: std::move geometry instead of copying
81 void setOutputPacket(unsigned int outputIndex, enzo::NodePacket packet);
82};
83
84using opConstructor = GeometryOpDef* (*)(enzo::nt::NetworkManager* network, enzo::op::OpInfo opInfo);
85
86}
Basic attribute, parameter, and node types for Enzo.
Definition NodePacket.h:8
Abstract class used to create new operators.
Definition GeometryOpDef.h:34
virtual void cookOp(op::Context context)=0
This function is called at runtime to create the output geometry.
The central coordinator of the engine's node system.
Definition NetworkManager.h:27
Provides network context for the cookOp function.
Definition Context.h:20
Definition OpInfo.h:20