Stellarium  23.4
Public Slots | Signals | Public Member Functions | Static Public Member Functions | Properties
StarMgr Class Reference

Stores the star catalogue data. More...

#include <StarMgr.hpp>

Public Slots

void setFlagStars (bool b)
 Set display flag for Stars.
 
bool getFlagStars (void) const
 Get display flag for Stars.
 
void setFlagLabels (bool b)
 Set display flag for Star names (labels).
 
bool getFlagLabels (void) const
 Get display flag for Star names (labels).
 
void setLabelsAmount (double a)
 Set the amount of star labels. More...
 
double getLabelsAmount (void) const
 Get the amount of star labels. More...
 
void setFontSize (int newFontSize)
 Define font size to use for star names display.
 
static void setFlagSciNames (bool f)
 Show scientific or catalog names on stars without common names.
 
static bool getFlagSciNames (void)
 
void setDesignationUsage (const bool flag)
 Set flag for usage designations of stars for their labels instead common names.
 
static bool getDesignationUsage (void)
 Get flag for usage designations of stars for their labels instead common names.
 
void setFlagDblStarsDesignation (const bool flag)
 Set flag for usage traditional designations of double stars.
 
static bool getFlagDblStarsDesignation (void)
 Get flag for usage traditional designations of double stars.
 
void setFlagVarStarsDesignation (const bool flag)
 Set flag for usage designations of variable stars.
 
static bool getFlagVarStarsDesignation (void)
 Get flag for usage designations of variable stars.
 
void setFlagHIPDesignation (const bool flag)
 Set flag for usage Hipparcos catalog designations of stars.
 
static bool getFlagHIPDesignation (void)
 Get flag for usage Hipparcos catalog designations of stars.
 
void setFlagAdditionalNames (bool flag)
 Show additional star names.
 
static bool getFlagAdditionalNames (void)
 

Signals

void starLabelsDisplayedChanged (const bool displayed)
 
void starsDisplayedChanged (const bool displayed)
 
void designationUsageChanged (const bool flag)
 
void flagDblStarsDesignationChanged (const bool flag)
 
void flagVarStarsDesignationChanged (const bool flag)
 
void flagHIPDesignationChanged (const bool flag)
 
void flagAdditionalNamesDisplayedChanged (const bool displayed)
 
void labelsAmountChanged (double a)
 

Public Member Functions

virtual void init () Q_DECL_OVERRIDE
 Initialize the StarMgr. More...
 
virtual void draw (StelCore *core) Q_DECL_OVERRIDE
 Draw the stars and the star selection indicator if necessary.
 
virtual void update (double deltaTime) Q_DECL_OVERRIDE
 Update any time-dependent features. More...
 
virtual double getCallOrder (StelModuleActionName actionName) const Q_DECL_OVERRIDE
 Used to determine the order in which the various StelModules are drawn.
 
virtual QList< StelObjectPsearchAround (const Vec3d &v, double limitFov, const StelCore *core) const Q_DECL_OVERRIDE
 Return a list containing the stars located inside the limFov circle around position v.
 
virtual StelObjectP searchByNameI18n (const QString &nameI18n) const Q_DECL_OVERRIDE
 Return the matching Stars object's pointer if exists or Q_NULLPTR. More...
 
virtual StelObjectP searchByName (const QString &name) const Q_DECL_OVERRIDE
 Return the matching star if exists or Q_NULLPTR. More...
 
virtual StelObjectP searchByID (const QString &id) const Q_DECL_OVERRIDE
 Same as searchByName(id);.
 
virtual QStringList listMatchingObjects (const QString &objPrefix, int maxNbItem=5, bool useStartOfWords=false) const Q_DECL_OVERRIDE
 Find and return the list of at most maxNbItem objects auto-completing the passed object English name. More...
 
virtual QStringList listAllObjects (bool inEnglish) const Q_DECL_OVERRIDE
 
virtual QStringList listAllObjectsByType (const QString &objType, bool inEnglish) const Q_DECL_OVERRIDE
 List all StelObjects by type. More...
 
virtual QString getName () const Q_DECL_OVERRIDE
 Gets a user-displayable name of the object category.
 
virtual QString getStelObjectType () const Q_DECL_OVERRIDE
 Returns the name that will be returned by StelObject::getType() for the objects this module manages.
 
StelObjectP searchHP (int hip) const
 Search by Hipparcos catalogue number. More...
 
QVariantList getCatalogsDescription () const
 
bool checkAndLoadCatalog (const QVariantMap &m)
 Try to load the given catalog, even if it is marched as unchecked. More...
 
const QList< StelObjectP > & getHipparcosStars () const
 Get the list of all Hipparcos stars.
 
const QList< QMap< StelObjectP, float > > & getHipparcosHighPMStars () const
 
const QList< QMap< StelObjectP, float > > & getHipparcosDoubleStars () const
 
