Stellarium 0.12.0 | |||
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · Renderer · File Structure |
Grid of triangles (zones) on the sphere with radius 1, generated by subdividing the icosahedron. More...
#include <StelGeodesicGrid.hpp>
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 |
Find the zone number in which a given point lies. | |
void | 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 | getPartnerTriangle (int lev, int index) const |
Return the index of the partner triangle with which to form a parallelogram. | |
const GeodesicSearchResult * | 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. | |
Static Public Member Functions | |
static int | nrOfZones (int level) |
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].
Definition at line 47 of file StelGeodesicGrid.hpp.
int StelGeodesicGrid::getPartnerTriangle | ( | int | lev, | |
int | index | |||
) | const |
Return the index of the partner triangle with which to form a parallelogram.
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::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.