Enzo
Loading...
Searching...
No Matches
GeometryOpDef.h
1#pragma once
2#include "Engine/Core/Types.h"
3#include "Engine/Network/CookContext.h"
4#include "Engine/Network/NodePacket.h"
5#include "Engine/Network/OpInfo.h"
6#include <boost/config.hpp>
7#include <memory>
8#include <vector>
9
10// forward declaration
11namespace enzo::nt {
12class NetworkManager;
13}
14
15namespace enzo::nt {
16class NetworkManager;
17
33class BOOST_SYMBOL_EXPORT GeometryOpDef
34{
35 public:
40 virtual ~GeometryOpDef() {};
41
49 virtual void cookOp(op::CookContext context) = 0;
50
59 std::shared_ptr<const enzo::NodePacket> getOutputPacket(unsigned outputIndex);
60
65 void throwError(std::string error);
66
72 void throwWarning(std::string warning);
73
76 unsigned int getMinInputs() const;
79 unsigned int getMaxInputs() const;
82 unsigned int getMaxOutputs() const;
83
84 private:
85 std::vector<std::shared_ptr<const enzo::NodePacket>> outputPackets_;
86
87 protected:
88 const op::OpInfo opInfo_;
89 nt::NetworkManager* network_;
90 bool outputRequested(unsigned int outputIndex);
91 // TODO: std::move geometry instead of copying
92 void setOutputPacket(unsigned int outputIndex, enzo::NodePacket packet);
93};
94
95using opConstructor = GeometryOpDef* (*)(enzo::nt::NetworkManager * network,
96 enzo::op::OpInfo opInfo);
97
98} // namespace enzo::nt
Basic attribute, parameter, and node types for Enzo.
Definition NodePacket.h:9
Abstract class used to create new operators.
Definition GeometryOpDef.h:34
virtual void cookOp(op::CookContext 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 CookContext.h:24
Definition OpInfo.h:19