+ allow to select whole wire in sweep panel

This commit is contained in:
wmayer 2014-05-23 19:27:14 +02:00
parent 2313c5d757
commit 91ad22e3ab

View File

@ -75,10 +75,25 @@ public:
} }
bool allow(App::Document*pDoc, App::DocumentObject*pObj, const char*sSubName) bool allow(App::Document*pDoc, App::DocumentObject*pObj, const char*sSubName)
{ {
if (!sSubName || sSubName[0] == '\0') if (pObj->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId())) {
return false; if (!sSubName) {
std::string element(sSubName); // If selecting again the same edge the passed sub-element is empty. If the whole
return element.substr(0,4) == "Edge"; // 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;
} }
}; };
}; };