added bucket options tool

This commit is contained in:
2019-06-22 18:13:55 +02:00
parent 228263c70f
commit 7699f10cfd
9 changed files with 91 additions and 2 deletions

31
src/node_tool_bucket.cpp Normal file
View File

@@ -0,0 +1,31 @@
#include "pch.h"
#include "node_tool_bucket.h"
Node* NodeToolBucket::clone_instantiate() const
{
return new this_class;
}
void NodeToolBucket::clone_finalize(Node* dest) const
{
parent::clone_finalize(dest);
auto n = static_cast<this_class*>(dest);
n->init_controls();
}
void NodeToolBucket::init()
{
parent::init();
init_template("tpl-tool-bucket");
init_controls();
}
void NodeToolBucket::init_controls()
{
m_slider_threshold = find<NodeSliderH>("threshold");
}
float NodeToolBucket::get_threshold() const
{
return glm::max(1.f, m_slider_threshold->get_value() * 255.f);
}