Add the ability to unify keyframe handles

Task-number: QDS-568
Change-Id: I5b102423e8e166d41edf199c42305cee102e8b54
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Knud Dollereder
2020-03-24 15:05:28 +01:00
parent 540ea616ec
commit 20e95f2f19
22 changed files with 207 additions and 30 deletions

View File

@@ -103,6 +103,15 @@ bool AnimationCurve::isFromData() const
return m_fromData;
}
bool AnimationCurve::hasUnified() const
{
for (auto &&frame : m_frames) {
if (frame.isUnified())
return true;
}
return false;
}
double AnimationCurve::minimumTime() const
{
if (!m_frames.empty())
@@ -144,6 +153,18 @@ std::string AnimationCurve::string() const
return sstream.str();
}
QString AnimationCurve::unifyString() const
{
QString out;
for (auto &&frame : m_frames) {
if (frame.isUnified())
out.append("1");
else
out.append("0");
}
return out;
}
CurveSegment AnimationCurve::segment(double time) const
{
CurveSegment seg;