const QList< QMap< StelObjectP, float > > & getHipparcosVariableStars () const
 
const QList< QMap< StelObjectP, float > > & getHipparcosAlgolTypeStars () const
 
const QList< QMap< StelObjectP, float > > & getHipparcosClassicalCepheidsTypeStars () const
 
const QList< StelObjectP > & getHipparcosCarbonStars () const
 
const QList< StelObjectP > & getHipparcosBariumStars () const
 
- Public Member Functions inherited from StelObjectModule
bool matchObjectName (const QString &objName, const QString &objPrefix, bool useStartOfWords) const
 Auxiliary method of listMatchingObjects() More...
 
- Public Member Functions inherited from StelModule
 StelModule ()
 Constructor. Every derived class MUST call setObjectName(className) in its constructor.
 
virtual void deinit ()
 Called before the module will be deleted, and before the OpenGL context is suppressed. More...
 
virtual QSettings * getSettings ()
 Return module-specific settings. More...
 
virtual QString getModuleVersion () const
 Get the version of the module, default is stellarium main version.
 
virtual QString getAuthorName () const
 Get the name of the module author.
 
virtual QString getAuthorEmail () const
 Get the email address of the module author.
 
virtual void handleMouseClicks (class QMouseEvent *)
 Handle mouse clicks. More...
 
virtual void handleMouseWheel (class QWheelEvent *)
 Handle mouse wheel. More...
 
virtual bool handleMouseMoves (int x, int y, Qt::MouseButtons b)
 Handle mouse moves. More...
 
virtual void handleKeys (class QKeyEvent *e)
 Handle key events. More...
 
virtual bool handlePinch (qreal scale, bool started)
 Handle pinch gesture events. More...
 
virtual bool configureGui (bool show=true)
 Detect or show the configuration GUI elements for the module. More...
 

Static Public Member Functions

static QString getCommonName (int hip)
 Get the (translated) common name for a star with a specified Hipparcos catalogue number. More...
 
static QString getSciName (int hip)
 Get the (translated) scientific name for a star with a specified Hipparcos catalogue number. More...
 
static QString getSciExtraName (int hip)
 Get the (translated) scientific extra name for a star with a specified Hipparcos catalogue number. More...
 
static QString getGcvsName (int hip)
 Get the (translated) scientific name for a variable star with a specified Hipparcos catalogue number. More...
 
static QString getWdsName (int hip)
 Get the (translated) scientific name for a double star with a specified Hipparcos catalogue number. More...
 
static QString getCommonEnglishName (int hip)
 Get the (English) common name for a star with a specified Hipparcos catalogue number. More...
 
static QString getAdditionalNames (int hip)
 Get the (translated) additional names for a star with a specified Hipparcos catalogue number. More...
 
static QString getAdditionalEnglishNames (int hip)
 Get the English additional names for a star with a specified Hipparcos catalogue number. More...
 
static QString getCrossIdentificationDesignations (QString hip)
 Get the cross-identification designations for a star with a specified Hipparcos catalogue number. More...
 
static QString getGcvsVariabilityType (int hip)
 Get the type of variability for a variable star with a specified Hipparcos catalogue number. More...
 
static float getGcvsMaxMagnitude (int hip)
 Get the magnitude at maximum brightness for a variable star with a specified Hipparcos catalogue number. More...
 
static int getGcvsMagnitudeFlag (int hip)
 Get the magnitude flag code for a variable star with a specified Hipparcos catalogue number. More...
 
static float getGcvsMinMagnitude (int hip, bool firstMinimumFlag=true)
 Get the minimum magnitude or amplitude for a variable star with a specified Hipparcos catalogue number. More...
 
static QString getGcvsPhotometricSystem (int hip)
 Get the photometric system for a variable star with a specified Hipparcos catalogue number. More...
 
static double getGcvsEpoch (int hip)
 Get Epoch for maximum light for a variable star with a specified Hipparcos catalogue number. More...
 
static double getGcvsPeriod (int hip)
 Get the period for a variable star with a specified Hipparcos catalogue number. More...
 
static int getGcvsMM (int hip)
 Get the rising time or duration of eclipse for a variable star with a specified Hipparcos catalogue number. More...
 
static int getWdsLastObservation (int hip)
 Get year of last satisfactory observation of double star with a Hipparcos catalogue number. More...
 
static float getWdsLastPositionAngle (int hip)
 Get position angle at date of last satisfactory observation of double star with a Hipparcos catalogue number. More...
 
static float getWdsLastSeparation (int hip)
 Get separation angle at date of last satisfactory observation of double star with a Hipparcos catalogue number. More...
 
static float getPlxError (int hip)
 Get the parallax error for star with a Hipparcos catalogue number. More...
 
