31 auto tie()
const noexcept
33 return std::tie (position, pressure, orientation, rotation, tiltX, tiltY);
39 bool operator== (
const PointerState& other)
const noexcept {
return tie() == other.tie(); }
40 bool operator!= (
const PointerState& other)
const noexcept {
return tie() != other.tie(); }
42 [[nodiscard]]
PointerState withPositionOffset (
Point<float> x)
const noexcept {
return with (&PointerState::position, position + x); }
43 [[nodiscard]]
PointerState withPosition (
Point<float> x)
const noexcept {
return with (&PointerState::position, x); }
44 [[nodiscard]]
PointerState withPressure (
float x)
const noexcept {
return with (&PointerState::pressure, x); }
45 [[nodiscard]]
PointerState withOrientation (
float x)
const noexcept {
return with (&PointerState::orientation, x); }
46 [[nodiscard]]
PointerState withRotation (
float x)
const noexcept {
return with (&PointerState::rotation, x); }
47 [[nodiscard]]
PointerState withTiltX (
float x)
const noexcept {
return with (&PointerState::tiltX, x); }
48 [[nodiscard]]
PointerState withTiltY (
float x)
const noexcept {
return with (&PointerState::tiltY, x); }
55 float tiltY = MouseInputSource::defaultTiltY;
57 bool isPressureValid()
const noexcept {
return 0.0f <= pressure && pressure <= 1.0f; }
58 bool isOrientationValid()
const noexcept {
return 0.0f <= orientation && orientation <= MathConstants<float>::twoPi; }
59 bool isRotationValid()
const noexcept {
return 0.0f <= rotation && rotation <= MathConstants<float>::twoPi; }
60 bool isTiltValid (
bool isX)
const noexcept
62 return isX ? (-1.0f <= tiltX && tiltX <= 1.0f)
63 : (-1.0f <= tiltY && tiltY <= 1.0f);
67 template <
typename Value>
71 copy.*member = std::move (item);