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:
@@ -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_;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user