21 #ifndef PF_WAYPOINT_COLLECTION_H
22 #define PF_WAYPOINT_COLLECTION_H
24 #include "../Math_LIB/MPath.h"
25 #include "../CD_LIB/CDGrid.h"
27 namespace OpenSkyNet {
39 if (p1_.
x() < p2_.
x())
return true;
40 else if (p1_.
x() > p2_.
x())
return false;
41 else if (p1_.
y() < p2_.
y())
return true;
42 else if (p1_.
y() > p2_.
y())
return false;
43 else if (p1_.
z() < p2_.
z())
return true;
44 else if (p1_.
z() > p2_.
z())
return false;
63 std::vector<WhoGoesWhereDef*>
_defs;
78 static_cast<int>(floor((_maxCorner.
y() - pos_.
y())/_binSize.
y())),
79 static_cast<int>(floor((_maxCorner.
z() - pos_.
z())/_binSize.
z())));
86 if ((((((wPCBin_.
x() < 0) || (wPCBin_.
y() < 0)) || (wPCBin_.
z() < 0)) ||
87 (wPCBin_.
x() >=
static_cast<int>(_axisDivisions.
x()))) ||
88 (wPCBin_.
y() >=
static_cast<int>(_axisDivisions.
y()))) ||
89 (wPCBin_.
z() >=
static_cast<int>(_axisDivisions.
z())))
97 wPCBin.
x() = wPCBin.
x() < 0 ? 0 : wPCBin.
x();
98 wPCBin.
y() = wPCBin.
y() < 0 ? 0 : wPCBin.
y();
99 wPCBin.
z() = wPCBin.
z() < 0 ? 0 : wPCBin.
z();
102 static_cast<Utils::uint>(wPCBin.
y()) >= _axisDivisions.
y() ? _axisDivisions.
y()-1 : wPCBin.
y(),
103 static_cast<Utils::uint>(wPCBin.
z()) >= _axisDivisions.
z() ? _axisDivisions.
z()-1 : wPCBin.
z());
110 gridBinCenter -= grid_->
getBinSize()*gridBin_;
119 if ((((((wPCBin_.
x() < 0) || (wPCBin_.
y() < 0)) || (wPCBin_.
z() < 0)) ||
120 (wPCBin_.
x() >=
static_cast<int>(_axisDivisions.
x()))) ||
121 (wPCBin_.
y() >=
static_cast<int>(_axisDivisions.
y()))) ||
122 (wPCBin_.
z() >=
static_cast<int>(_axisDivisions.
z())))
130 wPCBin.
x() = wPCBin.
x() < 0 ? 0 : wPCBin.
x();
131 wPCBin.
y() = wPCBin.
y() < 0 ? 0 : wPCBin.
y();
132 wPCBin.
z() = wPCBin.
z() < 0 ? 0 : wPCBin.
z();
135 static_cast<Utils::uint>(wPCBin.
y()) >= _axisDivisions.
y() ? _axisDivisions.
y()-1 : wPCBin.
y(),
136 static_cast<Utils::uint>(wPCBin.
z()) >= _axisDivisions.
z() ? _axisDivisions.
z()-1 : wPCBin.
z());
168 #endif //PF_WAYPOINT_COLLECTION_H
const Math::Point< Utils::uint > & getAxisDivs() const
Definition: PFWaypointCollection.h:159
std::set< Math::Point< int >, lessThan > _targBins
Definition: PFWaypointCollection.h:51
bool findTargBin(const Math::Point< int > &targBin_) const
Definition: PFWaypointCollection.h:59
std::vector< Math::Point<> > _pathPoints
Definition: PFWaypointCollection.h:52
Math::Point< int > getNearestWPCBin(const Math::Point< int > &gridBin_, const CD::Grid *grid_) const
Definition: PFWaypointCollection.h:128
std::vector< WhoGoesWhereDef * > _defs
Definition: PFWaypointCollection.h:63
T & y()
Definition: MPoint.h:65
T & x()
Definition: MPoint.h:64
bool getWPCBin(const Math::Point< int > &gridBin_, const CD::Grid *grid_, Math::Point< int > &wPCBin_) const
Definition: PFWaypointCollection.h:116
const Math::Point & getMaxCorner() const
Definition: CDGrid.h:228
Definition: PFWaypointCollection.h:34
bool operator()(const Math::Point< int > &p1_, const Math::Point< int > &p2_) const
Definition: PFWaypointCollection.h:38
Math::Point< int > getWPCBin(const Math::Point< int > &gridBin_, const CD::Grid *grid_) const
Definition: PFWaypointCollection.h:108
const Math::Point & getBinSize() const
Definition: CDGrid.h:242
const Math::Point & getSize() const
Definition: PFWaypointCollection.h:156
Math::Point< int > getWPCBin(const Math::Point<> &pos_) const
Definition: PFWaypointCollection.h:76
Definition: PFWaypointCollection.h:37
int getWGWDIndex(Math::Point< int > &drivBin_, Math::Point< int > &targBin_, const CD::Grid *grid_) const
std::set< Math::Point< int >, lessThan > _drivBins
Definition: PFWaypointCollection.h:50
unsigned int uint
Definition: UTypes.h:39
T & z()
Definition: MPoint.h:66
bool findBin(const Math::Point< int > &bin_, const std::set< Math::Point< int >, lessThan > &bins_) const
Definition: PFWaypointCollection.h:49
void loadWPC(const char *wPC_)
bool getWPCBin(const Math::Point<> &pos_, Math::Point< int > &wPCBin_) const
Definition: PFWaypointCollection.h:83
Math::Point< int > getNearestWPCBin(const Math::Point<> &pos_) const
Definition: PFWaypointCollection.h:95
bool findDrivBin(const Math::Point< int > &drivBin_) const
Definition: PFWaypointCollection.h:56
void getPath(int wGWDIndex_, const Math::Point<> &drivPos_, const Math::Point<> &targPos_, Math::Path &path_) const
void translate(const Math::Point<> &delta_)
Definition: PFWaypointCollection.h:153
float pos_[3]
Definition: ViewerApp.h:31
const Math::Point & getMaxCorner() const
Definition: PFWaypointCollection.h:150
const Math::Point & getBinSize() const
Definition: PFWaypointCollection.h:163