7#include <PhosphorAnimation/phosphoranimation_export.h>
9#include <QtCore/QObject>
10#include <QtCore/QString>
11#include <QtQml/qqmlregistration.h>
30 QML_VALUE_TYPE(phosphorSpring)
33 Q_PROPERTY(qreal omega READ omega WRITE setOmega)
34 Q_PROPERTY(qreal zeta READ zeta WRITE setZeta)
44 : m_value(omega, zeta)
70 m_value =
Spring(v, m_value.zeta);
78 m_value =
Spring(m_value.omega, v);
86 return m_value.toString();
118 return m_value == other.m_value;
122 return !(*
this == other);
QML value-type wrapper around PhosphorAnimation::Spring.
Definition PhosphorSpring.h:28
bool operator==(const PhosphorSpring &other) const
Definition PhosphorSpring.h:116
PhosphorSpring(const Spring &value)
Implicit-conversion ctor for core-library code.
Definition PhosphorSpring.h:39
PhosphorSpring(qreal omega, qreal zeta)
Definition PhosphorSpring.h:43
const Spring & value() const
Read-only access to the underlying value.
Definition PhosphorSpring.h:53
qreal omega() const
Definition PhosphorSpring.h:60
QString toString() const
Canonical wire format from PhosphorAnimation::Spring::toString.
Definition PhosphorSpring.h:84
static PhosphorSpring smooth()
Critically damped. No overshoot, firm approach.
Definition PhosphorSpring.h:104
void setZeta(qreal v)
Definition PhosphorSpring.h:76
static PhosphorSpring fromString(const QString &str)
Parse "spring:omega,zeta" or "omega,zeta".
Definition PhosphorSpring.h:91
void setOmega(qreal v)
Definition PhosphorSpring.h:64
qreal zeta() const
Definition PhosphorSpring.h:72
static PhosphorSpring bouncy()
Visible bounce. Good for attention-grabbing feedback.
Definition PhosphorSpring.h:109
bool operator!=(const PhosphorSpring &other) const
Definition PhosphorSpring.h:120
static PhosphorSpring snappy()
Responsive, slight overshoot. Good default for window snap.
Definition PhosphorSpring.h:99
Damped harmonic oscillator.
Definition Spring.h:19
Definition AnimatedValue.h:31