Gui: use MarkerBitmaps::getSupportedSizes to get available sizes
This commit is contained in:
@@ -1462,7 +1462,7 @@ PyObject* Application::sGetMarkerIndex(PyObject * /*self*/, PyObject *args)
|
||||
marker_arg = (*markerStyle).second;
|
||||
|
||||
//get the marker size
|
||||
int sizeList[]={5, 7, 9};
|
||||
auto sizeList = Gui::Inventor::MarkerBitmaps::getSupportedSizes(marker_arg);
|
||||
|
||||
if (std::find(std::begin(sizeList), std::end(sizeList), defSize) == std::end(sizeList))
|
||||
defSize = 9;
|
||||
|
||||
@@ -1231,8 +1231,9 @@ std::list<int> MarkerBitmaps::getSupportedSizes(const std::string& name)
|
||||
{
|
||||
std::list<int> sizes;
|
||||
for (const auto & it : markerIndex) {
|
||||
if (it.first.first == name)
|
||||
if (it.first.first == name) {
|
||||
sizes.push_back(it.first.second);
|
||||
}
|
||||
}
|
||||
return sizes;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <FCGlobal.h>
|
||||
|
||||
|
||||
namespace Gui { namespace Inventor {
|
||||
@@ -42,7 +43,7 @@ private:
|
||||
|
||||
private:
|
||||
using Marker = std::pair<std::string, int>;
|
||||
static std::map<Marker, int> markerIndex;
|
||||
static std::map<Marker, int> markerIndex; // NOLINT
|
||||
};
|
||||
|
||||
} // namespace Inventor
|
||||
|
||||
Reference in New Issue
Block a user