fixes 0003729: REGRESSION: FreeCAD 0.17 does not export color information with STEP files
This commit is contained in:
@@ -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) ||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user