本文整理汇总了C++中TVectorImageP::deleteStroke方法的典型用法代码示例。如果您正苦于以下问题:C++ TVectorImageP::deleteStroke方法的具体用法?C++ TVectorImageP::deleteStroke怎么用?C++ TVectorImageP::deleteStroke使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TVectorImageP
的用法示例。
在下文中一共展示了TVectorImageP::deleteStroke方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paste
void StrokeSelection::paste() {
TTool *tool = TTool::getApplication()->getCurrentTool()->getTool();
if (!tool) return;
if (TTool::getApplication()->getCurrentObject()->isSpline()) {
const StrokesData *stData = dynamic_cast<const StrokesData *>(
QApplication::clipboard()->mimeData());
if (!stData) return;
TVectorImageP splineImg = tool->getImage(true);
TVectorImageP img = stData->m_image;
if (!splineImg || !img) return;
QMutexLocker lock(splineImg->getMutex());
TUndo *undo = new ToolUtils::UndoPath(
tool->getXsheet()->getStageObject(tool->getObjectId())->getSpline());
while (splineImg->getStrokeCount() > 0) splineImg->deleteStroke(0);
TStroke *stroke = img->getStroke(0);
splineImg->addStroke(new TStroke(*stroke), false);
TUndoManager::manager()->add(undo);
tool->notifyImageChanged();
tool->invalidate();
return;
}
TVectorImageP tarImg = tool->touchImage();
if (!tarImg) return;
TPaletteP palette = tarImg->getPalette();
TPaletteP oldPalette = new TPalette();
if (palette) oldPalette = palette->clone();
bool isPaste = pasteStrokesWithoutUndo(tarImg, m_indexes, m_sceneHandle);
if (isPaste) {
TXshSimpleLevel *level =
TTool::getApplication()->getCurrentLevel()->getSimpleLevel();
TUndoManager::manager()->add(new PasteStrokesUndo(
level, tool->getCurrentFid(), m_indexes, oldPalette, m_sceneHandle));
m_updateSelectionBBox = isPaste;
}
tool->notifyImageChanged();
tool->getApplication()
->getPaletteController()
->getCurrentLevelPalette()
->notifyPaletteChanged();
m_updateSelectionBBox = false;
tool->invalidate();
}