Point cloud display mode enumeration

After point cloud is imported and saved to a file, opening such file introduces issue with point cloud feature display mode property.

Forum discussion:
https://forum.freecadweb.org/viewtopic.php?f=3&t=32808
This commit is contained in:
triplus
2018-12-23 01:41:16 +01:00
committed by wmayer
parent 80c1f70af9
commit 17bdbb157e

View File

@@ -242,21 +242,23 @@ std::vector<std::string> ViewProviderPoints::getDisplayModes(void) const
{
std::vector<std::string> StrList;
StrList.push_back("Points");
StrList.push_back("Color");
StrList.push_back("Shaded");
if (pcObject) {
std::map<std::string,App::Property*> Map;
pcObject->getPropertyMap(Map);
// if (pcObject) {
// std::map<std::string,App::Property*> Map;
// pcObject->getPropertyMap(Map);
for (std::map<std::string,App::Property*>::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<std::string,App::Property*>::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");
// }
// }
return StrList;
}