Files
David Bachrati 64dd7d491a Implement automatic insertion of typecast nodes (#52)
* 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
2017-01-30 18:03:49 +01:00

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;
};