Enzo
Loading...
Searching...
No Matches
Parameter.h
1#pragma once
2#include "Engine/Parameter/Template.h"
3#include "Engine/Types.h"
4#include <boost/signals2.hpp>
5#include <variant>
6
7namespace enzo::prm {
8
9using PrmValues =
10 std::variant<std::vector<bt::floatT>, std::vector<bt::intT>, std::vector<bt::String>>;
11
12class Parameter {
13 public:
14 Parameter(Template prmTemplate, enzo::nt::OpId opId);
15 std::string getName() const;
16 std::string getLabel() const;
17 enzo::nt::OpId getOpId() const { return opId_; }
18 enzo::prm::Type getType() const;
19 unsigned int getVectorSize() const;
20
21 bt::floatT evalFloat(unsigned int index = 0) const;
22 bt::String evalString(unsigned int index = 0) const;
23 bt::intT evalInt(unsigned int index = 0) const;
24
25 void setInt(bt::intT value, unsigned int index = 0);
26 void setFloat(bt::floatT value, unsigned int index = 0);
27 void setString(bt::String value, unsigned int index = 0);
28
29 PrmValues getValues() const;
30 void setValues(const PrmValues &values);
31
32 const Template &getTemplate();
33
34 boost::signals2::signal<void()> valueChanged;
35
36 private:
37 void addUndo_(enzo::prm::PrmValues before);
38 void handleValueChange_();
39
40 Template template_;
41 PrmValues values_;
42 enzo::nt::OpId opId_;
43};
44} // namespace enzo::prm
Basic attribute, parameter, and node types for Enzo.
uint64_t OpId
The unique ID assigned to each node in the network.
Definition Types.h:87
Definition Parameter.h:12
Definition Template.h:11