You've already forked nodeeditor
mirror of
https://github.com/AxioDL/nodeeditor.git
synced 2026-03-30 11:48:31 -07:00
64dd7d491a
* Automatic type cast node insertation working in a basic manner * Port paint fix to handle convertible types * Code cleanup, documentation,, and minor fixes * Fixing master merge * Master merge fix 2 * Master merge fix 3 * Code style fixes * Fixing logic error, where typecast node with the same input-output types were permitted * Fixes based on @russelltg 's suggestions * Got rid of unique_ptr static_casts * Partial fixes from the code review * Merging master into branch vol. 3
37 lines
618 B
C++
37 lines
618 B
C++
#pragma once
|
|
|
|
#include <nodes/NodeDataModel>
|
|
|
|
using QtNodes::NodeDataType;
|
|
|
|
/// 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 {"decimal",
|
|
"Decimal"};
|
|
}
|
|
|
|
double number() const
|
|
{ return _number; }
|
|
|
|
QString numberAsText() const
|
|
{ return QString::number(_number, 'f'); }
|
|
|
|
private:
|
|
|
|
double _number;
|
|
};
|