Mod: code cleanup

This commit is contained in:
wmayer
2024-04-06 02:08:27 +02:00
parent 9c368d8916
commit 36d043cbbd
2 changed files with 14 additions and 20 deletions

View File

@@ -353,7 +353,6 @@ ViewProviderMesh::~ViewProviderMesh()
void ViewProviderMesh::onChanged(const App::Property* prop)
{
// we're going to change the number of colors to one
// if (prop == &ShapeAppearance || prop == &ShapeMaterial) {
if (prop == &ShapeAppearance) {
pcMatBinding->value = SoMaterialBinding::OVERALL;
}
@@ -397,9 +396,6 @@ void ViewProviderMesh::onChanged(const App::Property* prop)
if (prop == &ShapeAppearance) {
setOpenEdgeColorFrom(ShapeAppearance.getDiffuseColor());
}
// else if (prop == &ShapeMaterial) {
// setOpenEdgeColorFrom(ShapeMaterial.getValue().diffuseColor);
// }
}
ViewProviderGeometryObject::onChanged(prop);

View File

@@ -716,22 +716,20 @@ void PartGui::DlgProjectionOnSurface::higlight_object(Part::Feature* iCurrentObj
}
auto index = anIndices.FindIndex(currentShape);
//set color
PartGui::ViewProviderPartExt* vp = dynamic_cast<PartGui::ViewProviderPartExt*>(Gui::Application::Instance->getViewProvider(iCurrentObject));
if (vp)
{
std::vector<App::Color> colors;
App::Color defaultColor;
if (currentShapeType == TopAbs_FACE)
{
colors = vp->DiffuseColor.getValues();
defaultColor = vp->ShapeAppearance.getDiffuseColor();
}
else if ( currentShapeType == TopAbs_EDGE )
{
colors = vp->LineColorArray.getValues();
defaultColor = vp->LineColor.getValue();
}
// set color
auto vp = dynamic_cast<PartGui::ViewProviderPartExt*>(
Gui::Application::Instance->getViewProvider(iCurrentObject));
if (vp) {
std::vector<App::Color> colors;
App::Color defaultColor;
if (currentShapeType == TopAbs_FACE) {
colors = vp->DiffuseColor.getValues();
defaultColor = vp->ShapeAppearance.getDiffuseColor();
}
else if (currentShapeType == TopAbs_EDGE) {
colors = vp->LineColorArray.getValues();
defaultColor = vp->LineColor.getValue();
}
if (static_cast<Standard_Integer>(colors.size()) != anIndices.Extent()) {
colors.resize(anIndices.Extent(), defaultColor);