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

StarMgr Class Reference

Stores the star catalogue data. More...

#include <StarMgr.hpp>

Inherits StelObjectModule.

List of all members.

Public Slots

void setLabelColor (const Vec3f &c)
Vec3f getLabelColor (void) const
void setFlagStars (bool b)
bool getFlagStars (void) const
void setFlagLabels (bool b)
bool getFlagLabels (void) const
void setLabelsAmount (float a)
float getLabelsAmount (void) const
void setFontSize (double newFontSize)
static void setFlagSciNames (bool f)
static bool getFlagSciNames (void)

Public Member Functions

virtual void init ()
virtual void draw (StelCore *core)
virtual void update (double deltaTime)
virtual void updateI18n ()
virtual void updateSkyCulture (const QString &skyCultureDir)
virtual void setStelStyle (const QString &section)
virtual double getCallOrder (StelModuleActionName actionName) const
virtual QList< StelObjectPsearchAround (const Vec3d &v, double limitFov, const StelCore *core) const
virtual StelObjectP searchByNameI18n (const QString &nameI18n) const
virtual StelObjectP searchByName (const QString &name) const
virtual QStringList listMatchingObjectsI18n (const QString &objPrefix, int maxNbItem=5) const
StelObjectP searchHP (int hip) const
QVariantList getCatalogsDescription () const
bool checkAndLoadCatalog (QVariantMap m)

Static Public Member Functions

static QString getCommonName (int hip)
static QString getSciName (int hip)
static QString convertToSpectralType (int index)
static QString convertToComponentIds (int index)


Detailed Description

Stores the star catalogue data.

Used to render the stars themselves, as well as determine the color table and render the labels of those stars with names for a given SkyCulture.

The celestial sphere is split into zones, which correspond to the triangular faces of a geodesic sphere. The number of zones (faces) depends on the level of sub-division of this sphere. The lowest level, 0, is an icosahedron (20 faces), subsequent levels, L, of sub-division give the number of zones, n as:

n=20 x 4^L

Stellarium uses levels 0 to 7 in the existing star catalogues. Star Data Records contain the position of a star as an offset from the central position of the zone in which that star is located, thus it is necessary to determine the vector from the observer to the centre of a zone, and add the star's offsets to find the absolute position of the star on the celestial sphere.

This position for a star is expressed as a 3-dimensional vector which points from the observer (at the centre of the geodesic sphere) to the position of the star as observed on the celestial sphere.


Member Function Documentation

virtual void StarMgr::init (  )  [virtual]

Initialize the StarMgr.

  • Loads the star catalogue data into memory
  • Sets up the star color table
  • Loads the star texture
  • Loads the star font (for labels on named stars)
  • Loads the texture of the sar selection indicator
  • Lets various display flags from the ini parser object

Implements StelModule.

virtual void StarMgr::draw ( StelCore core  )  [virtual]

Draw the stars and the star selection indicator if necessary.

Reimplemented from StelModule.

virtual void StarMgr::update ( double  deltaTime  )  [inline, virtual]

Draw all the stars.

Update any time-dependent features. Includes fading in and out stars and labels when they are turned on and off.

Implements StelModule.

virtual void StarMgr::updateI18n (  )  [virtual]

Translate text.

Reimplemented from StelModule.

virtual void StarMgr::updateSkyCulture ( const QString &  skyCultureDir  )  [virtual]

Called when the sky culture is updated.

Loads common and scientific names of stars for a given sky culture.

Parameters:
skyCultureDir the name of the directory containing the sky culture to use.

Reimplemented from StelModule.

virtual void StarMgr::setStelStyle ( const QString &  section  )  [virtual]

Load a color scheme.

Reimplemented from StelModule.

virtual double StarMgr::getCallOrder ( StelModuleActionName  actionName  )  const [virtual]

Used to determine the order in which the various StelModules are drawn.

Reimplemented from StelModule.

virtual QList<StelObjectP > StarMgr::searchAround ( const Vec3d v,
double  limitFov,
const StelCore core 
) const [virtual]

Return a list containing the stars located inside the limFov circle around position v.

Implements StelObjectModule.

virtual StelObjectP StarMgr::searchByNameI18n ( const QString &  nameI18n  )  const [virtual]

Return the matching Stars object's pointer if exists or NULL.

Parameters:
nameI18n The case in-sensistive star common name or HP catalog name (format can be HP1234 or HP 1234 or HIP 1234) or sci name

Implements StelObjectModule.

virtual StelObjectP StarMgr::searchByName ( const QString &  name  )  const [virtual]

Return the matching star if exists or NULL.

Parameters:
name The case in-sensistive standard program planet name

Implements StelObjectModule.

virtual QStringList StarMgr::listMatchingObjectsI18n ( const QString &  objPrefix,
int  maxNbItem = 5 
) const [virtual]

Find and return the list of at most maxNbItem objects auto-completing the passed object I18n name.

Parameters:
objPrefix the case insensitive first letters of the searched object
maxNbItem the maximum number of returned object names
Returns:
a list of matching object name by order of relevance, or an empty list if nothing match

Implements StelObjectModule.

void StarMgr::setLabelColor ( const Vec3f c  )  [inline, slot]

Set the color used to label bright stars.

Vec3f StarMgr::getLabelColor ( void   )  const [inline, slot]

Get the current color used to label bright stars.

void StarMgr::setFlagStars ( bool  b  )  [inline, slot]

Set display flag for Stars.

bool StarMgr::getFlagStars ( void   )  const [inline, slot]

Get display flag for Stars.

void StarMgr::setFlagLabels ( bool  b  )  [inline, slot]

Set display flag for Star names (labels).

bool StarMgr::getFlagLabels ( void   )  const [inline, slot]

Get display flag for Star names (labels).

void StarMgr::setLabelsAmount ( float  a  )  [inline, slot]

Set the amount of star labels.

The real amount is also proportional with FOV. The limit is set in function of the stars magnitude

Parameters:
a the amount between 0 and 10. 0 is no labels, 10 is maximum of labels

float StarMgr::getLabelsAmount ( void   )  const [inline, slot]

Get the amount of star labels.

The real amount is also proportional with FOV.

Returns:
the amount between 0 and 10. 0 is no labels, 10 is maximum of labels

void StarMgr::setFontSize ( double  newFontSize  )  [slot]

Define font size to use for star names display.

static void StarMgr::setFlagSciNames ( bool  f  )  [inline, static, slot]

Show scientific or catalog names on stars without common names.

StelObjectP StarMgr::searchHP ( int  hip  )  const

Search by Hipparcos catalogue number.

Parameters:
hip the Hipparcos catalogue number of the star which is required.
Returns:
the requested StelObjectP or an empty objecy if the requested one was not found.

static QString StarMgr::getCommonName ( int  hip  )  [static]

Get the (translated) common name for a star with a specified Hipparcos catalogue number.

static QString StarMgr::getSciName ( int  hip  )  [static]

Get the (translated) scientific name for a star with a specified Hipparcos catalogue number.

bool StarMgr::checkAndLoadCatalog ( QVariantMap  m  ) 

Try to load the given catalog, even if it is marched as unchecked.

Mark it as checked if checksum is correct.

Returns:
false in case of failure.


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