-
-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
77 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#ifndef IMG_DEMTREE_H | ||
#define IMG_DEMTREE_H | ||
|
||
#include "common/rtree.h" | ||
#include "mapdata.h" | ||
|
||
namespace IMG { | ||
|
||
class DEMTree { | ||
public: | ||
DEMTree(const QList<MapData::Elevation> &tiles); | ||
|
||
double elevation(const Coordinates &c) const; | ||
|
||
private: | ||
typedef RTree<const MapData::Elevation*, double, 2> Tree; | ||
|
||
struct ElevationCTX { | ||
ElevationCTX(const Tree &tree, const Coordinates &c, double &ele) | ||
: tree(tree), c(c), ele(ele) {} | ||
|
||
const Tree &tree; | ||
const Coordinates &c; | ||
double &ele; | ||
}; | ||
|
||
struct EdgeCTX { | ||
EdgeCTX(const Coordinates &c, double &ele) : c(c), ele(ele) {} | ||
|
||
const Coordinates &c; | ||
double &ele; | ||
}; | ||
|
||
static double edge(const Tree &tree, const Coordinates &c); | ||
static double elevation(const Tree &tree, const MapData::Elevation *e, | ||
const Coordinates &c); | ||
static bool elevationCb(const MapData::Elevation *e, void *context); | ||
static bool edgeCb(const MapData::Elevation *e, void *context); | ||
|
||
Tree _tree; | ||
}; | ||
|
||
} | ||
|
||
#endif // IMG_DEMTREE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters