Render placefile Place statement

This commit is contained in:
Dan Paulat 2023-07-20 23:38:43 -05:00
parent 1c39464228
commit 9f5de14f6b
5 changed files with 148 additions and 29 deletions

View file

@ -10,8 +10,6 @@
#include <boost/algorithm/string.hpp>
#include <boost/units/base_units/metric/nautical_mile.hpp>
#include <boost/units/quantity.hpp>
#include <boost/units/systems/si/length.hpp>
namespace scwx
{
@ -42,21 +40,6 @@ public:
double y_ {};
};
struct DrawItem
{
boost::units::quantity<boost::units::si::length> threshold_ {};
};
struct PlaceDrawItem : DrawItem
{
boost::gil::rgba8_pixel_t color_ {};
double latitude_ {};
double longitude_ {};
double x_ {};
double y_ {};
std::string text_ {};
};
void ParseLocation(const std::string& latitudeToken,
const std::string& longitudeToken,
double& latitude,
@ -93,6 +76,11 @@ bool Placefile::IsValid() const
return p->drawItems_.size() > 0;
}
std::vector<std::shared_ptr<Placefile::DrawItem>> Placefile::GetDrawItems()
{
return p->drawItems_;
}
std::shared_ptr<Placefile> Placefile::Load(const std::string& filename)
{
logger_->debug("Loading placefile: {}", filename);