static PMData getProperMotion (int hip)
 Get the proper motion data for star with a Hipparcos catalogue number. More...
 
static QString convertToSpectralType (int index)
 
static QString convertToComponentIds (int index)
 

Properties

bool flagStarsDisplayed
 
bool flagLabelsDisplayed
 
double labelsAmount
 
bool flagAdditionalNamesDisplayed
 
bool flagDesignationLabels
 
bool flagDblStarsDesignation
 
bool flagVarStarsDesignation
 
bool flagHIPDesignation
 

Additional Inherited Members

- Public Types inherited from StelModule
enum  StelModuleSelectAction { AddToSelection , ReplaceSelection , RemoveFromSelection }
 Enum used when selecting objects to define whether to add to, replace, or remove from the existing selection list. More...
 
enum  StelModuleActionName {
  ActionDraw , ActionUpdate , ActionHandleMouseClicks , ActionHandleMouseMoves ,
  ActionHandleKeys
}
 Define the possible action for which an order is defined. More...
 
- Protected Member Functions inherited from StelModule
class StelActionaddAction (const QString &id, const QString &groupId, const QString &text, QObject *target, const char *slot, const QString &shortcut="", const QString &altShortcut="")
 convenience methods to add an action (call to slot) to the StelActionMgr object. More...
 
class StelActionaddAction (const QString &id, const QString &groupId, const QString &text, const char *slot, const QString &shortcut="", const QString &altShortcut="")
 convenience methods to add an action (call to own slot) to the StelActionMgr object. More...
 
StelActionaddAction (const QString &id, const QString &groupId, const QString &text, QObject *contextObject, std::function< void()> lambda, const QString &shortcut="", const QString &altShortcut="")
 convenience methods to add an action (call to Lambda functor) to the StelActionMgr object. More...
 

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

◆ checkAndLoadCatalog()

