use double precision
This commit is contained in:
parent
967963e180
commit
486a8136fd
24 changed files with 186 additions and 177 deletions
|
|
@ -6,17 +6,19 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
#include "pfaedle/trgraph/EdgePL.h"
|
||||
#include "util/geo/Geo.h"
|
||||
|
||||
using pfaedle::trgraph::EdgePL;
|
||||
using pfaedle::trgraph::TransitEdgeLine;
|
||||
using util::geo::DLine;
|
||||
|
||||
std::map<util::geo::FLine*, size_t> EdgePL::_flines;
|
||||
std::map<DLine*, size_t> EdgePL::_flines;
|
||||
std::map<const TransitEdgeLine*, size_t> EdgePL::_tlines;
|
||||
|
||||
// _____________________________________________________________________________
|
||||
EdgePL::EdgePL()
|
||||
: _length(0), _oneWay(0), _hasRestr(false), _rev(false), _lvl(0) {
|
||||
_l = new util::geo::FLine();
|
||||
_l = new DLine();
|
||||
_flines[_l] = 1;
|
||||
}
|
||||
|
||||
|
|
@ -33,7 +35,7 @@ EdgePL::EdgePL(const EdgePL& pl, bool geoflat)
|
|||
if (geoflat) {
|
||||
_l = pl._l;
|
||||
} else {
|
||||
_l = new util::geo::FLine(*pl._l);
|
||||
_l = new DLine(*pl._l);
|
||||
}
|
||||
_flines[_l]++;
|
||||
|
||||
|
|
@ -99,13 +101,13 @@ const std::set<const TransitEdgeLine*>& EdgePL::getLines() const {
|
|||
}
|
||||
|
||||
// _____________________________________________________________________________
|
||||
void EdgePL::addPoint(const util::geo::FPoint& p) { _l->push_back(p); }
|
||||
void EdgePL::addPoint(const util::geo::DPoint& p) { _l->push_back(p); }
|
||||
|
||||
// _____________________________________________________________________________
|
||||
const util::geo::FLine* EdgePL::getGeom() const { return _l; }
|
||||
const DLine* EdgePL::getGeom() const { return _l; }
|
||||
|
||||
// _____________________________________________________________________________
|
||||
util::geo::FLine* EdgePL::getGeom() { return _l; }
|
||||
DLine* EdgePL::getGeom() { return _l; }
|
||||
|
||||
// _____________________________________________________________________________
|
||||
util::json::Dict EdgePL::getAttrs() const {
|
||||
|
|
@ -160,7 +162,7 @@ void EdgePL::setRev() { _rev = true; }
|
|||
bool EdgePL::isRev() const { return _rev; }
|
||||
|
||||
// _____________________________________________________________________________
|
||||
const util::geo::FPoint& EdgePL::backHop() const {
|
||||
const util::geo::DPoint& EdgePL::backHop() const {
|
||||
if (isRev()) {
|
||||
return *(++(getGeom()->cbegin()));
|
||||
}
|
||||
|
|
@ -168,7 +170,7 @@ const util::geo::FPoint& EdgePL::backHop() const {
|
|||
}
|
||||
|
||||
// _____________________________________________________________________________
|
||||
const util::geo::FPoint& EdgePL::frontHop() const {
|
||||
const util::geo::DPoint& EdgePL::frontHop() const {
|
||||
if (isRev()) {
|
||||
return *(++(getGeom()->crbegin()));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue