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

@@ -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);