gizmos: implemented pathway for node to draw on the viewer
This commit is contained in:
@@ -110,6 +110,17 @@ NodeValueTable MatrixGenerator::Value(NodeValueDatabase &value) const
|
||||
return output;
|
||||
}
|
||||
|
||||
bool MatrixGenerator::HasGizmos() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void MatrixGenerator::DrawGizmos(QPainter *p, const QRect& viewport) const
|
||||
{
|
||||
p->setPen(Qt::white);
|
||||
p->drawEllipse(viewport);
|
||||
}
|
||||
|
||||
void MatrixGenerator::UniformScaleChanged()
|
||||
{
|
||||
scale_input_->set_property("disabley", uniform_scale_input_->get_standard_value().toBool());
|
||||
|
||||
@@ -42,6 +42,9 @@ public:
|
||||
|
||||
virtual NodeValueTable Value(NodeValueDatabase& value) const override;
|
||||
|
||||
virtual bool HasGizmos() const override;
|
||||
virtual void DrawGizmos(QPainter *p, const QRect &viewport) const override;
|
||||
|
||||
private:
|
||||
NodeInput* position_input_;
|
||||
|
||||
|
||||
@@ -268,6 +268,15 @@ QList<NodeOutput *> Node::GetOutputs() const
|
||||
return {output_};
|
||||
}
|
||||
|
||||
bool Node::HasGizmos() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void Node::DrawGizmos(QPainter *, const QRect &) const
|
||||
{
|
||||
}
|
||||
|
||||
void Node::CopyInputs(Node *source, Node *destination, bool include_connections)
|
||||
{
|
||||
Q_ASSERT(source->id() == destination->id());
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#include <QCryptographicHash>
|
||||
#include <QObject>
|
||||
#include <QPainter>
|
||||
#include <QPointF>
|
||||
#include <QXmlStreamWriter>
|
||||
|
||||
@@ -352,6 +353,10 @@ public:
|
||||
|
||||
QList<NodeOutput*> GetOutputs() const;
|
||||
|
||||
virtual bool HasGizmos() const;
|
||||
|
||||
virtual void DrawGizmos(QPainter* p, const QRect &viewport) const;
|
||||
|
||||
protected:
|
||||
void AddInput(NodeInput* input);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user