fix material binding of indexed lineset when highlighting an edge

This commit is contained in:
wmayer
2017-04-17 19:02:11 +02:00
parent ceb519b737
commit 4866d3595f
2 changed files with 4 additions and 5 deletions

View File

@@ -709,7 +709,8 @@ void ViewProviderPartExt::setHighlightedEdges(const std::vector<App::Color>& col
{
int size = static_cast<int>(colors.size());
if (size > 1) {
pcLineBind->value = SoMaterialBinding::PER_PART;
// Although indexed lineset is used the material binding must be PER_FACE!
pcLineBind->value = SoMaterialBinding::PER_FACE;
const int32_t* cindices = this->lineset->coordIndex.getValues(0);
int numindices = this->lineset->coordIndex.getNum();
pcLineMaterial->diffuseColor.setNum(size);
@@ -735,6 +736,7 @@ void ViewProviderPartExt::setHighlightedEdges(const std::vector<App::Color>& col
void ViewProviderPartExt::unsetHighlightedEdges()
{
pcLineBind->value = SoMaterialBinding::OVERALL;
LineMaterial.touch();
}

View File

@@ -153,10 +153,7 @@ void ViewProviderGeomFillSurface::highlightReferences(bool on)
svp->setHighlightedEdges(colors);
}
else {
std::vector<App::Color> colors;
colors.push_back(svp->LineColor.getValue());
svp->setHighlightedEdges(colors);
//svp->unsetHighlightedEdges();
svp->unsetHighlightedEdges();
}
}
}