You've already forked nodeeditor
mirror of
https://github.com/AxioDL/nodeeditor.git
synced 2026-03-30 11:48:31 -07:00
38 lines
673 B
C++
38 lines
673 B
C++
#pragma once
|
|
|
|
#include <nodes/NodeDataModel>
|
|
|
|
using QtNodes::NodeDataType;
|
|
using QtNodes::NodeData;
|
|
|
|
/// The class can potentially incapsulate any user data which
|
|
/// need to be transferred within the Node Editor graph
|
|
class DecimalData : public NodeData
|
|
{
|
|
public:
|
|
|
|
DecimalData()
|
|
: _number(0.0)
|
|
{}
|
|
|
|
DecimalData(double const number)
|
|
: _number(number)
|
|
{}
|
|
|
|
NodeDataType type() const override
|
|
{
|
|
return NodeDataType {QLatin1String("decimal"),
|
|
QLatin1String("Decimal")};
|
|
}
|
|
|
|
double number() const
|
|
{ return _number; }
|
|
|
|
QString numberAsText() const
|
|
{ return QString::number(_number, 'f'); }
|
|
|
|
private:
|
|
|
|
double _number;
|
|
};
|