+ fix bug when part and faces of this part have colors defined in STEP file
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5394 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
parent
99400671f5
commit
b167bd89ae
|
@ -127,15 +127,19 @@ private:
|
||||||
part->Shape.setValue(shape);
|
part->Shape.setValue(shape);
|
||||||
std::map<Standard_Integer, Quantity_Color>::const_iterator jt;
|
std::map<Standard_Integer, Quantity_Color>::const_iterator jt;
|
||||||
jt = myColorMap.find(shape.HashCode(INT_MAX));
|
jt = myColorMap.find(shape.HashCode(INT_MAX));
|
||||||
if (jt != myColorMap.end()) {
|
|
||||||
Gui::ViewProvider* vp = Gui::Application::Instance->getViewProvider(part);
|
App::Color partColor(0.8f,0.8f,0.8f);
|
||||||
if (vp && vp->isDerivedFrom(PartGui::ViewProviderPart::getClassTypeId())) {
|
Gui::ViewProvider* vp = Gui::Application::Instance->getViewProvider(part);
|
||||||
|
if (vp && vp->isDerivedFrom(PartGui::ViewProviderPart::getClassTypeId())) {
|
||||||
|
if (jt != myColorMap.end()) {
|
||||||
App::Color color;
|
App::Color color;
|
||||||
color.r = jt->second.Red();
|
color.r = jt->second.Red();
|
||||||
color.g = jt->second.Green();
|
color.g = jt->second.Green();
|
||||||
color.b = jt->second.Blue();
|
color.b = jt->second.Blue();
|
||||||
static_cast<PartGui::ViewProviderPart*>(vp)->ShapeColor.setValue(color);
|
static_cast<PartGui::ViewProviderPart*>(vp)->ShapeColor.setValue(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
partColor = static_cast<PartGui::ViewProviderPart*>(vp)->ShapeColor.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
// set label name if defined
|
// set label name if defined
|
||||||
|
@ -158,7 +162,7 @@ private:
|
||||||
|
|
||||||
bool found_face_color = false;
|
bool found_face_color = false;
|
||||||
std::vector<App::Color> faceColors;
|
std::vector<App::Color> faceColors;
|
||||||
faceColors.resize(faces.Extent(), App::Color(0.8f,0.8f,0.8f));
|
faceColors.resize(faces.Extent(), partColor);
|
||||||
xp.Init(shape,TopAbs_FACE);
|
xp.Init(shape,TopAbs_FACE);
|
||||||
while (xp.More()) {
|
while (xp.More()) {
|
||||||
jt = myColorMap.find(xp.Current().HashCode(INT_MAX));
|
jt = myColorMap.find(xp.Current().HashCode(INT_MAX));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user