本文整理汇总了C++中FPoint::transformPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ FPoint::transformPoint方法的具体用法?C++ FPoint::transformPoint怎么用?C++ FPoint::transformPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FPoint
的用法示例。
在下文中一共展示了FPoint::transformPoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mouseMoveEvent
void CanvasMode_EditMeshGradient::mouseMoveEvent(QMouseEvent *m)
{
const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
m->accept();
if (m_selectedMeshPoints.count() == 0)
return;
if (m_canvas->m_viewMode.m_MouseButtonPressed && m_view->moveTimerElapsed())
{
FPoint npfN;
double nx = mousePointDoc.x();
double ny = mousePointDoc.y();
if (!m_doc->ApplyGuides(&nx, &ny) && !m_doc->ApplyGuides(&nx, &ny,true))
npfN = m_doc->ApplyGridF(FPoint(nx, ny));
else
npfN = FPoint(nx, ny);
PageItem *currItem = m_doc->m_Selection->itemAt(0);
QTransform pp = currItem->getTransform();
FPoint npf = npfN.transformPoint(pp, true);
if (m_view->editStrokeGradient == 6)
{
if (m_selectedMeshPoints.count() > 0)
{
QPair<int, int> selP = m_selectedMeshPoints[0];
FPoint cP = currItem->meshGradientArray[selP.first][selP.second].controlColor;
FPoint gP = currItem->meshGradientArray[selP.first][selP.second].gridPoint;
m_canvas->displayXYHUD(m->globalPos(), cP.x() - gP.x(), cP.y() - gP.y());
}
}
else
m_canvas->displayXYHUD(m->globalPos(), npf.x(), npf.y());
FPoint npx(m_Mxp - npfN.x(), m_Myp - npfN.y(), 0, 0, currItem->rotation(), 1, 1, true);
if (m_selectedMeshPoints.count() > 0)
{
if (m_view->editStrokeGradient == 5)
{
for (int mo = 0; mo < m_selectedMeshPoints.count(); mo++)
{
QPair<int, int> selP = m_selectedMeshPoints[mo];
currItem->meshGradientArray[selP.first][selP.second].moveRel(-npx.x(), -npx.y());
}
}
else if (m_view->editStrokeGradient == 6)
{
QPair<int, int> selP = m_selectedMeshPoints[0];
currItem->meshGradientArray[selP.first][selP.second].controlColor -= npx;
}
else if (m_view->editStrokeGradient == 7)
{
QPair<int, int> selP = m_selectedMeshPoints[0];
if (m_gradientPoint == useControlT)
currItem->meshGradientArray[selP.first][selP.second].controlTop -= npx;
else if (m_gradientPoint == useControlB)
currItem->meshGradientArray[selP.first][selP.second].controlBottom -= npx;
else if (m_gradientPoint == useControlL)
currItem->meshGradientArray[selP.first][selP.second].controlLeft -= npx;
else if (m_gradientPoint == useControlR)
currItem->meshGradientArray[selP.first][selP.second].controlRight -= npx;
}
currItem->update();
QTransform itemMatrix = currItem->getTransform();
m_doc->regionsChanged()->update(itemMatrix.mapRect(QRectF(0, 0, currItem->width(), currItem->height())).adjusted(-currItem->width() / 2.0, -currItem->height() / 2.0, currItem->width(), currItem->height()));
}
m_Mxp = npfN.x();
m_Myp = npfN.y();
}
}