26 typedef __int16 int16_t;
37 #define TRIANGLE_RTREE_QUAL RTree<NBHeightMapper::Triangle*, NBHeightMapper::Triangle, float, 2, NBHeightMapper::QueryResult>
160 int loadTiff(
const std::string& file);
178 inline float TRIANGLE_RTREE_QUAL::RectSphericalVolume(Rect* a_rect) {
180 const float extent0 = a_rect->m_max[0] - a_rect->m_min[0];
181 const float extent1 = a_rect->m_max[1] - a_rect->m_min[1];
182 return .78539816f * (extent0 * extent0 + extent1 * extent1);
186 inline TRIANGLE_RTREE_QUAL::Rect TRIANGLE_RTREE_QUAL::CombineRect(Rect* a_rectA, Rect* a_rectB) {
187 ASSERT(a_rectA && a_rectB);
189 newRect.m_min[0] =
rtree_min(a_rectA->m_min[0], a_rectB->m_min[0]);
190 newRect.m_max[0] =
rtree_max(a_rectA->m_max[0], a_rectB->m_max[0]);
191 newRect.m_min[1] =
rtree_min(a_rectA->m_min[1], a_rectB->m_min[1]);
192 newRect.m_max[1] =
rtree_max(a_rectA->m_max[1], a_rectB->m_max[1]);
#define TRIANGLE_RTREE_QUAL
A class that stores a 2D geometrical boundary.
class for cirumventing the const-restriction of RTree::Search-context
void add(Triangle *triangle) const
Position normalVector() const
returns the normal vector for this triangles plane
double getZ(const Position &geo) const
returns the projection of the give geoCoordinate (WGS84) onto triangle plane
PositionVector myCorners
the corners of the triangle
Triangle(const PositionVector &corners)
void addSelf(const QueryResult &queryResult) const
callback for RTree search
bool contains(const Position &pos) const
checks whether pos lies within triangle (only checks x,y)
Set z-values for all network positions based on data from a height map.
std::vector< const Triangle * > Triangles
double getZ(const Position &geo) const
returns height for the given geo coordinate (WGS84)
static const NBHeightMapper & get()
return the singleton instance (maybe 0)
int loadShapeFile(const std::string &file)
load height data from Arcgis-shape file and returns the number of parsed features
static NBHeightMapper myInstance
the singleton instance
bool ready() const
returns whether the NBHeightMapper has data
NBHeightMapper(const NBHeightMapper &)
Invalidated copy constructor.
std::vector< std::pair< Boundary, int16_t * > > myRasters
raster height information in m for all loaded files
NBHeightMapper()
private constructor and destructor (Singleton)
friend class NBHeightMapperTest
static void loadIfSet(OptionsCont &oc)
loads height map data if any loading options are set
void clearData()
clears loaded data
Position mySizeOfPixel
dimensions of one pixel in raster data
void addTriangle(PositionVector corners)
adds one triangles worth of height data
Boundary myBoundary
convex boundary of all known triangles;
NBHeightMapper & operator=(const NBHeightMapper &)
Invalidated assignment operator.
TRIANGLE_RTREE_QUAL myRTree
The RTree for spatial queries.
const Boundary & getBoundary()
returns the convex boundary of all known triangles
int loadTiff(const std::string &file)
load height data from GeoTIFF file and returns the number of non void pixels
A storage for options typed value containers)
A point in 2D or 3D with translation and scaling methods.