StarMgr.hpp   StarMgr.hpp 
skipping to change at line 57 skipping to change at line 57
int mflag; //! Magnitude flag code int mflag; //! Magnitude flag code
float min1mag; //! First minimum magnitude or amplitude float min1mag; //! First minimum magnitude or amplitude
float min2mag; //! Second minimum magnitude or amplitude float min2mag; //! Second minimum magnitude or amplitude
QString photosys; //! The photometric system for magnitudes QString photosys; //! The photometric system for magnitudes
double epoch; //! Epoch for maximum light (Julian days) double epoch; //! Epoch for maximum light (Julian days)
double period; //! Period of the variable star (days) double period; //! Period of the variable star (days)
int Mm; //! Rising time or duration of eclipse (%) int Mm; //! Rising time or duration of eclipse (%)
QString stype; //! Spectral type QString stype; //! Spectral type
} varstar; } varstar;
typedef struct
{
QString designation; //! WDS designation
int observation; //! Date of last satisfactory observation, y
r
float positionAngle; //! Position Angle at date of last satisfact
ory observation, deg
float separation; //! Separation at date of last satisfactory
observation, arcsec
} wds;
//! @class StarMgr //! @class StarMgr
//! Stores the star catalogue data. //! Stores the star catalogue data.
//! Used to render the stars themselves, as well as determine the color tab le //! Used to render the stars themselves, as well as determine the color tab le
//! and render the labels of those stars with names for a given SkyCulture. //! and render the labels of those stars with names for a given SkyCulture.
//! //!
//! The celestial sphere is split into zones, which correspond to the //! The celestial sphere is split into zones, which correspond to the
//! triangular faces of a geodesic sphere. The number of zones (faces) //! triangular faces of a geodesic sphere. The number of zones (faces)
//! depends on the level of sub-division of this sphere. The lowest //! depends on the level of sub-division of this sphere. The lowest
//! level, 0, is an icosahedron (20 faces), subsequent levels, L, //! level, 0, is an icosahedron (20 faces), subsequent levels, L,
//! of sub-division give the number of zones, n as: //! of sub-division give the number of zones, n as:
skipping to change at line 91 skipping to change at line 99
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool flagStarsDisplayed Q_PROPERTY(bool flagStarsDisplayed
READ getFlagStars READ getFlagStars
WRITE setFlagStars WRITE setFlagStars
NOTIFY starsDisplayedChanged) NOTIFY starsDisplayedChanged)
Q_PROPERTY(bool flagLabelsDisplayed Q_PROPERTY(bool flagLabelsDisplayed
READ getFlagLabels READ getFlagLabels
WRITE setFlagLabels WRITE setFlagLabels
NOTIFY starLabelsDisplayedChanged) NOTIFY starLabelsDisplayedChanged)
Q_PROPERTY(double labelsAmount
READ getLabelsAmount
WRITE setLabelsAmount
NOTIFY labelsAmountChanged)
public: public:
StarMgr(void); StarMgr(void);
~StarMgr(void); ~StarMgr(void);
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Methods defined in the StelModule class // Methods defined in the StelModule class
//! Initialize the StarMgr. //! Initialize the StarMgr.
//! - Loads the star catalogue data into memory //! - Loads the star catalogue data into memory
//! - Sets up the star color table //! - Sets up the star color table
skipping to change at line 131 skipping to change at line 143
//! Return the matching Stars object's pointer if exists or NULL //! Return the matching Stars object's pointer if exists or NULL
//! @param nameI18n The case in-sensistive star common name or HP //! @param nameI18n The case in-sensistive star common name or HP
//! catalog name (format can be HP1234 or HP 1234 or HIP 1234) or sc i name //! catalog name (format can be HP1234 or HP 1234 or HIP 1234) or sc i name
virtual StelObjectP searchByNameI18n(const QString& nameI18n) const; virtual StelObjectP searchByNameI18n(const QString& nameI18n) const;
//! Return the matching star if exists or NULL //! Return the matching star if exists or NULL
//! @param name The case in-sensistive standard program planet name //! @param name The case in-sensistive standard program planet name
virtual StelObjectP searchByName(const QString& name) const; virtual StelObjectP searchByName(const QString& name) const;
//! Find and return the list of at most maxNbItem objects auto-compl
eting the passed object I18n name.
//! @param objPrefix the case insensitive first letters of the searc
hed object
//! @param maxNbItem the maximum number of returned object names
//! @param useStartOfWords the autofill mode for returned objects na
mes
//! @return a list of matching object name by order of relevance, or
an empty list if nothing match
virtual QStringList listMatchingObjectsI18n(const QString& objPrefix
, int maxNbItem=5, bool useStartOfWords=false) const;
//! Find and return the list of at most maxNbItem objects auto-compl eting the passed object English name. //! Find and return the list of at most maxNbItem objects auto-compl eting the passed object English name.
//! @param objPrefix the case insensitive first letters of the searc hed object //! @param objPrefix the case insensitive first letters of the searc hed object
//! @param maxNbItem the maximum number of returned object names //! @param maxNbItem the maximum number of returned object names
//! @param useStartOfWords the autofill mode for returned objects na mes //! @param useStartOfWords the autofill mode for returned objects na mes
//! @return a list of matching object name by order of relevance, or an empty list if nothing match //! @return a list of matching object name by order of relevance, or an empty list if nothing match
virtual QStringList listMatchingObjects(const QString& objPrefix, in t maxNbItem=5, bool useStartOfWords=false) const; virtual QStringList listMatchingObjects(const QString& objPrefix, in t maxNbItem=5, bool useStartOfWords=false, bool inEnglish=false) const;
//! @note Loading stars with the common names only. //! @note Loading stars with the common names only.
virtual QStringList listAllObjects(bool inEnglish) const; virtual QStringList listAllObjects(bool inEnglish) const;
virtual QStringList listAllObjectsByType(const QString& objType, boo l inEnglish) const; virtual QStringList listAllObjectsByType(const QString& objType, boo l inEnglish) const;
virtual QString getName() const { return "Stars"; } virtual QString getName() const { return "Stars"; }
public slots: public slots:
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Methods callable from script and GUI // Methods callable from script and GUI
//! Set the color used to label bright stars. //! Set the color used to label bright stars.
//! @param c The color of the bright stars labels //! @param c The color of the bright stars labels
//! @code //! @code
//! // example of usage in scripts //! // example of usage in scripts
//! StarMgr.setLabelColor(Vec3f(1.0,0.0,0.0)); //! StarMgr.setLabelColor(Vec3f(1.0,0.0,0.0));
//! @endcode //! @endcode
void setLabelColor(const Vec3f& c) {labelColor = c;} void setLabelColor(const Vec3f& c) {labelColor = c;}
//! Get the current color used to label bright stars. //! Get the current color used to label bright stars.
Vec3f getLabelColor(void) const {return labelColor;} Vec3f getLabelColor(void) const {return labelColor;}
//! Set display flag for Stars. //! Set display flag for Stars.
void setFlagStars(bool b) {starsFader=b;} void setFlagStars(bool b) {starsFader=b; emit starsDisplayedChanged( b);}
//! Get display flag for Stars //! Get display flag for Stars
bool getFlagStars(void) const {return starsFader==true;} bool getFlagStars(void) const {return starsFader==true;}
//! Set display flag for Star names (labels). //! Set display flag for Star names (labels).
void setFlagLabels(bool b) {labelsFader=b;} void setFlagLabels(bool b) {labelsFader=b; emit starLabelsDisplayedC hanged(b);}
//! Get display flag for Star names (labels). //! Get display flag for Star names (labels).
bool getFlagLabels(void) const {return labelsFader==true;} bool getFlagLabels(void) const {return labelsFader==true;}
//! Set the amount of star labels. The real amount is also proportio nal with FOV. //! Set the amount of star labels. The real amount is also proportio nal with FOV.
//! The limit is set in function of the stars magnitude //! The limit is set in function of the stars magnitude
//! @param a the amount between 0 and 10. 0 is no labels, 10 is maxi mum of labels //! @param a the amount between 0 and 10. 0 is no labels, 10 is maxi mum of labels
void setLabelsAmount(float a) {labelsAmount=a;} void setLabelsAmount(double a) {if(a!=labelsAmount){ labelsAmount=a; emit labelsAmountChanged(a);}}
//! Get the amount of star labels. The real amount is also proportio nal with FOV. //! Get the amount of star labels. The real amount is also proportio nal with FOV.
//! @return the amount between 0 and 10. 0 is no labels, 10 is maxim um of labels //! @return the amount between 0 and 10. 0 is no labels, 10 is maxim um of labels
float getLabelsAmount(void) const {return labelsAmount;} double getLabelsAmount(void) const {return labelsAmount;}
//! Define font size to use for star names display. //! Define font size to use for star names display.
void setFontSize(float newFontSize); void setFontSize(float newFontSize);
//! Show scientific or catalog names on stars without common names. //! Show scientific or catalog names on stars without common names.
static void setFlagSciNames(bool f) {flagSciNames = f;} static void setFlagSciNames(bool f) {flagSciNames = f;}
static bool getFlagSciNames(void) {return flagSciNames;} static bool getFlagSciNames(void) {return flagSciNames;}
public: public:
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
skipping to change at line 219 skipping to change at line 225
//! @param hip The Hipparcos number of star //! @param hip The Hipparcos number of star
//! @return translated additional scientific name of star //! @return translated additional scientific name of star
static QString getSciAdditionalName(int hip); static QString getSciAdditionalName(int hip);
//! Get the (translated) scientific name for a variable star with a specified //! Get the (translated) scientific name for a variable star with a specified
//! Hipparcos catalogue number. //! Hipparcos catalogue number.
//! @param hip The Hipparcos number of star //! @param hip The Hipparcos number of star
//! @return translated scientific name of variable star //! @return translated scientific name of variable star
static QString getGcvsName(int hip); static QString getGcvsName(int hip);
//! Get the (translated) scientific name for a double star with a sp
ecified
//! Hipparcos catalogue number.
//! @param hip The Hipparcos number of star
//! @return translated scientific name of double star
static QString getWdsName(int hip);
//! Get the (English) common name for a star with a specified //! Get the (English) common name for a star with a specified
//! Hipparcos catalogue number. //! Hipparcos catalogue number.
//! @param hip The Hipparcos number of star //! @param hip The Hipparcos number of star
//! @return common name of star (from skyculture @file star_names.fa b) //! @return common name of star (from skyculture file star_names.fab )
static QString getCommonEnglishName(int hip); static QString getCommonEnglishName(int hip);
//! Get the cross-index designations for a star with a specified //! Get the cross-identification designations for a star with a spec ified
//! Hipparcos catalogue number. //! Hipparcos catalogue number.
//! @param hip The Hipparcos number of star //! @param hip The Hipparcos number of star
//! @return cross-index data //! @return cross-identification data
static QString getCrossIndexDesignations(int hip); static QString getCrossIdentificationDesignations(int hip);
//! Get the type of variability for a variable star with a specified //! Get the type of variability for a variable star with a specified
//! Hipparcos catalogue number. //! Hipparcos catalogue number.
//! @param hip The Hipparcos number of star //! @param hip The Hipparcos number of star
//! @return type of variability //! @return type of variability
static QString getGcvsVariabilityType(int hip); static QString getGcvsVariabilityType(int hip);
//! Get the magnitude at maximum brightness for a variable star with a specified //! Get the magnitude at maximum brightness for a variable star with a specified
//! Hipparcos catalogue number. //! Hipparcos catalogue number.
//! @param hip The Hipparcos number of star //! @param hip The Hipparcos number of star
skipping to change at line 280 skipping to change at line 292
//! @param hip The Hipparcos number of star //! @param hip The Hipparcos number of star
//! @return the period of variable star //! @return the period of variable star
static double getGcvsPeriod(int hip); static double getGcvsPeriod(int hip);
//! Get the rising time or duration of eclipse for a variable star w ith a //! Get the rising time or duration of eclipse for a variable star w ith a
//! specified Hipparcos catalogue number. //! specified Hipparcos catalogue number.
//! @param hip The Hipparcos number of star //! @param hip The Hipparcos number of star
//! @return the rising time or duration of eclipse for variable star //! @return the rising time or duration of eclipse for variable star
static int getGcvsMM(int hip); static int getGcvsMM(int hip);
//! Get year of last satisfactory observation of double star with a
//! Hipparcos catalogue number.
//! @param hip The Hipparcos number of star
//! @return year of last satisfactory observation
static int getWdsLastObservation(int hip);
//! Get position angle at date of last satisfactory observation of d
ouble star with a
//! Hipparcos catalogue number.
//! @param hip The Hipparcos number of star
//! @return position angle in degrees
static int getWdsLastPositionAngle(int hip);
//! Get separation angle at date of last satisfactory observation of
double star with a
//! Hipparcos catalogue number.
//! @param hip The Hipparcos number of star
//! @return separation in arcseconds
static float getWdsLastSeparation(int hip);
static QString convertToSpectralType(int index); static QString convertToSpectralType(int index);
static QString convertToComponentIds(int index); static QString convertToComponentIds(int index);
QVariantList getCatalogsDescription() const {return catalogsDescript ion;} QVariantList getCatalogsDescription() const {return catalogsDescript ion;}
//! Try to load the given catalog, even if it is marched as unchecke d. //! Try to load the given catalog, even if it is marched as unchecke d.
//! Mark it as checked if checksum is correct. //! Mark it as checked if checksum is correct.
//! @return false in case of failure. //! @return false in case of failure.
bool checkAndLoadCatalog(const QVariantMap& m); bool checkAndLoadCatalog(const QVariantMap& m);
private slots: private slots:
void setStelStyle(const QString& section);
//! Translate text. //! Translate text.
void updateI18n(); void updateI18n();
//! Called when the sky culture is updated. //! Called when the sky culture is updated.
//! Loads common and scientific names of stars for a given sky cultu re. //! Loads common and scientific names of stars for a given sky cultu re.
//! @param skyCultureDir the name of the directory containing the sk y culture to use. //! @param skyCultureDir the name of the directory containing the sk y culture to use.
void updateSkyCulture(const QString& skyCultureDir); void updateSkyCulture(const QString& skyCultureDir);
signals: signals:
void starLabelsDisplayedChanged(const bool displayed); void starLabelsDisplayedChanged(const bool displayed);
void starsDisplayedChanged(const bool displayed); void starsDisplayedChanged(const bool displayed);
void labelsAmountChanged(float a);
private: private:
void setCheckFlag(const QString& catalogId, bool b); void setCheckFlag(const QString& catalogId, bool b);
void copyDefaultConfigFile(); void copyDefaultConfigFile();
//! Loads common names for stars from a file. //! Loads common names for stars from a file.
//! Called when the SkyCulture is updated. //! Called when the SkyCulture is updated.
//! @param the path to a file containing the common names for bright stars. //! @param the path to a file containing the common names for bright stars.
skipping to change at line 325 skipping to change at line 355
//! Loads scientific names for stars from a file. //! Loads scientific names for stars from a file.
//! Called when the SkyCulture is updated. //! Called when the SkyCulture is updated.
//! @param the path to a file containing the scientific names for br ight stars. //! @param the path to a file containing the scientific names for br ight stars.
void loadSciNames(const QString& sciNameFile); void loadSciNames(const QString& sciNameFile);
//! Loads GCVS from a file. //! Loads GCVS from a file.
//! @param the path to a file containing the GCVS. //! @param the path to a file containing the GCVS.
void loadGcvs(const QString& GcvsFile); void loadGcvs(const QString& GcvsFile);
//! Loads cross-index data from a file. //! Loads WDS from a file.
//! @param the path to a file containing the cross-index data. //! @param the path to a file containing the WDS.
void loadCrossIndex(const QString& crossIndexFile); void loadWds(const QString& WdsFile);
//! Loads cross-identification data from a file.
//! @param the path to a file containing the cross-identification da
ta.
void loadCrossIdentificationData(const QString& crossIdFile);
//! Gets the maximum search level. //! Gets the maximum search level.
// TODO: add a non-lame description - what is the purpose of the max search level? // TODO: add a non-lame description - what is the purpose of the max search level?
int getMaxSearchLevel() const; int getMaxSearchLevel() const;
//! Load all the stars from the files. //! Load all the stars from the files.
void loadData(QVariantMap starsConfigFile); void loadData(QVariantMap starsConfigFile);
//! Draw a nice animated pointer around the object. //! Draw a nice animated pointer around the object.
void drawPointer(StelPainter& sPainter, const StelCore* core); void drawPointer(StelPainter& sPainter, const StelCore* core);
LinearFader labelsFader; LinearFader labelsFader;
LinearFader starsFader; LinearFader starsFader;
bool flagStarName; bool flagStarName;
float labelsAmount; double labelsAmount;
bool gravityLabel; bool gravityLabel;
int maxGeodesicGridLevel; int maxGeodesicGridLevel;
int lastMaxSearchLevel; int lastMaxSearchLevel;
// A ZoneArray per grid level // A ZoneArray per grid level
QVector<ZoneArray*> gridLevels; QVector<ZoneArray*> gridLevels;
static void initTriangleFunc(int lev, int index, static void initTriangleFunc(int lev, int index,
const Vec3f &c0, const Vec3f &c0,
const Vec3f &c1, const Vec3f &c1,
skipping to change at line 381 skipping to change at line 415
static QHash<int, QString> sciNamesMapI18n; static QHash<int, QString> sciNamesMapI18n;
static QMap<QString, int> sciNamesIndexI18n; static QMap<QString, int> sciNamesIndexI18n;
static QHash<int, QString> sciAdditionalNamesMapI18n; static QHash<int, QString> sciAdditionalNamesMapI18n;
static QMap<QString, int> sciAdditionalNamesIndexI18n; static QMap<QString, int> sciAdditionalNamesIndexI18n;
static QHash<int, varstar> varStarsMapI18n; static QHash<int, varstar> varStarsMapI18n;
static QMap<QString, int> varStarsIndexI18n; static QMap<QString, int> varStarsIndexI18n;
static QHash<int, wds> wdsStarsMapI18n;
static QMap<QString, int> wdsStarsIndexI18n;
static QHash<int, int> saoStarsMap; static QHash<int, int> saoStarsMap;
static QMap<int, int> saoStarsIndex; static QMap<int, int> saoStarsIndex;
static QHash<int, int> hdStarsMap; static QHash<int, int> hdStarsMap;
static QMap<int, int> hdStarsIndex; static QMap<int, int> hdStarsIndex;
QFont starFont; QFont starFont;
static bool flagSciNames; static bool flagSciNames;
Vec3f labelColor; Vec3f labelColor;
StelTextureSP texPointer; // The selection pointer tex ture StelTextureSP texPointer; // The selection pointer tex ture
 End of changes. 18 change blocks. 
25 lines changed or deleted 64 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/