本文整理汇总了C++中KoPathShape::removePoint方法的典型用法代码示例。如果您正苦于以下问题:C++ KoPathShape::removePoint方法的具体用法?C++ KoPathShape::removePoint怎么用?C++ KoPathShape::removePoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KoPathShape
的用法示例。
在下文中一共展示了KoPathShape::removePoint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: undo
void KoPathPointInsertCommand::undo()
{
QUndoCommand::undo();
for (int i = 0; i < m_pointDataList.size(); ++i) {
const KoPathPointData &pdBefore = m_pointDataList.at(i);
KoPathShape * pathShape = pdBefore.pathShape;
KoPathPointIndex piAfter = pdBefore.pointIndex;
++piAfter.second;
KoPathPoint * before = pathShape->pointByIndex(pdBefore.pointIndex);
m_points[i] = pathShape->removePoint(piAfter);
if (m_points[i]->properties() & KoPathPoint::CloseSubpath) {
piAfter.second = 0;
}
KoPathPoint * after = pathShape->pointByIndex(piAfter);
if (before->activeControlPoint2()) {
QPointF controlPoint2 = before->controlPoint2();
qSwap(controlPoint2, m_controlPoints[i].first);
before->setControlPoint2(controlPoint2);
}
if (after->activeControlPoint1()) {
QPointF controlPoint1 = after->controlPoint1();
qSwap(controlPoint1, m_controlPoints[i].second);
after->setControlPoint1(controlPoint1);
}
pathShape->update();
}
m_deletePoints = true;
}
示例2: undo
void KoPathBreakAtPointCommand::undo()
{
KUndo2Command::undo();
KoPathShape * lastPathShape = 0;
for (int i = 0; i < m_pointDataList.size(); ++i) {
const KoPathPointData & pd = m_pointDataList.at(i);
KoPathShape * pathShape = pd.pathShape;
KoPathPointIndex pointIndex = pd.pointIndex;
++pointIndex.second;
if (m_closedIndex.at(i).first != -1) {
m_closedIndex[i] = pathShape->closeSubpath(m_closedIndex.at(i));
} else {
pointIndex.second = pointIndex.second + m_closedIndex.at(i).second;
pathShape->join(pd.pointIndex.first);
}
m_points[i] = pathShape->removePoint(pointIndex);
if (lastPathShape != pathShape) {
if (lastPathShape) {
lastPathShape->update();
}
lastPathShape = pathShape;
}
}
if (lastPathShape) {
lastPathShape->update();
}
m_deletePoints = true;
}