18#ifndef STROKEMANAGER_H
19#define STROKEMANAGER_H
26#include <QElapsedTimer>
40 void setPressure(
float pressure);
41 void setStabilizerLevel(
int level);
43 float getPressure() {
return mTabletPressure; }
44 int getStabilizerLevel() {
return mStabilizerLevel; }
45 bool isTabletInUse() {
return mTabletInUse; }
46 void setTabletInUse(
bool inUse) { mTabletInUse = inUse; }
47 bool isActive() {
return mStrokeStarted; }
50 void interpolatePoll();
52 void interpolatePollAndPaint();
53 void interpolateEnd();
54 void smoothMousePos(
QPointF pos);
59 QPointF getLastPressPixel()
const {
return mLastPressPixel; }
60 QPointF getCurrentPixel()
const {
return mCurrentPixel; }
61 QPointF getLastPixel()
const {
return mLastPixel; }
62 QPointF getLastMeanPixel()
const {
return mLastInterpolated; }
63 QPointF getMousePos()
const {
return mousePos; }
64 QPointF getCurrentPressPixel()
const {
return mCurrentPressPixel; }
67 static const int STROKE_QUEUE_LENGTH = 3;
71 float pressure = 1.0f;
78 QPointF mCurrentPressPixel = { 0, 0 };
79 QPointF mLastPressPixel2 = { 0, 0 };
80 QPointF mLastPressPixel = { 0, 0 };
81 QPointF mCurrentPixel = { 0, 0 };
83 QPointF mLastInterpolated = { 0, 0 };
87 bool mHasTangent =
false;
89 bool mStrokeStarted =
false;
90 bool mTabletInUse =
false;
91 float mTabletPressure = 1.f;
92 int mStabilizerLevel = 0;
virtual bool event(QEvent *e)