Skip to content

Commit

Permalink
+ allow to select whole wire in sweep panel
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed May 23, 2014
1 parent 2313c5d commit 91ad22e
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions src/Mod/Part/Gui/TaskSweep.cpp
Expand Up @@ -75,10 +75,25 @@ class SweepWidget::Private
}
bool allow(App::Document*pDoc, App::DocumentObject*pObj, const char*sSubName)
{
if (!sSubName || sSubName[0] == '\0')
return false;
std::string element(sSubName);
return element.substr(0,4) == "Edge";
if (pObj->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId())) {
if (!sSubName) {
// If selecting again the same edge the passed sub-element is empty. If the whole
// shape is an edge or wire we can use it completely.
const TopoDS_Shape& shape = static_cast<Part::Feature*>(pObj)->Shape.getValue();
if (!shape.IsNull()) {
if (shape.ShapeType() == TopAbs_EDGE)
return true;
if (shape.ShapeType() == TopAbs_WIRE)
return true;
}
}
else {
std::string element(sSubName);
return element.substr(0,4) == "Edge";
}
}

return false;
}
};
};
Expand Down

0 comments on commit 91ad22e

Please sign in to comment.