本文整理汇总了C++中KisPaintInformation::drawingDirectionVector方法的典型用法代码示例。如果您正苦于以下问题:C++ KisPaintInformation::drawingDirectionVector方法的具体用法?C++ KisPaintInformation::drawingDirectionVector怎么用?C++ KisPaintInformation::drawingDirectionVector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KisPaintInformation
的用法示例。
在下文中一共展示了KisPaintInformation::drawingDirectionVector方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paintAt
KisSpacingInformation KisLiquifyPaintop::paintAt(const KisPaintInformation &pi)
{
static const qreal sizeToSigmaCoeff = 1.0 / 3.0;
const qreal size = sizeToSigmaCoeff *
(m_d->props.sizeHasPressure() ?
pi.pressure() * m_d->props.size():
m_d->props.size());
const qreal spacing = m_d->props.spacing() * size;
const qreal reverseCoeff =
m_d->props.mode() !=
KisLiquifyProperties::UNDO &&
m_d->props.reverseDirection() ? -1.0 : 1.0;
const qreal amount = m_d->props.amountHasPressure() ?
pi.pressure() * reverseCoeff * m_d->props.amount():
reverseCoeff * m_d->props.amount();
const bool useWashMode = m_d->props.useWashMode();
const qreal flow = m_d->props.flow();
switch (m_d->props.mode()) {
case KisLiquifyProperties::MOVE: {
const qreal offsetLength = size * amount;
m_d->worker->translatePoints(pi.pos(),
pi.drawingDirectionVector() * offsetLength,
size, useWashMode, flow);
break;
}
case KisLiquifyProperties::SCALE:
m_d->worker->scalePoints(pi.pos(),
amount,
size, useWashMode, flow);
break;
case KisLiquifyProperties::ROTATE:
m_d->worker->rotatePoints(pi.pos(),
2.0 * M_PI * amount,
size, useWashMode, flow);
break;
case KisLiquifyProperties::OFFSET: {
const qreal offsetLength = size * amount;
m_d->worker->translatePoints(pi.pos(),
KisAlgebra2D::rightUnitNormal(pi.drawingDirectionVector()) * offsetLength,
size, useWashMode, flow);
break;
}
case KisLiquifyProperties::UNDO:
m_d->worker->undoPoints(pi.pos(),
amount,
size);
break;
case KisLiquifyProperties::N_MODES:
qFatal("Not supported mode");
}
return KisSpacingInformation(spacing);
}