Part: Set per-face transparency in boolean ops - fixes #1029,#2806

This commit is contained in:
Yorik van Havre
2017-02-10 21:53:57 -02:00
parent c986ebfe75
commit bc6b3914cb
3 changed files with 20 additions and 0 deletions

View File

@@ -78,6 +78,20 @@ void ViewProviderPart::applyColor(const Part::ShapeHistory& hist,
}
}
void ViewProviderPart::applyTransparency(const float& transparency,
std::vector<App::Color>& colors)
{
if (transparency != 0.0) {
// transparency has been set object-wide
std::vector<App::Color>::iterator j;
for (j = colors.begin(); j != colors.end(); ++j) {
// transparency hasn't been set for this face
if (j->a == 0.0)
j->a = transparency/100.0; // transparency comes in percent
}
}
}
// ----------------------------------------------------------------------------
void ViewProviderShapeBuilder::buildNodes(const App::Property* , std::vector<SoNode*>& ) const