bool StarMgr::checkAndLoadCatalog ( const 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.

◆ getAdditionalEnglishNames()

static QString StarMgr::getAdditionalEnglishNames ( int  hip)
static

Get the English additional names for a star with a specified Hipparcos catalogue number.

Parameters
hipThe Hipparcos number of star
Returns
additional names of star

◆ getAdditionalNames()

static QString StarMgr::getAdditionalNames ( int  hip)
static

Get the (translated) additional names for a star with a specified Hipparcos catalogue number.

Parameters
hipThe Hipparcos number of star
Returns
translated additional names of star

◆ getCommonEnglishName()

static QString StarMgr::getCommonEnglishName ( int  hip)
static

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

Parameters
hipThe Hipparcos number of star
Returns
common name of star (from skyculture file star_names.fab)

◆ getCommonName()

static QString StarMgr::getCommonName ( int  hip)
static

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

Parameters
hipThe Hipparcos number of star
Returns
translated common name of star

◆ getCrossIdentificationDesignations()

static QString StarMgr::getCrossIdentificationDesignations ( QString  hip)
static

Get the cross-identification designations for a star with a specified Hipparcos catalogue number.

Parameters
hipThe Hipparcos number of star
Returns
cross-identification data

◆ getGcvsEpoch()

static double StarMgr::getGcvsEpoch ( int  hip)
static

Get Epoch for maximum light for a variable star with a specified Hipparcos catalogue number.

Parameters
hipThe Hipparcos number of star
Returns
Epoch for maximum light for a variable star

◆ getGcvsMagnitudeFlag()

static int StarMgr::getGcvsMagnitudeFlag ( int  hip)
static

Get the magnitude flag code for a variable star with a specified Hipparcos catalogue number.

Parameters
hipThe Hipparcos number of star
Returns
the magnitude flag code for a variable star

◆ getGcvsMaxMagnitude()

static float StarMgr::getGcvsMaxMagnitude ( int  hip)
static

Get the magnitude at maximum brightness for a variable star with a specified Hipparcos catalogue number.

Parameters
hipThe Hipparcos number of star
Returns
the magnitude at maximum brightness for a variable star

◆ getGcvsMinMagnitude()

static float StarMgr::getGcvsMinMagnitude ( int  hip,
bool  firstMinimumFlag = true 
)
static

Get the minimum magnitude or amplitude for a variable star with a specified Hipparcos catalogue number.

Parameters
hipThe Hipparcos number of star
firstMinimumFlag
Returns
the minimum magnitude or amplitude for a variable star

◆ getGcvsMM()

static int StarMgr::getGcvsMM ( int  hip)
static

Get the rising time or duration of eclipse for a variable star with a specified Hipparcos catalogue number.

Parameters
hipThe Hipparcos number of star
Returns
the rising time or duration of eclipse for variable star

◆ getGcvsName()

static QString StarMgr::getGcvsName ( int  hip)
static

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

Parameters
hipThe Hipparcos number of star
Returns
translated scientific name of variable star

◆ getGcvsPeriod()

static double StarMgr::getGcvsPeriod ( int  hip)
static

Get the period for a variable star with a specified Hipparcos catalogue number.

Parameters
hipThe Hipparcos number of star
Returns
the period of variable star

◆ getGcvsPhotometricSystem()

static QString StarMgr::getGcvsPhotometricSystem ( int  hip)
static

Get the photometric system for a variable star with a specified Hipparcos catalogue number.

Parameters
hipThe Hipparcos number of star
Returns
the photometric system for a variable star

◆ getGcvsVariabilityType()

static QString StarMgr::getGcvsVariabilityType ( int  hip)
static

Get the type of variability for a variable star with a specified Hipparcos catalogue number.

Parameters
hipThe Hipparcos number of star
Returns
type of variability

◆ getLabelsAmount

double StarMgr::getLabelsAmount ( void  ) const
inlineslot

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

◆ getPlxError()

static float StarMgr::getPlxError ( int  hip)
static

Get the parallax error for star with a Hipparcos catalogue number.

Parameters
hipThe Hipparcos number of star
Returns
the parallax error (mas)

◆ getProperMotion()

static PMData StarMgr::getProperMotion ( int  hip)
static

Get the proper motion data for star with a Hipparcos catalogue number.

Parameters
hipThe Hipparcos number of star
Returns
the proper motion (mas/yr for RA and Dec)

◆ getSciExtraName()

static QString StarMgr::getSciExtraName ( int  hip)
static

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

Parameters
hipThe Hipparcos number of star
Returns
translated scientific name of star

◆ getSciName()

static QString StarMgr::getSciName ( int  hip)
static

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

Parameters
hipThe Hipparcos number of star
Returns
translated scientific name of star

◆ getWdsLastObservation()

static int StarMgr::getWdsLastObservation ( int  hip)
static

Get year of last satisfactory observation of double star with a Hipparcos catalogue number.

Parameters
hipThe Hipparcos number of star
Returns
year of last satisfactory observation

◆ getWdsLastPositionAngle()

static float StarMgr::getWdsLastPositionAngle ( int  hip)
static

Get position angle at date of last satisfactory observation of double star with a Hipparcos catalogue number.

Parameters
hipThe Hipparcos number of star
Returns
position angle in degrees

◆ getWdsLastSeparation()

static float StarMgr::getWdsLastSeparation ( int  hip)
static

Get separation angle at date of last satisfactory observation of double star with a Hipparcos catalogue number.

Parameters
hipThe Hipparcos number of star
Returns
separation in arcseconds

◆ getWdsName()

static QString StarMgr::getWdsName ( int  hip)
static

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

Parameters
hipThe Hipparcos number of star
Returns
translated scientific name of double star

◆ init()

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 star selection indicator
  • Sets various display flags from the ini parser object

Implements StelModule.

◆ listAllObjects()

virtual QStringList StarMgr::listAllObjects ( bool  inEnglish) const
virtual
Note
Loading stars with the common names only.

Implements StelObjectModule.

◆ listAllObjectsByType()

virtual QStringList StarMgr::listAllObjectsByType ( const QString &  objType,
bool  inEnglish 
) const
virtual

List all StelObjects by type.

Parameters
objTypeobject type
inEnglishlist translated names (false) or in English (true)
Returns
a list of matching object name by order of relevance, or an empty list if nothing matches

Reimplemented from StelObjectModule.

◆ listMatchingObjects()

virtual QStringList StarMgr::listMatchingObjects ( const QString &  objPrefix,
int  maxNbItem = 5,
bool  useStartOfWords = false 
) const
virtual

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

Parameters
objPrefixthe case insensitive first letters of the searched object
maxNbItemthe maximum number of returned object names
useStartOfWordsthe autofill mode for returned objects names
Returns
a list of matching object name by order of relevance, or an empty list if nothing match

Reimplemented from StelObjectModule.

◆ searchByName()

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

Return the matching star if exists or Q_NULLPTR.

Parameters
nameThe case in-sensitive english star name

Implements StelObjectModule.

◆ searchByNameI18n()

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

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

Parameters
nameI18nThe case in-sensitive localized star common name or HIP/HP, SAO, HD, HR, GCVS or WDS number catalog name (format can be HP1234 or HP 1234 or HIP 1234) or sci name

Implements StelObjectModule.

◆ searchHP()

StelObjectP StarMgr::searchHP ( int  hip) const

Search by Hipparcos catalogue number.

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

◆ setLabelsAmount

void StarMgr::setLabelsAmount ( double  a)
inlineslot

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
athe amount between 0 and 10. 0 is no labels, 10 is maximum of labels

◆ update()

virtual void StarMgr::update ( double  deltaTime)
inlinevirtual

Update any time-dependent features.

Includes fading in and out stars and labels when they are turned on and off.

Reimplemented from StelModule.