+ fixes #0001547: add Part Spiral to the selectable list of profiles for a Part Loft

This commit is contained in:
wmayer
2014-05-15 12:37:39 +02:00
parent f68760fbae
commit a95408780b
3 changed files with 57 additions and 4 deletions

View File

@@ -26,6 +26,7 @@
#ifndef _PreComp_
# include <QMessageBox>
# include <QTextStream>
# include <TopoDS_Iterator.hxx>
#endif
#include "ui_TaskLoft.h"
@@ -95,9 +96,23 @@ void LoftWidget::findShapes()
std::vector<Part::Feature*> objs = activeDoc->getObjectsOfType<Part::Feature>();
for (std::vector<Part::Feature*>::iterator it = objs.begin(); it!=objs.end(); ++it) {
const TopoDS_Shape& shape = (*it)->Shape.getValue();
TopoDS_Shape shape = (*it)->Shape.getValue();
if (shape.IsNull()) continue;
// also allow compounds with a single face, wire, edge or vertex
if (shape.ShapeType() == TopAbs_COMPOUND) {
TopoDS_Iterator it(shape);
int numChilds=0;
TopoDS_Shape child;
for (; it.More(); it.Next(), numChilds++) {
if (!it.Value().IsNull())
child = it.Value();
}
if (numChilds == 1)
shape = child;
}
if (shape.ShapeType() == TopAbs_FACE ||
shape.ShapeType() == TopAbs_WIRE ||
shape.ShapeType() == TopAbs_EDGE ||