本文整理汇总了C++中app::Document::abortTransaction方法的典型用法代码示例。如果您正苦于以下问题:C++ Document::abortTransaction方法的具体用法?C++ Document::abortTransaction怎么用?C++ Document::abortTransaction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app::Document
的用法示例。
在下文中一共展示了Document::abortTransaction方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: closeBridge
void MeshFillHole::closeBridge()
{
// Do the hole-filling
Gui::WaitCursor wc;
TBoundary::iterator it = std::find(myPolygon.begin(), myPolygon.end(), myVertex1);
TBoundary::iterator jt = std::find(myPolygon.begin(), myPolygon.end(), myVertex2);
if (it != myPolygon.end() && jt != myPolygon.end()) {
// which iterator comes first
if (jt < it)
std::swap(it, jt);
// split the boundary into two loops and take the shorter one
std::list<TBoundary> bounds;
TBoundary loop1, loop2;
loop1.insert(loop1.end(), myPolygon.begin(), it);
loop1.insert(loop1.end(), jt, myPolygon.end());
loop2.insert(loop2.end(), it, jt);
// this happens when myVertex1 == myVertex2
if (loop2.empty())
bounds.push_back(loop1);
else if (loop1.size() < loop2.size())
bounds.push_back(loop1);
else
bounds.push_back(loop2);
App::Document* doc = myMesh->getDocument();
doc->openTransaction("Bridge && Fill hole");
Mesh::MeshObject* pMesh = myMesh->Mesh.startEditing();
bool ok = myHoleFiller.fillHoles(*pMesh, bounds, myVertex1, myVertex2);
myMesh->Mesh.finishEditing();
if (ok)
doc->commitTransaction();
else
doc->abortTransaction();
}
}