Namespaces and formatting
This commit is contained in:
1 parent
42acea35bb
commit
eafe0b18f6
21 files changed
+493
-433
No files matched your search
@@ -34,7 +34,7 @@ namespace file
|
||||
{
|
||||
private:
|
||||
std::string designator;
|
||||
struct geodata::box bounds;
|
||||
struct utilities::geodata::box bounds;
|
||||
std::uint8_t width;
|
||||
std::uint16_t length;
|
||||
double trueHeading;
|
||||
@@ -49,52 +49,54 @@ namespace file
|
||||
double width)
|
||||
: designator(designator), width(width)
|
||||
{
|
||||
this->length = geodata::distanceEarthD(latitudeStart,
|
||||
longitudeStart,
|
||||
latitudeEnd,
|
||||
longitudeEnd);
|
||||
this->trueHeading = geodata::bearingDD(latitudeStart,
|
||||
longitudeStart,
|
||||
latitudeEnd,
|
||||
longitudeEnd);
|
||||
this->bounds =
|
||||
geodata::calculateBoxDD({latitudeStart, longitudeStart},
|
||||
{latitudeEnd, longitudeEnd},
|
||||
this->trueHeading,
|
||||
this->width);
|
||||
this->length = utilities::geodata::distanceEarthD(latitudeStart,
|
||||
longitudeStart,
|
||||
latitudeEnd,
|
||||
longitudeEnd);
|
||||
this->trueHeading = utilities::geodata::bearingDD(latitudeStart,
|
||||
longitudeStart,
|
||||
latitudeEnd,
|
||||
longitudeEnd);
|
||||
this->bounds = utilities::geodata::calculateBoxDD(
|
||||
{latitudeStart, longitudeStart},
|
||||
{latitudeEnd, longitudeEnd},
|
||||
this->trueHeading,
|
||||
this->width);
|
||||
};
|
||||
// From MakeRwys
|
||||
inline Runway(std::string designator,
|
||||
struct geodata::point start,
|
||||
struct utilities::geodata::point start,
|
||||
double width,
|
||||
double length,
|
||||
double trueHeading)
|
||||
: designator(designator), width(width), length(length),
|
||||
trueHeading(trueHeading)
|
||||
{
|
||||
geodata::point end =
|
||||
geodata::calculatePointDD(start, trueHeading, length);
|
||||
utilities::geodata::point end =
|
||||
utilities::geodata::calculatePointDD(start, trueHeading, length);
|
||||
|
||||
this->bounds =
|
||||
geodata::calculateBoxDD(start, end, trueHeading, width);
|
||||
this->bounds = utilities::geodata::calculateBoxDD(start,
|
||||
end,
|
||||
trueHeading,
|
||||
width);
|
||||
};
|
||||
// From database
|
||||
inline Runway(std::string designator,
|
||||
struct geodata::box bounds,
|
||||
struct utilities::geodata::box bounds,
|
||||
std::uint8_t width,
|
||||
std::uint16_t length,
|
||||
double trueHeading)
|
||||
: designator(designator), bounds(bounds), width(width),
|
||||
length(length), trueHeading(trueHeading){};
|
||||
|
||||
inline bool containsPoint(const geodata::point point) const
|
||||
inline bool containsPoint(const utilities::geodata::point point) const
|
||||
{
|
||||
size_t j = 3;
|
||||
bool c = false;
|
||||
std::vector<geodata::point> poly{this->bounds.topLeft,
|
||||
this->bounds.topRight,
|
||||
this->bounds.bottomRight,
|
||||
this->bounds.bottomLeft};
|
||||
std::vector<utilities::geodata::point> poly{this->bounds.topLeft,
|
||||
this->bounds.topRight,
|
||||
this->bounds.bottomRight,
|
||||
this->bounds.bottomLeft};
|
||||
|
||||
for (size_t i = 0; i < poly.size(); i++) {
|
||||
if ((point.latitude == poly[i].latitude) &&
|
||||
|
||||
Reference in new issue
Block a user