Go to the documentation of this file.00001
00013 #ifndef LGL_POSITION_MANAGER_HPP
00014 #define LGL_POSITION_MANAGER_HPP
00015
00016 #include <vector>
00017 #include <ostream>
00018
00019 #include <lgl/FlexGrid.hpp>
00020
00021 #include <lgl/Location.hpp>
00022 #include <lgl/GeoData.hpp>
00023 #include <lgl/Raster.hpp>
00024 #include <lgl/Quadtree.hpp>
00025 #include <lgl/Decomp.hpp>
00026
00027 namespace jafar {
00028 namespace lgl {
00029
00030 struct PosFeature {
00031 bool active;
00032
00033 PosFeature(bool _active=true):active(_active) {}
00034 };
00035
00040 class PositionManager {
00041
00042 typedef FlexGrid<PosFeature> PosMap;
00043
00044 protected :
00045
00049 RasterRect rect;
00050 PosMap pos;
00051 GeoData* geodata;
00052 Quadtree<double,GeoData>* quadtree;
00053
00054 public:
00055
00059 PositionManager(GeoData* _geodata, jafar::lgl::Quadtree<double,GeoData>* _qtree);
00060
00061 ~PositionManager();
00062
00063 bool isAtCenter(const NavLocation& loc) const;
00064
00065
00066 bool isAtEdge(const NavLocation& loc) const;
00067
00068
00069 bool isAtBorder(const NavLocation& loc) const;
00070
00075 bool getGEnterPos(const NavLocation& loc, std::vector<NavLocation>& enterLocs) const;
00076
00077
00078 bool getAdjRasterCells(const NavLocation& loc, std::vector<RasterCellIndex>& cells) const;
00079
00080
00081 bool getAdjClusters(const NavLocation& loc, std::vector<RasterCellIndex>& clusters) const;
00082
00083 bool getTopLeftRasterCell(const NavLocation& loc, RasterCellIndex& cell);
00084
00085 bool getTopLeftCluster(const NavLocation& loc, RasterCellIndex& cell);
00086
00087 bool inSameCluster(const NavLocation& loc1, const NavLocation& loc2, RasterCellIndex& clusterRoot);
00088
00099 bool getCluster(const NavLocation& loc1, const NavLocation& loc2, RasterRect& cluster);
00100
00111 bool getCluster(const NavLocation& loc1, const NavLocation& loc2, DecompCluster** cluster);
00112 bool getCluster(const RasterCellIndex& clusterRoot, DecompCluster** cluster);
00113
00123 bool getClusterUnordered(const NavLocation& loc, DecompCluster** cluster);
00124
00125 };
00126
00127
00128 }
00129 }
00130
00131 #endif