Ref T786, smaller improvements

* allow to use ICoordinateGeodetic, not the CCoordinateGeodetic implementation only
* allow to init weather grid by initial ICoordinateGeodetic
This commit is contained in:
Klaus Basan
2020-04-21 15:37:33 +02:00
committed by Mat Sutcliffe
parent 9235f3232e
commit e63129267d
5 changed files with 16 additions and 7 deletions

View File

@@ -21,13 +21,13 @@ namespace BlackMisc
namespace Weather
{
CGridPoint::CGridPoint(const QString &identifier,
const Geo::CCoordinateGeodetic &position) :
const ICoordinateGeodetic &position) :
m_identifier(identifier),
m_position(position)
{ }
CGridPoint::CGridPoint(const QString &identifier,
const Geo::CCoordinateGeodetic &position,
const Geo::ICoordinateGeodetic &position,
const CCloudLayerList &cloudLayers,
const CTemperatureLayerList &temperatureLayers,
const CVisibilityLayerList &visibilityLayers,

View File

@@ -54,11 +54,11 @@ namespace BlackMisc
//! Constructor
CGridPoint(const QString &identifier,
const Geo::CCoordinateGeodetic &position);
const Geo::ICoordinateGeodetic &position);
//! Constructor
CGridPoint(const QString &identifier,
const Geo::CCoordinateGeodetic &position,
const Geo::ICoordinateGeodetic &position,
const CCloudLayerList &cloudLayers,
const CTemperatureLayerList &temperatureLayers,
const CVisibilityLayerList &visibilityLayers,

View File

@@ -41,6 +41,12 @@ namespace BlackMisc
CSequence<CGridPoint>(other)
{ }
CWeatherGrid::CWeatherGrid(const ICoordinateGeodetic &coordinate)
{
const CGridPoint p("GLOB", coordinate);
this->push_back(p);
}
CWeatherGrid CWeatherGrid::findWithinRange(const ICoordinateGeodetic &coordinate, const PhysicalQuantities::CLength &range) const
{
return findBy([&](const CGridPoint & gridPoint)
@@ -162,7 +168,7 @@ namespace BlackMisc
static const CGridPoint gridPointGLOB =
{
"GLOB",
{},
CCoordinateGeodetic::null(),
CCloudLayerList { cloudLayer },
CTemperatureLayerList { temperatureLayer },
CVisibilityLayerList { visibilityLayer },
@@ -214,7 +220,7 @@ namespace BlackMisc
static const CGridPoint gridPointGLOB
{
"GLOB",
{},
CCoordinateGeodetic::null(),
CCloudLayerList { cloudLayer1, cloudLayer2 },
CTemperatureLayerList { temperatureLayer },
CVisibilityLayerList { visibilityLayer },

View File

@@ -43,6 +43,9 @@ namespace BlackMisc
//! Construct from a base class object.
CWeatherGrid(const CSequence<CGridPoint> &other);
//! Grid with an initial point at coordinates given
CWeatherGrid(const BlackMisc::Geo::ICoordinateGeodetic &coordinate);
//! \copydoc Geo::IGeoObjectList::findWithinRange
CWeatherGrid findWithinRange(const BlackMisc::Geo::ICoordinateGeodetic &coordinate, const BlackMisc::PhysicalQuantities::CLength &range) const;