From f6a3cae058e954d663ff7e75288a92fd63a65d7d Mon Sep 17 00:00:00 2001 From: Daria Volvenkova Date: Wed, 25 May 2016 18:15:24 +0300 Subject: [PATCH] Calculate target rect inside the animation system. --- drape_frontend/animation/animation.cpp | 5 ++ drape_frontend/animation/animation.hpp | 2 + drape_frontend/animation/arrow_animation.cpp | 14 +++++- drape_frontend/animation/arrow_animation.hpp | 3 ++ drape_frontend/animation/follow_animation.cpp | 26 ++++++++-- drape_frontend/animation/follow_animation.hpp | 2 + drape_frontend/animation/interpolators.hpp | 3 ++ drape_frontend/animation/linear_animation.cpp | 16 ++++-- drape_frontend/animation/linear_animation.hpp | 3 ++ .../animation/perspective_animation.cpp | 19 +++++++ .../animation/perspective_animation.hpp | 2 + drape_frontend/animation/scale_animation.cpp | 18 +++++-- drape_frontend/animation/scale_animation.hpp | 3 ++ .../animation/sequence_animation.cpp | 25 ++++++++++ .../animation/sequence_animation.hpp | 2 + drape_frontend/animation_system.cpp | 50 +++++++++++++++++-- drape_frontend/animation_system.hpp | 7 +++ drape_frontend/kinetic_scroller.cpp | 7 +++ drape_frontend/navigator.cpp | 1 - drape_frontend/user_event_stream.cpp | 5 +- 20 files changed, 195 insertions(+), 18 deletions(-) diff --git a/drape_frontend/animation/animation.cpp b/drape_frontend/animation/animation.cpp index 5bf4d09cff..6949e249d7 100644 --- a/drape_frontend/animation/animation.cpp +++ b/drape_frontend/animation/animation.cpp @@ -20,4 +20,9 @@ bool Animation::CouldBeBlendedWith(Animation const & animation) const m_couldBeBlended && animation.m_couldBeBlended); } +bool Animation::HasTargetProperty(TObject object, TProperty property) const +{ + return HasProperty(object, property); +} + } // namespace df diff --git a/drape_frontend/animation/animation.hpp b/drape_frontend/animation/animation.hpp index 79646de28b..0d62e3e037 100644 --- a/drape_frontend/animation/animation.hpp +++ b/drape_frontend/animation/animation.hpp @@ -118,6 +118,7 @@ public: virtual bool HasObject(TObject object) const = 0; virtual TObjectProperties const & GetProperties(TObject object) const = 0; virtual bool HasProperty(TObject object, TProperty property) const = 0; + virtual bool HasTargetProperty(TObject object, TProperty property) const; virtual void SetMaxDuration(double maxDuration) = 0; virtual double GetDuration() const = 0; @@ -127,6 +128,7 @@ public: virtual void Finish() { OnFinish(); } virtual bool GetProperty(TObject object, TProperty property, PropertyValue & value) const = 0; + virtual bool GetTargetProperty(TObject object, TProperty property, PropertyValue & value) const = 0; void SetOnStartAction(TAction const & action) { m_onStartAction = action; } void SetOnFinishAction(TAction const & action) { m_onFinishAction = action; } diff --git a/drape_frontend/animation/arrow_animation.cpp b/drape_frontend/animation/arrow_animation.cpp index 8116b18861..27c61409eb 100644 --- a/drape_frontend/animation/arrow_animation.cpp +++ b/drape_frontend/animation/arrow_animation.cpp @@ -79,6 +79,16 @@ bool ArrowAnimation::IsFinished() const } bool ArrowAnimation::GetProperty(TObject object, TProperty property, PropertyValue & value) const +{ + return GetProperty(object, property, false /* targetValue */, value); +} + +bool ArrowAnimation::GetTargetProperty(TObject object, TProperty property, PropertyValue & value) const +{ + return GetProperty(object, property, true /* targetValue */, value); +} + +bool ArrowAnimation::GetProperty(TObject object, TProperty property, bool targetValue, PropertyValue & value) const { ASSERT_EQUAL(object, Animation::MyPositionArrow, ()); @@ -87,14 +97,14 @@ bool ArrowAnimation::GetProperty(TObject object, TProperty property, PropertyVal case Animation::Position: if (m_positionInterpolator.IsActive()) { - value = PropertyValue(m_positionInterpolator.GetPosition()); + value = PropertyValue(targetValue ? m_positionInterpolator.GetTargetPosition() : m_positionInterpolator.GetPosition()); return true; } return false; case Animation::Angle: if (m_angleInterpolator.IsActive()) { - value = PropertyValue(m_angleInterpolator.GetAngle()); + value = PropertyValue(targetValue ? m_angleInterpolator.GetTargetAngle() : m_angleInterpolator.GetAngle()); return true; } return false; diff --git a/drape_frontend/animation/arrow_animation.hpp b/drape_frontend/animation/arrow_animation.hpp index ef550a4faf..5d20d85ace 100644 --- a/drape_frontend/animation/arrow_animation.hpp +++ b/drape_frontend/animation/arrow_animation.hpp @@ -27,8 +27,11 @@ public: void Finish() override; bool GetProperty(TObject object, TProperty property, PropertyValue & value) const override; + bool GetTargetProperty(TObject object, TProperty property, PropertyValue & value) const override; private: + bool GetProperty(TObject object, TProperty property, bool targetValue, PropertyValue & value) const; + TAnimObjects m_objects; TObjectProperties m_properties; PositionInterpolator m_positionInterpolator; diff --git a/drape_frontend/animation/follow_animation.cpp b/drape_frontend/animation/follow_animation.cpp index 055db50f41..a268b286b5 100644 --- a/drape_frontend/animation/follow_animation.cpp +++ b/drape_frontend/animation/follow_animation.cpp @@ -113,22 +113,40 @@ m2::PointD MapFollowAnimation::CalculateCenter(double scale, m2::RectD const & p } bool MapFollowAnimation::GetProperty(TObject object, TProperty property, PropertyValue & value) const +{ + return GetProperty(object, property, false /* targetValue */, value); +} + +bool MapFollowAnimation::GetTargetProperty(TObject object, TProperty property, PropertyValue & value) const +{ + return GetProperty(object, property, true /* targetValue */, value); +} + +bool MapFollowAnimation::GetProperty(TObject object, TProperty property, bool targetValue, PropertyValue & value) const { if (property == Animation::Position) { m2::RectD const pixelRect = AnimationSystem::Instance().GetLastScreen().PixelRect(); - value = PropertyValue(CalculateCenter(m_scaleInterpolator.GetScale(), pixelRect, m_globalPosition, - m_pixelPosInterpolator.GetPosition(), m_angleInterpolator.GetAngle())); + if (targetValue) + { + value = PropertyValue(CalculateCenter(m_scaleInterpolator.GetTargetScale(), pixelRect, m_globalPosition, + m_pixelPosInterpolator.GetTargetPosition(), m_angleInterpolator.GetTargetAngle())); + } + else + { + value = PropertyValue(CalculateCenter(m_scaleInterpolator.GetScale(), pixelRect, m_globalPosition, + m_pixelPosInterpolator.GetPosition(), m_angleInterpolator.GetAngle())); + } return true; } if (property == Animation::Angle) { - value = PropertyValue(m_angleInterpolator.GetAngle()); + value = PropertyValue(targetValue ? m_angleInterpolator.GetTargetAngle() : m_angleInterpolator.GetAngle()); return true; } if (property == Animation::Scale) { - value = PropertyValue(m_scaleInterpolator.GetScale()); + value = PropertyValue(targetValue ? m_scaleInterpolator.GetTargetScale() : m_scaleInterpolator.GetScale()); return true; } ASSERT(false, ("Wrong property:", property)); diff --git a/drape_frontend/animation/follow_animation.hpp b/drape_frontend/animation/follow_animation.hpp index bf83492139..fdfd38634b 100644 --- a/drape_frontend/animation/follow_animation.hpp +++ b/drape_frontend/animation/follow_animation.hpp @@ -45,11 +45,13 @@ public: bool IsFinished() const override; bool GetProperty(TObject object, TProperty property, PropertyValue & value) const override; + bool GetTargetProperty(TObject object, TProperty property, PropertyValue & value) const override; bool HasScale() const; bool HasPixelOffset() const; private: + bool GetProperty(TObject object, TProperty property, bool targetValue, PropertyValue & value) const; double CalculateDuration() const; ScaleInterpolator m_scaleInterpolator; diff --git a/drape_frontend/animation/interpolators.hpp b/drape_frontend/animation/interpolators.hpp index 387190c36f..ffffd25b27 100644 --- a/drape_frontend/animation/interpolators.hpp +++ b/drape_frontend/animation/interpolators.hpp @@ -65,6 +65,7 @@ public: void Finish() override; m2::PointD GetPosition() const { return m_position; } + m2::PointD GetTargetPosition() const { return m_endPosition; } private: m2::PointD m_startPosition; @@ -88,6 +89,7 @@ public: void Finish() override; double GetScale() const { return m_scale; } + double GetTargetScale() const { return m_endScale; } private: double m_startScale; @@ -112,6 +114,7 @@ public: void Finish() override; double GetAngle() const { return m_angle; } + double GetTargetAngle() const { return m_endAngle; } private: double m_startAngle; diff --git a/drape_frontend/animation/linear_animation.cpp b/drape_frontend/animation/linear_animation.cpp index d45aff0f5c..7ff23dcdb0 100644 --- a/drape_frontend/animation/linear_animation.cpp +++ b/drape_frontend/animation/linear_animation.cpp @@ -126,6 +126,16 @@ bool MapLinearAnimation::IsFinished() const } bool MapLinearAnimation::GetProperty(TObject object, TProperty property, PropertyValue & value) const +{ + return GetProperty(object, property, false /* targetValue */, value); +} + +bool MapLinearAnimation::GetTargetProperty(TObject object, TProperty property, PropertyValue & value) const +{ + return GetProperty(object, property, true /* targetValue */, value); +} + +bool MapLinearAnimation::GetProperty(TObject object, TProperty property, bool targetValue, PropertyValue & value) const { ASSERT_EQUAL(object, Animation::MapPlane, ()); @@ -134,21 +144,21 @@ bool MapLinearAnimation::GetProperty(TObject object, TProperty property, Propert case Animation::Position: if (m_positionInterpolator.IsActive()) { - value = PropertyValue(m_positionInterpolator.GetPosition()); + value = PropertyValue(targetValue ? m_positionInterpolator.GetTargetPosition() : m_positionInterpolator.GetPosition()); return true; } return false; case Animation::Scale: if (m_scaleInterpolator.IsActive()) { - value = PropertyValue(m_scaleInterpolator.GetScale()); + value = PropertyValue(targetValue ? m_scaleInterpolator.GetTargetScale() : m_scaleInterpolator.GetScale()); return true; } return false; case Animation::Angle: if (m_angleInterpolator.IsActive()) { - value = PropertyValue(m_angleInterpolator.GetAngle()); + value = PropertyValue(targetValue ? m_angleInterpolator.GetTargetAngle() : m_angleInterpolator.GetAngle()); return true; } return false; diff --git a/drape_frontend/animation/linear_animation.hpp b/drape_frontend/animation/linear_animation.hpp index fec452d9e3..2fadc13e9c 100644 --- a/drape_frontend/animation/linear_animation.hpp +++ b/drape_frontend/animation/linear_animation.hpp @@ -41,10 +41,13 @@ public: bool IsFinished() const override; bool GetProperty(TObject object, TProperty property, PropertyValue & value) const override; + bool GetTargetProperty(TObject object, TProperty property, PropertyValue & value) const override; void SetMaxScaleDuration(double maxDuration); private: + bool GetProperty(TObject object, TProperty property, bool targetValue, PropertyValue & value) const; + AngleInterpolator m_angleInterpolator; PositionInterpolator m_positionInterpolator; ScaleInterpolator m_scaleInterpolator; diff --git a/drape_frontend/animation/perspective_animation.cpp b/drape_frontend/animation/perspective_animation.cpp index 7b75be0e5e..73feabbaba 100644 --- a/drape_frontend/animation/perspective_animation.cpp +++ b/drape_frontend/animation/perspective_animation.cpp @@ -35,6 +35,11 @@ bool PerspectiveSwitchAnimation::HasProperty(TObject object, TProperty property) return HasObject(object) && m_properties.find(property) != m_properties.end(); } +bool PerspectiveSwitchAnimation::HasTargetProperty(TObject object, TProperty property) const +{ + return HasObject(object) && property == Animation::SwitchPerspective; +} + void PerspectiveSwitchAnimation::Advance(double elapsedSeconds) { m_angleInterpolator.Advance(elapsedSeconds); @@ -75,6 +80,20 @@ bool PerspectiveSwitchAnimation::IsFinished() const return m_angleInterpolator.IsFinished(); } +bool PerspectiveSwitchAnimation::GetTargetProperty(TObject object, TProperty property, PropertyValue & value) const +{ + ASSERT_EQUAL(object, Animation::MapPlane, ()); + + if (property == Animation::SwitchPerspective) + { + value = PropertyValue(SwitchPerspectiveParams(m_isEnablePerspectiveAnim, m_endAngle, m_endAngle, m_angleFOV)); + return true; + } + + ASSERT(false, ("Wrong property:", property)); + return false; +} + bool PerspectiveSwitchAnimation::GetProperty(TObject object, TProperty property, PropertyValue & value) const { ASSERT_EQUAL(object, Animation::MapPlane, ()); diff --git a/drape_frontend/animation/perspective_animation.hpp b/drape_frontend/animation/perspective_animation.hpp index 93939dc6b7..00671a450d 100644 --- a/drape_frontend/animation/perspective_animation.hpp +++ b/drape_frontend/animation/perspective_animation.hpp @@ -27,6 +27,7 @@ public: TObjectProperties const & GetProperties(TObject object) const override; bool HasProperty(TObject object, TProperty property) const override; + bool HasTargetProperty(TObject object, TProperty property) const override; void Advance(double elapsedSeconds) override; void Finish() override; @@ -39,6 +40,7 @@ public: bool IsFinished() const override; bool GetProperty(TObject object, TProperty property, PropertyValue & value) const override; + bool GetTargetProperty(TObject object, TProperty property, PropertyValue & value) const override; private: AngleInterpolator m_angleInterpolator; diff --git a/drape_frontend/animation/scale_animation.cpp b/drape_frontend/animation/scale_animation.cpp index 5d998273c3..92f814df1d 100644 --- a/drape_frontend/animation/scale_animation.cpp +++ b/drape_frontend/animation/scale_animation.cpp @@ -56,22 +56,34 @@ bool MapScaleAnimation::IsFinished() const return m_scaleInterpolator.IsFinished(); } -bool MapScaleAnimation::GetProperty(TObject object, TProperty property, PropertyValue & value) const +bool MapScaleAnimation::GetProperty(TObject object, TProperty property, bool targetValue, PropertyValue & value) const { + ASSERT_EQUAL(object, Animation::MapPlane, ()); + if (property == Animation::Position) { ScreenBase screen = AnimationSystem::Instance().GetLastScreen(); - screen.SetScale(m_scaleInterpolator.GetScale()); + screen.SetScale(targetValue ? m_scaleInterpolator.GetTargetScale() : m_scaleInterpolator.GetScale()); value = PropertyValue(screen.PtoG(screen.GtoP(m_globalScaleCenter) + m_pixelCenterOffset)); return true; } if (property == Animation::Scale) { - value = PropertyValue(m_scaleInterpolator.GetScale()); + value = PropertyValue(targetValue ? m_scaleInterpolator.GetTargetScale() : m_scaleInterpolator.GetScale()); return true; } ASSERT(false, ("Wrong property:", property)); return false; } +bool MapScaleAnimation::GetTargetProperty(TObject object, TProperty property, PropertyValue & value) const +{ + return GetProperty(object, property, true /* targetValue */, value); +} + +bool MapScaleAnimation::GetProperty(TObject object, TProperty property, PropertyValue & value) const +{ + return GetProperty(object, property, false /* targetValue */, value); +} + } // namespace df diff --git a/drape_frontend/animation/scale_animation.hpp b/drape_frontend/animation/scale_animation.hpp index dc6a73f7af..07706c604a 100644 --- a/drape_frontend/animation/scale_animation.hpp +++ b/drape_frontend/animation/scale_animation.hpp @@ -35,8 +35,11 @@ public: bool IsFinished() const override; bool GetProperty(TObject object, TProperty property, PropertyValue & value) const override; + bool GetTargetProperty(TObject object, TProperty property, PropertyValue & value) const override; private: + bool GetProperty(TObject object, TProperty property, bool targetValue, PropertyValue & value) const; + ScaleInterpolator m_scaleInterpolator; m2::PointD const m_pixelCenterOffset; m2::PointD const m_globalScaleCenter; diff --git a/drape_frontend/animation/sequence_animation.cpp b/drape_frontend/animation/sequence_animation.cpp index 2ccbb96560..3185e5bcfb 100644 --- a/drape_frontend/animation/sequence_animation.cpp +++ b/drape_frontend/animation/sequence_animation.cpp @@ -45,6 +45,17 @@ bool SequenceAnimation::HasProperty(TObject object, TProperty property) const return m_animations.front()->HasProperty(object, property); } +bool SequenceAnimation::HasTargetProperty(TObject object, TProperty property) const +{ + ASSERT(!m_animations.empty(), ()); + for (auto const & anim : m_animations) + { + if (anim->HasTargetProperty(object, property)) + return true; + } + return false; +} + void SequenceAnimation::SetMaxDuration(double maxDuration) { ASSERT(false, ("Not implemented")); @@ -69,6 +80,20 @@ bool SequenceAnimation::GetProperty(TObject object, TProperty property, Property return m_animations.front()->GetProperty(object, property, value); } +bool SequenceAnimation::GetTargetProperty(TObject object, TProperty property, PropertyValue & value) const +{ + ASSERT(!m_animations.empty(), ()); + + for (auto it = m_animations.rbegin(); it != m_animations.rend(); ++it) + { + auto const & anim = *it; + if (anim->HasTargetProperty(object, property)) + return anim->GetTargetProperty(object, property, value); + } + + return false; +} + void SequenceAnimation::AddAnimation(drape_ptr animation) { m_animations.push_back(move(animation)); diff --git a/drape_frontend/animation/sequence_animation.hpp b/drape_frontend/animation/sequence_animation.hpp index fe1c85d0fc..2fa353cce6 100644 --- a/drape_frontend/animation/sequence_animation.hpp +++ b/drape_frontend/animation/sequence_animation.hpp @@ -18,6 +18,7 @@ public: bool HasObject(TObject object) const override; TObjectProperties const & GetProperties(TObject object) const override; bool HasProperty(TObject object, TProperty property) const override; + bool HasTargetProperty(TObject object, TProperty property) const override; string const & GetCustomType() const; void SetCustomType(string const & type); @@ -27,6 +28,7 @@ public: bool IsFinished() const override; bool GetProperty(TObject object, TProperty property, PropertyValue &value) const override; + bool GetTargetProperty(TObject object, TProperty property, PropertyValue &value) const override; void AddAnimation(drape_ptr animation); diff --git a/drape_frontend/animation_system.cpp b/drape_frontend/animation_system.cpp index 58bdb64cd9..47ea8fa744 100644 --- a/drape_frontend/animation_system.cpp +++ b/drape_frontend/animation_system.cpp @@ -2,6 +2,7 @@ #include "base/logging.hpp" +#include "std/bind.hpp" #include "std/weak_ptr.hpp" namespace df @@ -76,6 +77,18 @@ private: bool AnimationSystem::GetRect(ScreenBase const & currentScreen, m2::AnyRectD & rect) { + return GetRect(currentScreen, bind(&AnimationSystem::GetProperty, this, _1, _2, _3), rect); +} + +void AnimationSystem::GetTargetRect(ScreenBase const & currentScreen, m2::AnyRectD & rect) +{ + GetRect(currentScreen, bind(&AnimationSystem::GetTargetProperty, this, _1, _2, _3), rect); +} + +bool AnimationSystem::GetRect(ScreenBase const & currentScreen, TGetPropertyFn const & getPropertyFn, m2::AnyRectD & rect) +{ + ASSERT(getPropertyFn != nullptr, ()); + m_lastScreen = currentScreen; double scale = currentScreen.GetScale(); @@ -83,13 +96,13 @@ bool AnimationSystem::GetRect(ScreenBase const & currentScreen, m2::AnyRectD & r m2::PointD pos = currentScreen.GlobalRect().GlobalZero(); Animation::PropertyValue value; - if (GetProperty(Animation::MapPlane, Animation::Scale, value)) + if (getPropertyFn(Animation::MapPlane, Animation::Scale, value)) scale = value.m_valueD; - if (GetProperty(Animation::MapPlane, Animation::Angle, value)) + if (getPropertyFn(Animation::MapPlane, Animation::Angle, value)) angle = value.m_valueD; - if (GetProperty(Animation::MapPlane, Animation::Position, value)) + if (getPropertyFn(Animation::MapPlane, Animation::Position, value)) pos = value.m_valuePointD; m2::RectD localRect = currentScreen.PixelRect(); @@ -355,6 +368,37 @@ bool AnimationSystem::GetProperty(Animation::TObject object, Animation::TPropert return false; } +bool AnimationSystem::GetTargetProperty(Animation::TObject object, Animation::TProperty property, + Animation::PropertyValue & value) const +{ + if (!m_animationChain.empty()) + { + PropertyBlender blender; + for (auto const & anim : *(m_animationChain.front())) + { + if (anim->HasTargetProperty(object, property)) + { + Animation::PropertyValue val; + if (anim->GetTargetProperty(object, property, val)) + blender.Blend(val); + } + } + if (!blender.IsEmpty()) + { + value = blender.Finish(); + return true; + } + } + + auto it = m_propertyCache.find(make_pair(object, property)); + if (it != m_propertyCache.end()) + { + value = it->second; + return true; + } + return false; +} + void AnimationSystem::SaveAnimationResult(Animation const & animation) { for (auto const & object : animation.GetObjects()) diff --git a/drape_frontend/animation_system.hpp b/drape_frontend/animation_system.hpp index 481ac89781..fd58a24894 100644 --- a/drape_frontend/animation_system.hpp +++ b/drape_frontend/animation_system.hpp @@ -18,6 +18,7 @@ public: static AnimationSystem & Instance(); bool GetRect(ScreenBase const & currentScreen, m2::AnyRectD & rect); + void GetTargetRect(ScreenBase const & currentScreen, m2::AnyRectD & rect); bool SwitchPerspective(Animation::SwitchPerspectiveParams & params); bool GetPerspectiveAngle(double & angle); @@ -78,8 +79,14 @@ public: private: AnimationSystem() = default; + using TGetPropertyFn = function; + bool GetRect(ScreenBase const & currentScreen, TGetPropertyFn const & getPropertyFn, m2::AnyRectD & rect); + bool GetProperty(Animation::TObject object, Animation::TProperty property, Animation::PropertyValue & value) const; + bool GetTargetProperty(Animation::TObject object, Animation::TProperty property, + Animation::PropertyValue & value) const; void StartNextAnimations(); void FinishAnimations(function const &)> const & predicate, bool rewind, bool finishAll); diff --git a/drape_frontend/kinetic_scroller.cpp b/drape_frontend/kinetic_scroller.cpp index 9a0edd14ff..d874a98dd6 100644 --- a/drape_frontend/kinetic_scroller.cpp +++ b/drape_frontend/kinetic_scroller.cpp @@ -94,6 +94,13 @@ public: return true; } + bool GetTargetProperty(TObject object, TProperty property, PropertyValue & value) const override + { + ASSERT(HasProperty(object, property), ()); + value = PropertyValue(m_endPos); + return true; + } + private: double GetT() const { diff --git a/drape_frontend/navigator.cpp b/drape_frontend/navigator.cpp index f5bf93b017..f695b9917e 100644 --- a/drape_frontend/navigator.cpp +++ b/drape_frontend/navigator.cpp @@ -293,7 +293,6 @@ bool Navigator::IsRotatingDuringScale() const void Navigator::Enable3dMode(double currentRotationAngle, double maxRotationAngle, double angleFOV) { - ASSERT(!m_Screen.isPerspective(), ()); m_Screen.ApplyPerspective(currentRotationAngle, maxRotationAngle, angleFOV); } diff --git a/drape_frontend/user_event_stream.cpp b/drape_frontend/user_event_stream.cpp index 116b2e6777..17e6f5c084 100644 --- a/drape_frontend/user_event_stream.cpp +++ b/drape_frontend/user_event_stream.cpp @@ -668,8 +668,9 @@ m2::AnyRectD UserEventStream::GetCurrentRect() const m2::AnyRectD UserEventStream::GetTargetRect() const { - // TODO: Calculate target rect inside the animation system. - return GetCurrentRect(); + m2::AnyRectD targetRect; + m_animationSystem.GetTargetRect(m_navigator.Screen(), targetRect); + return targetRect; } bool UserEventStream::ProcessTouch(TouchEvent const & touch)