fixes 0003729: REGRESSION: FreeCAD 0.17 does not export color information with STEP files

This commit is contained in:
wmayer
2018-12-24 17:27:56 +01:00
parent 8801726ed4
commit 9c7128ea77
2 changed files with 8 additions and 2 deletions

View File

@@ -288,8 +288,6 @@ void ImportOCAF::createShape(const TDF_Label& label, const TopLoc_Location& loc,
task_group g;
#endif
App::Color color(0.8f,0.8f,0.8f);
std::vector<App::Color> colors;
if (!aShape.IsNull() && aShape.ShapeType() == TopAbs_COMPOUND) {
TopExp_Explorer xp;
int ctSolids = 0, ctShells = 0, ctVertices = 0, ctEdges = 0;
@@ -376,6 +374,8 @@ void ImportOCAF::createShape(const TDF_Label& label, const TopLoc_Location& loc,
part->Shape.setValue(comp);
part->Label.setValue(name);
lValue.push_back(part);
loadColors(part, aShape);
}
}
else {
@@ -433,6 +433,11 @@ void ImportOCAF::createShape(const TopoDS_Shape& aShape, const TopLoc_Location&
part->Label.setValue(name);
lvalue.push_back(part);
loadColors(part, aShape);
}
void ImportOCAF::loadColors(Part::Feature* part, const TopoDS_Shape& aShape)
{
Quantity_Color aColor;
App::Color color(0.8f,0.8f,0.8f);
if (aColorTool->GetColor(aShape, XCAFDoc_ColorGen, aColor) ||

View File

@@ -64,6 +64,7 @@ private:
void loadShapes(const TDF_Label& label, const TopLoc_Location&, const std::string& partname, const std::string& assembly, bool isRef, std::vector<App::DocumentObject*> &);
void createShape(const TDF_Label& label, const TopLoc_Location&, const std::string&, std::vector<App::DocumentObject*> &, bool);
void createShape(const TopoDS_Shape& label, const TopLoc_Location&, const std::string&, std::vector<App::DocumentObject*> &);
void loadColors(Part::Feature* part, const TopoDS_Shape& aShape);
virtual void applyColors(Part::Feature*, const std::vector<App::Color>&){}
private: