00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00014
00015 inline uint64
00016 SpatialIndex::leafCount() const
00017 {
00018 return leaves_;
00019 }
00020
00022
00023 inline size_t
00024 SpatialIndex::nVertices() const
00025 {
00026
00027 return vertices_.size();
00028 }
00029
00031
00032 inline uint32
00033 SpatialIndex::leafNumberById(uint64 id) const{
00034 if(maxlevel_ > HTMMAXBIT)
00035 throw SpatialInterfaceError("SpatialIndex:leafNumberById","BitList may only be used up to level HTMMAXBIT deep");
00036
00037 return (uint32)(id - leafCount());
00038 }
00039
00041
00042 inline uint64
00043 SpatialIndex::idByLeafNumber(uint32 n) const{
00044 uint64 l = leafCount();
00045 l += n;
00046 return l;
00047 }
00048
00050
00051 inline char *
00052 SpatialIndex::nameByLeafNumber(uint32 n, char * name) const{
00053 return nameById(idByLeafNumber(n), name);
00054 }
00055
00057
00058
00059
00060 inline uint64
00061 SpatialIndex::idByPoint(const float64 & ra, const float64 & dec) const {
00062 SpatialVector v(ra,dec);
00063 return idByPoint(v);
00064 }
00065
00067
00068
00069
00070 inline char*
00071 SpatialIndex::nameByPoint(const float64 & ra, const float64 & dec,
00072 char* name) const {
00073 return nameById(idByPoint(ra,dec), name);
00074 }
00075
00077
00078
00079
00080 inline char*
00081 SpatialIndex::nameByPoint(SpatialVector & vector, char* name) const {
00082 return nameById(idByPoint(vector),name);
00083 }
00085 inline void
00086 SpatialIndex::setMaxlevel(int level) {
00087 this->maxlevel_ = level;
00088 }