Refactoring _Coordinate class
This commit is contained in:
@@ -32,7 +32,10 @@ inline double DescriptionFactory::RadianToDegree(const double radian) const {
|
||||
return radian * (180/M_PI);
|
||||
}
|
||||
|
||||
double DescriptionFactory::GetBearing(const _Coordinate& A, const _Coordinate& B) const {
|
||||
double DescriptionFactory::GetBearing(
|
||||
const FixedPointCoordinate & A,
|
||||
const FixedPointCoordinate & B
|
||||
) const {
|
||||
double deltaLong = DegreeToRadian(B.lon/COORDINATE_PRECISION - A.lon/COORDINATE_PRECISION);
|
||||
|
||||
double lat1 = DegreeToRadian(A.lat/COORDINATE_PRECISION);
|
||||
@@ -59,7 +62,7 @@ void DescriptionFactory::SetEndSegment(const PhantomNode & _targetPhantom) {
|
||||
pathDescription.push_back(SegmentInformation(_targetPhantom.location, _targetPhantom.nodeBasedEdgeNameID, 0, _targetPhantom.weight1, 0, true) );
|
||||
}
|
||||
|
||||
void DescriptionFactory::AppendSegment(const _Coordinate & coordinate, const _PathData & data ) {
|
||||
void DescriptionFactory::AppendSegment(const FixedPointCoordinate & coordinate, const _PathData & data ) {
|
||||
if(1 == pathDescription.size() && pathDescription.back().location == coordinate) {
|
||||
pathDescription.back().nameID = data.nameID;
|
||||
} else {
|
||||
|
||||
@@ -63,10 +63,10 @@ public:
|
||||
std::vector <SegmentInformation> pathDescription;
|
||||
DescriptionFactory();
|
||||
virtual ~DescriptionFactory();
|
||||
double GetBearing(const _Coordinate& C, const _Coordinate& B) const;
|
||||
double GetBearing(const FixedPointCoordinate& C, const FixedPointCoordinate& B) const;
|
||||
void AppendEncodedPolylineString(std::string &output);
|
||||
void AppendUnencodedPolylineString(std::string &output);
|
||||
void AppendSegment(const _Coordinate & coordinate, const _PathData & data);
|
||||
void AppendSegment(const FixedPointCoordinate & coordinate, const _PathData & data);
|
||||
void BuildRouteSummary(const double distance, const unsigned time);
|
||||
void SetStartSegment(const PhantomNode & startPhantom);
|
||||
void SetEndSegment(const PhantomNode & startPhantom);
|
||||
|
||||
@@ -28,7 +28,7 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
||||
class GPXDescriptor : public BaseDescriptor{
|
||||
private:
|
||||
_DescriptorConfig config;
|
||||
_Coordinate current;
|
||||
FixedPointCoordinate current;
|
||||
|
||||
std::string tmp;
|
||||
public:
|
||||
|
||||
@@ -39,7 +39,7 @@ private:
|
||||
_DescriptorConfig config;
|
||||
DescriptionFactory descriptionFactory;
|
||||
DescriptionFactory alternateDescriptionFactory;
|
||||
_Coordinate current;
|
||||
FixedPointCoordinate current;
|
||||
unsigned numberOfEnteredRestrictedAreas;
|
||||
struct RoundAbout{
|
||||
RoundAbout() :
|
||||
|
||||
Reference in New Issue
Block a user