Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure

StelGeodesicGrid Class Reference

Grid of triangles (zones) on the sphere with radius 1, generated by subdividing the icosahedron. More...

#include <StelGeodesicGrid.hpp>

List of all members.

Public Member Functions

 StelGeodesicGrid (int maxLevel)
int getMaxLevel (void) const
int getNrOfZones (void) const
typedef void() VisitFunc (int lev, int index, const Vec3f &c0, const Vec3f &c1, const Vec3f &c2, void *context)
void visitTriangles (int maxVisitLevel, VisitFunc *func, void *context) const
int getZoneNumberForPoint (const Vec3f &v, int searchLevel) const
void getTriangleCorners (int lev, int index, Vec3f &c0, Vec3f &c1, Vec3f &c2) const
int getPartnerTriangle (int lev, int index) const
const GeodesicSearchResult * search (const QVector< SphericalCap > &convex, int maxSearchLevel) const

Static Public Member Functions

static int nrOfZones (int level)


struct  Triangle

Detailed Description

Grid of triangles (zones) on the sphere with radius 1, generated by subdividing the icosahedron.

level 0: just the icosahedron, 20 zones level 1: 80 zones, level 2: 320 zones, ... Each zone has a unique integer number in the range [0,getNrOfZones()-1].

Member Function Documentation

int StelGeodesicGrid::getZoneNumberForPoint ( const Vec3f v,
int  searchLevel 
) const

Find the zone number in which a given point lies.

prerequisite: v*v==1 When the point lies on the border of two or more zones, one such zone is returned (always the same one, because the algorithm is deterministic).

void StelGeodesicGrid::getTriangleCorners ( int  lev,
int  index,
Vec3f c0,
Vec3f c1,
Vec3f c2 
) const

Return the position of the 3 corners for the triangle at the given level and index.

int StelGeodesicGrid::getPartnerTriangle ( int  lev,
int  index 
) const

Return the index of the partner triangle with which to form a parallelogram.

const GeodesicSearchResult* StelGeodesicGrid::search ( const QVector< SphericalCap > &  convex,
int  maxSearchLevel 
) const

Return a search result matching the given spatial region The result is cached, meaning that it is very fast to search the same region consecutively.

a GeodesicSearchResult instance which must be used with GeodesicSearchBorderIterator and GeodesicSearchInsideIterator

Generated on Wed Jun 2 13:11:14 2010 for Stellarium by  doxygen 1.5.5