diff --git a/src/Mod/Points/Gui/ViewProvider.cpp b/src/Mod/Points/Gui/ViewProvider.cpp index 1517cd2dfa..55931ccbc4 100644 --- a/src/Mod/Points/Gui/ViewProvider.cpp +++ b/src/Mod/Points/Gui/ViewProvider.cpp @@ -242,24 +242,32 @@ std::vector ViewProviderPoints::getDisplayModes(void) const { std::vector StrList; StrList.push_back("Points"); + + // FIXME: This way all display modes are added even if the points feature + // doesn't support it. + // For the future a more flexible way is needed to add new display modes + // at a later time +#if 1 StrList.push_back("Color"); StrList.push_back("Shaded"); StrList.push_back("Intensity"); - // if (pcObject) { - // std::map Map; - // pcObject->getPropertyMap(Map); +#else + if (pcObject) { + std::map Map; + pcObject->getPropertyMap(Map); - // for (std::map::iterator it = Map.begin(); it != Map.end(); ++it) { - // Base::Type type = it->second->getTypeId(); - // if (type == Points::PropertyNormalList::getClassTypeId()) - //~ StrList.push_back("Shaded"); - // else if (type == Points::PropertyGreyValueList::getClassTypeId()) - //~ StrList.push_back("Intensity"); - // else if (type == App::PropertyColorList::getClassTypeId()) - //~ StrList.push_back("Color"); - // } - // } + for (std::map::iterator it = Map.begin(); it != Map.end(); ++it) { + Base::Type type = it->second->getTypeId(); + if (type == Points::PropertyNormalList::getClassTypeId()) + StrList.push_back("Shaded"); + else if (type == Points::PropertyGreyValueList::getClassTypeId()) + StrList.push_back("Intensity"); + else if (type == App::PropertyColorList::getClassTypeId()) + StrList.push_back("Color"); + } + } +#endif return StrList; }