Enzo
Loading...
Searching...
No Matches
Style.h
1#pragma once
2
3#include "Engine/Core/Types.h"
4#include "Engine/Parameter/Parameter.h"
5#include "Engine/Parameter/PrmName.h"
6#include "Engine/Parameter/Template.h"
7
8#include <memory>
9#include <string>
10#include <utility>
11#include <vector>
12
13namespace enzo::prm::style {
14
16{
17};
18
20{
21 enum Setting
22 {
23 ICON,
24 SCALE
25 };
26
27 std::vector<std::shared_ptr<prm::Parameter>> settings = {
28 std::make_shared<prm::Parameter>(
29 Template(Type::STRING, Name("iconName", "Icon Name"), Default("eye"))
30 ),
31 std::make_shared<prm::Parameter>(
32 Template(Type::FLOAT, Name("scale", "Scale"), Default(0.95f))
33 ),
34 };
35
36 BoolIcon& setIcon(std::string iconPath)
37 {
38 settings[ICON]->setString(std::move(iconPath));
39 return *this;
40 }
41 BoolIcon& setScale(floatT scale)
42 {
43 settings[SCALE]->setFloat(scale);
44 return *this;
45 }
46
47 String icon() const { return settings[ICON]->evalString(); }
48 floatT scale() const { return settings[SCALE]->evalFloat(); }
49};
50
52{
53 enum Setting
54 {
55 ICON,
56 SCALE
57 };
58
59 std::vector<std::shared_ptr<prm::Parameter>> settings = {
60 std::make_shared<prm::Parameter>(
61 Template(Type::STRING, Name("iconName", "Icon Name"), Default("eye"))
62 ),
63 std::make_shared<prm::Parameter>(
64 Template(Type::FLOAT, Name("scale", "Scale"), Default(0.95f))
65 ),
66 };
67
68 BoolIconSlash& setIcon(std::string iconPath)
69 {
70 settings[ICON]->setString(std::move(iconPath));
71 return *this;
72 }
73 BoolIconSlash& setScale(floatT scale)
74 {
75 settings[SCALE]->setFloat(scale);
76 return *this;
77 }
78
79 String icon() const { return settings[ICON]->evalString(); }
80 floatT scale() const { return settings[SCALE]->evalFloat(); }
81};
82
83} // namespace enzo::prm::style
Basic attribute, parameter, and node types for Enzo.
Definition Default.h:7
Definition PrmName.h:6
Definition Template.h:18
Definition Style.h:52
Definition Style.h:20
Definition Style.h:16