Some code unification for DressUp features

This commit is contained in:
jrheinlaender
2013-09-26 21:11:54 +02:00
committed by Stefan Tröger
parent 3d4c853def
commit dbc6b1b12e
7 changed files with 335 additions and 33 deletions

View File

@@ -32,6 +32,7 @@
#endif
#include <Base/Console.h>
#include <Base/Exception.h>
#include <Base/Reader.h>
#include <Mod/Part/App/TopoShape.h>
@@ -61,17 +62,12 @@ short Fillet::mustExecute() const
App::DocumentObjectExecReturn *Fillet::execute(void)
{
App::DocumentObject* link = BaseFeature.getValue();
if (!link)
link = Base.getValue(); // For legacy features
if (!link)
return new App::DocumentObjectExecReturn("No object linked");
if (!link->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId()))
return new App::DocumentObjectExecReturn("Linked object is not a Part object");
Part::Feature *base = static_cast<Part::Feature*>(link);
const Part::TopoShape& TopShape = base->Shape.getShape();
if (TopShape._Shape.IsNull())
return new App::DocumentObjectExecReturn("Cannot fillet invalid shape");
Part::TopoShape TopShape;
try {
TopShape = getBaseShape();
} catch (Base::Exception& e) {
return new App::DocumentObjectExecReturn(e.what());
}
const std::vector<std::string>& SubVals = Base.getSubValuesStartsWith("Edge");
if (SubVals.size() == 0)