Stellarium 0.11.0
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure
Classes | Public Types | Public Member Functions | Static Public Member Functions

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.

Classes

struct  Triangle

Public Types

typedef void( VisitFunc )(int lev, int index, const Vec3f &c0, const Vec3f &c1, const Vec3f &c2, void *context)

Public Member Functions

 StelGeodesicGrid (int maxLevel)
int getMaxLevel (void) const
int getNrOfZones (void) const
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 GeodesicSearchResultsearch (const QVector< SphericalCap > &convex, int maxSearchLevel) const

Static Public Member Functions

static int nrOfZones (int level)

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).

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.

Returns:
a GeodesicSearchResult instance which must be used with GeodesicSearchBorderIterator and GeodesicSearchInsideIterator