Print out topo and geo struct to stream
parent
5694ce1ffc
commit
4be78ea488
|
@ -1,5 +1,8 @@
|
|||
#include "CoordGeodetic.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
|
||||
CoordGeodetic::CoordGeodetic(const CoordGeodetic& b) {
|
||||
|
||||
latitude = b.latitude;
|
||||
|
@ -39,3 +42,13 @@ bool CoordGeodetic::operator !=(const CoordGeodetic& b) const {
|
|||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
std::ostream& operator<< (std::ostream& stream, const CoordGeodetic& geo) {
|
||||
std::stringstream out;
|
||||
out << std::right << std::fixed << std::setprecision(2);
|
||||
out << "Lat: " << std::setw(7) << geo.latitude;
|
||||
out << ", Lon: " << std::setw(7) << geo.longitude;
|
||||
out << ", Alt: " << std::setw(9) << geo.altitude;
|
||||
stream << out.str();
|
||||
return stream;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#ifndef COORDGEODETIC_H_
|
||||
#define COORDGEODETIC_H_
|
||||
|
||||
#include <iostream>
|
||||
|
||||
struct CoordGeodetic {
|
||||
public:
|
||||
|
||||
|
@ -24,6 +26,8 @@ public:
|
|||
bool operator ==(const CoordGeodetic& b) const;
|
||||
bool operator !=(const CoordGeodetic& b) const;
|
||||
|
||||
friend std::ostream& operator<< (std::ostream& stream, const CoordGeodetic& geo);
|
||||
|
||||
/*
|
||||
* radians (north positive, south negative)
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
#include "CoordTopographic.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
|
||||
CoordTopographic::CoordTopographic(const CoordTopographic& b) {
|
||||
|
||||
azimuth = b.azimuth;
|
||||
|
@ -44,6 +47,15 @@ bool CoordTopographic::operator !=(const CoordTopographic& b) const {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
std::ostream& operator<< (std::ostream& stream, const CoordTopographic& topo) {
|
||||
std::stringstream out;
|
||||
out << std::right << std::fixed << std::setprecision(2);
|
||||
out << "Az: " << std::setw(7) << topo.azimuth;
|
||||
out << ", El: " << std::setw(7) << topo.elevation;
|
||||
out << ", Range: " << std::setw(9) << topo.range;
|
||||
out << ", RangeRate: " << std::setw(6) << topo.range_rate;
|
||||
stream << out.str();
|
||||
return stream;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#ifndef COORDTOPOGRAPHIC_H_
|
||||
#define COORDTOPOGRAPHIC_H_
|
||||
|
||||
#include <iostream>
|
||||
|
||||
struct CoordTopographic {
|
||||
public:
|
||||
|
||||
|
@ -20,6 +22,8 @@ public:
|
|||
CoordTopographic & operator =(const CoordTopographic& b);
|
||||
bool operator ==(const CoordTopographic& b) const;
|
||||
bool operator !=(const CoordTopographic& b) const;
|
||||
|
||||
friend std::ostream& operator<< (std::ostream& stream, const CoordTopographic& topo);
|
||||
|
||||
/*
|
||||
* radians
|
||||
|
|
Loading…
Reference in New Issue