kstars
#include <SpatialIndex.h>
Public Member Functions | |
SpatialIndex (size_t maxlevel, size_t buildlevel=5) | |
uint64 | idByPoint (const SpatialVector &vector) const |
void | nodeVertex (const uint64 id, SpatialVector &v1, SpatialVector &v2, SpatialVector &v3) const |
void | pointById (SpatialVector &vector, uint64 ID) const |
Static Public Member Functions | |
static uint64 | idByName (const char *) |
static char * | nameById (uint64 ID, char *name=0) |
Detailed Description
The Spatial Index is a quad tree of spherical triangles.
The tree is built in the following way: Start out with 8 triangles on the sphere using the 3 main circles to determine them. Then, every triangle can be decomposed into 4 new triangles by drawing main circles between midpoints of its edges:
. /\ . / \ . /____\ . /\ /\ . / \ / \ . /____\/____\
This is how the quad tree is built up to a certain level by decomposing every triangle again and again.
Definition at line 59 of file SpatialIndex.h.
Constructor & Destructor Documentation
SpatialIndex::SpatialIndex | ( | size_t | maxlevel, |
size_t | buildlevel = 5 |
||
) |
Constructor.
Give the level of the index and optionally the level to build - i.e. the depth to keep in memory. if maxlevel - buildlevel > 0 , that many levels are generated on the fly each time the index is called.
Definition at line 60 of file SpatialIndex.cpp.
Member Function Documentation
|
static |
NodeName conversion to integer ID.
Definition at line 338 of file SpatialIndex.cpp.
uint64 SpatialIndex::idByPoint | ( | const SpatialVector & | vector | ) | const |
find a node by giving a vector.
The ID of the node is returned.
Definition at line 502 of file SpatialIndex.cpp.
|
static |
int32 conversion to a string (name of database).
WARNING: if name is already allocated, a size of at least 17 is required. The conversion is done by directly calculating the name from a number. To calculate the name of a certain level, the mechanism is that the name is given by (#of nodes in that level) + (id of node). So for example, for the first level, there are 8 nodes, and we get the names from numbers 8 through 15 giving S0,S1,S2,S3,N0,N1,N2,N3. The order is always ascending starting from S0000.. to N3333...
Definition at line 395 of file SpatialIndex.cpp.
void SpatialIndex::nodeVertex | ( | const uint64 | id, |
SpatialVector & | v1, | ||
SpatialVector & | v2, | ||
SpatialVector & | v3 | ||
) | const |
return the actual vertex vectors
Definition at line 122 of file SpatialIndex.cpp.
void SpatialIndex::pointById | ( | SpatialVector & | vector, |
uint64 | ID | ||
) | const |
find the vector to the centroid of a triangle represented by the ID
Definition at line 450 of file SpatialIndex.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:23 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.