fix warning and improve code formatting

This commit is contained in:
wmayer 2017-01-09 10:16:11 +01:00
parent 61c3f2c8ad
commit f5367d7afc

View File

@ -194,28 +194,28 @@ void ImportOCAF::loadShapes(const TDF_Label& label, const TopLoc_Location& loc,
void ImportOCAF::createShape(const TDF_Label& label, const TopLoc_Location& loc, const std::string& name)
{
const TopoDS_Shape& aShape = aShapeTool->GetShape(label);
BRep_Builder aBuilder;
std::vector<App::DocumentObject*> lValue;
if (!aShape.IsNull() && aShape.ShapeType() == TopAbs_COMPOUND) {
TopExp_Explorer xp;
int ctSolids = 0, ctShells = 0;
Part::Compound *pcCompound = static_cast<Part::Compound*>(doc->addObject
Part::Compound *pcCompound = static_cast<Part::Compound*>(doc->addObject
("Part::Compound",name.c_str() ));
for (xp.Init(aShape, TopAbs_SOLID); xp.More(); xp.Next(), ctSolids++)
createShape(xp.Current(), loc, name, lValue);
for (xp.Init(aShape, TopAbs_SHELL, TopAbs_SOLID); xp.More(); xp.Next(), ctShells++)
createShape(xp.Current(), loc, name, lValue);
pcCompound->Links.setValues(lValue);
pcCompound->Links.setValues(lValue);
if (ctSolids > 0 || ctShells > 0)
return;
}
createShape(aShape, loc, name,lValue);
createShape(aShape, loc, name, lValue);
}
void ImportOCAF::createShape(const TopoDS_Shape& aShape, const TopLoc_Location& loc, const std::string& name,std::vector<App::DocumentObject*>& lvalue)
void ImportOCAF::createShape(const TopoDS_Shape& aShape, const TopLoc_Location& loc, const std::string& name,
std::vector<App::DocumentObject*>& lvalue)
{
Part::Feature* part = static_cast<Part::Feature*>(doc->addObject("Part::Feature"));
if (!loc.IsIdentity())