• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kstars

Public Member Functions | Static Public Member Functions | List of all members
SpatialIndex Class Reference

#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

uint64 SpatialIndex::idByName ( const char *  name)
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.

char * SpatialIndex::nameById ( uint64  ID,
char *  name = 0 
)
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:
  • SpatialIndex.h
  • SpatialIndex.cpp
This file is part of the KDE documentation.
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.

kstars

Skip menu "kstars"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal