10#include <boost/optional.hpp>
22 qreal xTilt_, qreal yTilt_,
24 qreal tangentialPressure_,
110 int _currentDabSeqNo,
112 QPointF _lastPosition,
113 qreal _lastMaxPressure,
114 boost::optional<qreal> _lockedDrawingAngle)
170 p->d->unregisterDistanceInfo();
250 qreal xTilt, qreal yTilt,
252 qreal tangentialPressure,
255 qreal canvasrotation,
256 bool canvasMirroredH,
257 bool canvasMirroredV,
258 qreal tiltDirectionOffset)
320 e.setAttribute(
"pointX", QString::number(
pos().x(),
'g', 15));
321 e.setAttribute(
"pointY", QString::number(
pos().y(),
'g', 15));
322 e.setAttribute(
"pressure", QString::number(
pressure(),
'g', 15));
323 e.setAttribute(
"xTilt", QString::number(
xTilt(),
'g', 15));
324 e.setAttribute(
"yTilt", QString::number(
yTilt(),
'g', 15));
325 e.setAttribute(
"rotation", QString::number(
rotation(),
'g', 15));
327 e.setAttribute(
"perspective", QString::number(
perspective(),
'g', 15));
328 e.setAttribute(
"time", QString::number(
d->
time,
'g', 15));
329 e.setAttribute(
"speed", QString::number(
d->
speed,
'g', 15));
407 warnKrita <<
"KisPaintInformation::drawingAngleSafe()" <<
"DirectionHistoryInfo object is not available";
411 if (considerLockedAngle &&
427 return QPointF(cos(angle), sin(angle));
433 warnKrita <<
"KisPaintInformation::drawingDistance()" <<
"DirectionHistoryInfo object is not available";
438 qreal
length = diff.length();
450 warnKrita <<
"KisPaintInformation::maxPressure()" <<
"DirectionHistoryInfo object is not available";
490 warnKrita <<
"KisPaintInformation::currentDabSeqNo()" <<
"DirectionHistoryInfo object is not available";
500 warnKrita <<
"KisPaintInformation::totalStrokeLength()" <<
"DirectionHistoryInfo object is not available";
510 qWarning() <<
"Accessing uninitialized random source!";
526 qWarning() <<
"Accessing uninitialized per stroke random source!";
548 dbg.nospace() <<
"Position: " << info.
pos();
549 dbg.nospace() <<
", Pressure: " << info.
pressure();
550 dbg.nospace() <<
", X Tilt: " << info.
xTilt();
551 dbg.nospace() <<
", Y Tilt: " << info.
yTilt();
552 dbg.nospace() <<
", Rotation: " << info.
rotation();
554 dbg.nospace() <<
", Perspective: " << info.
perspective();
555 dbg.nospace() <<
", Drawing Angle: " << info.
drawingAngle();
556 dbg.nospace() <<
", Drawing Speed: " << info.
drawingSpeed();
565 QPointF pt = (1 - t) * mixedPi.
pos() + t * basePi.
pos();
566 return mixImpl(pt, t, mixedPi, basePi,
true,
false);
571 QPointF pt = (1 - t) * pi1.
pos() + t * pi2.
pos();
572 return mix(pt, t, pi1, pi2);
577 return mixImpl(
p, t, pi1, pi2,
false,
true);
582 QPointF pt = (1 - t) * pi1.
pos() + t * pi2.
pos();
588 return mixImpl(
p, t, pi1, pi2,
false,
false);
593 QPointF pt = (1 - t) * other.
pos() + t * this->
pos();
599 QPointF pt = (1 - t) * other.
pos() + t * this->
pos();
625 if (other.
rotation() != this->rotation()) {
689 qreal
xTilt = qBound(qreal(-1.0), info.
xTilt() / maxTiltX , qreal(1.0));
690 qreal
yTilt = qBound(qreal(-1.0), info.
yTilt() / maxTiltY , qreal(1.0));
qreal length(const QPointF &vec)
float value(const T *src, size_t ch)
qreal distance(const QPointF &p1, const QPointF &p2)
static bool qFuzzyIsNull(half h)
#define KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(cond, val)
#define KIS_ASSERT_RECOVER_NOOP(cond)
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)
qreal incrementInDirection(qreal a, qreal inc, qreal direction)
T kisRadiansToDegrees(T radians)
std::enable_if< std::is_floating_point< T >::value, T >::type normalizeAngleDegrees(T a)
qreal shortestAngularDistance(qreal a, qreal b)
T kisDegreesToRadians(T degrees)
qreal directionBetweenPoints(const QPointF &p1, const QPointF &p2, qreal defaultAngle)
double toDouble(const QString &str, bool *ok=nullptr)
DirectionHistoryInfo(qreal _totalDistance, int _currentDabSeqNo, qreal _lastAngle, QPointF _lastPosition, qreal _lastMaxPressure, boost::optional< qreal > _lockedDrawingAngle)
boost::optional< qreal > lockedDrawingAngle