added bucket options tool
This commit is contained in:
31
src/node_tool_bucket.cpp
Normal file
31
src/node_tool_bucket.cpp
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user