make nodes more const friendly and prepare their functions for stateless work
Since the nodes won't be holding any rendering data themselves in this system, we may as well enforce some level of non-write access by setting all the functions to const. They were already const-friendly, they just weren't labelled as such.
This commit is contained in:
@@ -37,27 +37,27 @@ OpacityNode::OpacityNode()
|
||||
AddParameter(texture_output_);
|
||||
}
|
||||
|
||||
Node *OpacityNode::copy()
|
||||
Node *OpacityNode::copy() const
|
||||
{
|
||||
return new OpacityNode();
|
||||
}
|
||||
|
||||
QString OpacityNode::Name()
|
||||
QString OpacityNode::Name() const
|
||||
{
|
||||
return tr("Opacity");
|
||||
}
|
||||
|
||||
QString OpacityNode::Category()
|
||||
QString OpacityNode::Category() const
|
||||
{
|
||||
return tr("Color");
|
||||
}
|
||||
|
||||
QString OpacityNode::Description()
|
||||
QString OpacityNode::Description() const
|
||||
{
|
||||
return tr("Adjust an image's opacity.");
|
||||
}
|
||||
|
||||
QString OpacityNode::id()
|
||||
QString OpacityNode::id() const
|
||||
{
|
||||
return "org.olivevideoeditor.Olive.opacity";
|
||||
}
|
||||
@@ -67,7 +67,7 @@ void OpacityNode::Retranslate()
|
||||
opacity_input_->set_name(tr("Opacity"));
|
||||
}
|
||||
|
||||
QString OpacityNode::Code(NodeOutput *output)
|
||||
QString OpacityNode::Code(NodeOutput *output) const
|
||||
{
|
||||
if (output == texture_output()) {
|
||||
return "#version 110"
|
||||
@@ -85,12 +85,12 @@ QString OpacityNode::Code(NodeOutput *output)
|
||||
return Node::Code(output);
|
||||
}
|
||||
|
||||
NodeInput *OpacityNode::texture_input()
|
||||
NodeInput *OpacityNode::texture_input() const
|
||||
{
|
||||
return texture_input_;
|
||||
}
|
||||
|
||||
NodeOutput *OpacityNode::texture_output()
|
||||
NodeOutput *OpacityNode::texture_output() const
|
||||
{
|
||||
return texture_output_;
|
||||
}
|
||||
|
||||
@@ -29,21 +29,21 @@ class OpacityNode : public Node
|
||||
public:
|
||||
OpacityNode();
|
||||
|
||||
virtual Node* copy() override;
|
||||
virtual Node* copy() const override;
|
||||
|
||||
virtual QString Name() override;
|
||||
virtual QString Category() override;
|
||||
virtual QString Description() override;
|
||||
virtual QString Name() const override;
|
||||
virtual QString Category() const override;
|
||||
virtual QString Description() const override;
|
||||
|
||||
virtual QString id() override;
|
||||
virtual QString id() const override;
|
||||
|
||||
virtual void Retranslate() override;
|
||||
|
||||
virtual QString Code(NodeOutput* output) override;
|
||||
virtual QString Code(NodeOutput* output) const override;
|
||||
|
||||
NodeInput* texture_input();
|
||||
NodeInput* texture_input() const;
|
||||
|
||||
NodeOutput* texture_output();
|
||||
NodeOutput* texture_output() const;
|
||||
|
||||
private:
|
||||
NodeInput* opacity_input_;
|
||||
|
||||
Reference in New Issue
Block a user