-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnode.hpp
54 lines (46 loc) · 1.08 KB
/
node.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#pragma once
#include <iostream>
#include <vector>
#include <unordered_map>
enum class NodeType
{
add,
multiply,
output,
sine,
time,
value,
power,
cubeviewport,
spherevieport
};
struct Node
{
NodeType type;
float value;
explicit Node(const NodeType t) : type(t), value(0.f) {}
Node(const NodeType t, const float v) : type(t), value(v) {}
/*void compute(Node &node) {
//for (auto& node : nodes) {
if (node.type == NodeType::Operation) {
if (node.name == "Add") {
float a = node.parameters["Input A"];
float b = node.parameters["Input B"];
node.computedOutputs["Result"] = a + b;
}
}
//}
}*/
};
/*
inline std::string NodeTypeToString(NodeType type)
{
switch (type)
{
case NodeType::Parameter: return "Parametr";
case NodeType::Operation: return "Operation";
case NodeType::Output: return "Output";
case NodeType::Texture: return "Texture";
default: return "[Unknown type]";
}
}*/