本文整理汇总了C++中TopTools_IndexedMapOfShape::IsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ TopTools_IndexedMapOfShape::IsEmpty方法的具体用法?C++ TopTools_IndexedMapOfShape::IsEmpty怎么用?C++ TopTools_IndexedMapOfShape::IsEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TopTools_IndexedMapOfShape
的用法示例。
在下文中一共展示了TopTools_IndexedMapOfShape::IsEmpty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Build
void FaceMakerExtrusion::Build()
{
this->NotDone();
this->myGenerated.Clear();
this->myShapesToReturn.clear();
this->myShape = TopoDS_Shape();
TopoDS_Shape inputShape;
if (mySourceShapes.empty())
throw Base::Exception("No input shapes!");
if (mySourceShapes.size() == 1){
inputShape = mySourceShapes[0];
} else {
TopoDS_Builder builder;
TopoDS_Compound cmp;
builder.MakeCompound(cmp);
for (const TopoDS_Shape& sh: mySourceShapes){
builder.Add(cmp, sh);
}
inputShape = cmp;
}
std::vector<TopoDS_Wire> wires;
TopTools_IndexedMapOfShape mapOfWires;
TopExp::MapShapes(inputShape, TopAbs_WIRE, mapOfWires);
// if there are no wires then check also for edges
if (mapOfWires.IsEmpty()) {
TopTools_IndexedMapOfShape mapOfEdges;
TopExp::MapShapes(inputShape, TopAbs_EDGE, mapOfEdges);
for (int i=1; i<=mapOfEdges.Extent(); i++) {
BRepBuilderAPI_MakeWire mkWire(TopoDS::Edge(mapOfEdges.FindKey(i)));
wires.push_back(mkWire.Wire());
}
}
else {
wires.reserve(mapOfWires.Extent());
for (int i=1; i<=mapOfWires.Extent(); i++) {
wires.push_back(TopoDS::Wire(mapOfWires.FindKey(i)));
}
}
if (!wires.empty()) {
//try {
TopoDS_Shape res = FaceMakerCheese::makeFace(wires);
if (!res.IsNull())
this->myShape = res;
//}
//catch (...) {
//}
}
this->Done();
}