libosmscout  0.1
osmscout::MoveAccumulator Class Reference

#include <InputHandler.h>

+ Inheritance diagram for osmscout::MoveAccumulator:

Public Member Functions

QVector2D collect ()
 
 MoveAccumulator (int memory=100, double factor=4, double vectorLengthTreshold=5)
 
MoveAccumulatoroperator+= (const QPointF p)
 
 ~MoveAccumulator () override=default
 

Detailed Description

Helper class that accumulates move (touch events) within some time period (time defined FIFO queue). It helps to MoveHandler determine of move vector when drag gesture ends. It is used for animate move momentum.

Constructor & Destructor Documentation

◆ MoveAccumulator()

osmscout::MoveAccumulator::MoveAccumulator ( int  memory = 100,
double  factor = 4,
double  vectorLengthTreshold = 5 
)
inline
Parameters
memory- in milliseconds for finger position points
factor- momentum movement length (vector returned from collect method) will be equal to recorded length * factor
vectorLengthTreshold- movement (between two points) have to be longer than treshold (in pixels) for change move vector

◆ ~MoveAccumulator()

osmscout::MoveAccumulator::~MoveAccumulator ( )
overridedefault

Member Function Documentation

◆ collect()

QVector2D osmscout::MoveAccumulator::collect ( )

◆ operator+=()

MoveAccumulator & osmscout::MoveAccumulator::operator+= ( const QPointF  p)

The documentation for this class was generated from the following files: