sweeping node graph changes for new rendering pipeline

The new rendering pipeline strives to simplify the nodes themselves as much
as possible and move much of the logic to an external rendering engine. This
change removes all of the responsibilities that no longer belong to the
nodes themselves and will soon be folded into the renderer.
This commit is contained in:
itsmattkc
2019-11-02 01:39:37 +11:00
parent c14125e640
commit 16ac2fc0e1
35 changed files with 397 additions and 347 deletions
+38
View File
@@ -21,6 +21,11 @@ const rational &TimeRange::out() const
return out_;
}
const rational &TimeRange::length() const
{
return length_;
}
void TimeRange::set_in(const rational &in)
{
in_ = in;
@@ -40,6 +45,36 @@ void TimeRange::set_range(const rational &in, const rational &out)
normalize();
}
bool TimeRange::operator<(const TimeRange &r) const
{
return length() < r.length();
}
bool TimeRange::operator<=(const TimeRange &r) const
{
return length() <= r.length();
}
bool TimeRange::operator>(const TimeRange &r) const
{
return length() > r.length();
}
bool TimeRange::operator>=(const TimeRange &r) const
{
return length() >= r.length();
}
bool TimeRange::operator==(const TimeRange &r) const
{
return length() == r.length();
}
bool TimeRange::operator!=(const TimeRange &r) const
{
return length() != r.length();
}
void TimeRange::normalize()
{
// If `out` is earlier than `in`, swap them
@@ -48,4 +83,7 @@ void TimeRange::normalize()
in_ = out_;
out_ = temp;
}
// Calculate length
length_ = out_ - in_;
}
+9
View File
@@ -10,16 +10,25 @@ public:
const rational& in() const;
const rational& out() const;
const rational& length() const;
void set_in(const rational& in);
void set_out(const rational& out);
void set_range(const rational& in, const rational& out);
bool operator<(const TimeRange &r) const;
bool operator<=(const TimeRange &r) const;
bool operator>(const TimeRange &r) const;
bool operator>=(const TimeRange &r) const;
bool operator==(const TimeRange &r) const;
bool operator!=(const TimeRange &r) const;
private:
void normalize();
rational in_;
rational out_;
rational length_;
};
#endif // TIMERANGE_H