Add placefile parsing for Triangles and Polygon

This commit is contained in:
Dan Paulat 2023-08-07 23:52:29 -05:00
parent 4fcfb54890
commit d9a53ea8d7
2 changed files with 172 additions and 2 deletions

View file

@ -2,6 +2,7 @@
#include <istream>
#include <memory>
#include <optional>
#include <string>
#include <vector>
@ -120,6 +121,44 @@ public:
std::vector<Element> elements_ {};
};
struct TrianglesDrawItem : DrawItem
{
TrianglesDrawItem() { itemType_ = ItemType::Triangles; }
boost::gil::rgba8_pixel_t color_ {};
struct Element
{
double latitude_ {};
double longitude_ {};
double x_ {};
double y_ {};
std::optional<boost::gil::rgba8_pixel_t> color_ {};
};
std::vector<Element> elements_ {};
};
struct PolygonDrawItem : DrawItem
{
PolygonDrawItem() { itemType_ = ItemType::Polygon; }
boost::gil::rgba8_pixel_t color_ {};
struct Element
{
double latitude_ {};
double longitude_ {};
double x_ {};
double y_ {};
std::optional<boost::gil::rgba8_pixel_t> color_ {};
};
std::vector<std::vector<Element>> contours_ {};
};
bool IsValid() const;
/**