Enzo
Loading...
Searching...
No Matches
CookContext.h
1#pragma once
2
3#include "Engine/Core/Types.h"
4#include "Engine/Network/NodePacket.h"
5
6namespace enzo::nt {
7class NetworkManager;
8}
9
10namespace enzo::prm {
11class Ramp;
12}
13
14namespace enzo::nt {
23{
24 public:
26 enzo::NodePacket cloneInputPacket(unsigned int inputIndex);
27 bool hasInput(unsigned int inputIndex);
28 unsigned int getInputCount();
29
32 floatT getFrame() const;
33
35 floatT getTime() const;
36
37 floatT evalParmFloat(std::string_view parmName, const unsigned int index = 0) const;
38 intT evalParmInt(std::string_view parmName, const unsigned int index = 0) const;
39 boolT evalParmBool(std::string_view parmName, const unsigned int index = 0) const;
40 String evalParmString(std::string_view parmName, const unsigned int index = 0) const;
41
42 // Read every value of a parameter as a list. The singular forms above read
43 // one value by index, these read them all at once.
44 std::vector<floatT> evalParmFloats(std::string_view parmName) const;
45 std::vector<intT> evalParmInts(std::string_view parmName) const;
46 std::vector<String> evalParmStrings(std::string_view parmName) const;
47
48 // Read the first two float components of a parameter as a Vector2. Missing
49 // components default to zero.
50 Vector2 evalParmVector2(std::string_view parmName) const;
51
52 // Read the first three float components of a parameter as a Vector3. Missing
53 // components default to zero.
54 Vector3 evalParmVector3(std::string_view parmName) const;
55
56 // Snapshot a ramp parameter into a sampler for use during cook.
57 enzo::prm::Ramp evalParmRamp(std::string_view parmName) const;
58
59 private:
61 void recordTimeDependency_() const;
62
63 enzo::nt::NodeId nodeId_;
64 enzo::nt::NetworkManager& networkManager_;
65};
66} // namespace enzo::nt
Basic attribute, parameter, and node types for Enzo.
uint64_t NodeId
The unique ID assigned to each node in the network.
Definition Types.h:306
Definition NodePacket.h:9
The handle a node holds while it cooks to get context about the network.
Definition CookContext.h:23
floatT getTime() const
Returns the scene time in seconds, measured from the start of frame 1.
Definition CookContext.cpp:44
floatT getFrame() const
Returns the frame the scene sits on.
Definition CookContext.cpp:38
The central coordinator of the engine's node system.
Definition NetworkManager.h:31
A sampled snapshot of a ramp parameter read during cook.
Definition Ramp.h:25