NebulaMgr.hpp   NebulaMgr.hpp 
skipping to change at line 51 skipping to change at line 51
typedef QSharedPointer<Nebula> NebulaP; typedef QSharedPointer<Nebula> NebulaP;
//! @class NebulaMgr //! @class NebulaMgr
//! Manage a collection of nebulae. This class is used //! Manage a collection of nebulae. This class is used
//! to display the NGC catalog with information, and textures for some of t hem. //! to display the NGC catalog with information, and textures for some of t hem.
// GZ: This doc seems outdated/misleading - photo textures are not mamaged here but in StelSkyImageTile // GZ: This doc seems outdated/misleading - photo textures are not mamaged here but in StelSkyImageTile
class NebulaMgr : public StelObjectModule class NebulaMgr : public StelObjectModule
{ {
Q_OBJECT Q_OBJECT
//StelActions
Q_PROPERTY(bool flagHintDisplayed Q_PROPERTY(bool flagHintDisplayed
READ getFlagHints READ getFlagHints
WRITE setFlagHints) WRITE setFlagHints
NOTIFY flagHintsDisplayedChanged)
Q_PROPERTY(bool flagTypeFiltersUsage
READ getFlagUseTypeFilters
WRITE setFlagUseTypeFilters
NOTIFY flagUseTypeFiltersChanged)
//StelProperties
Q_PROPERTY(Nebula::TypeGroup typeFilters
READ getTypeFilters
WRITE setTypeFilters
NOTIFY typeFiltersChanged
)
Q_PROPERTY(Nebula::CatalogGroup catalogFilters
READ getCatalogFilters
WRITE setCatalogFilters
NOTIFY catalogFiltersChanged
)
Q_PROPERTY(bool hintsProportional
READ getHintsProportional
WRITE setHintsProportional
NOTIFY hintsProportionalChanged
)
Q_PROPERTY(bool flagSurfaceBrightnessUsage
READ getFlagSurfaceBrightnessUsage
WRITE setFlagSurfaceBrightnessUsage
NOTIFY flagSurfaceBrightnessUsageChanged
)
Q_PROPERTY(double labelsAmount
READ getLabelsAmount
WRITE setLabelsAmount
NOTIFY labelsAmountChanged
)
Q_PROPERTY(double hintsAmount
READ getHintsAmount
WRITE setHintsAmount
NOTIFY hintsAmountChanged
)
Q_PROPERTY(bool flagDesignationLabels
READ getDesignationUsage
WRITE setDesignationUsage
NOTIFY designationUsageChanged
)
public: public:
NebulaMgr(); NebulaMgr();
virtual ~NebulaMgr(); virtual ~NebulaMgr();
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Methods defined in the StelModule class // Methods defined in the StelModule class
//! Initialize the NebulaMgr object. //! Initialize the NebulaMgr object.
//! - Load the font into the Nebula class, which is used to draw Ne bula labels. //! - Load the font into the Nebula class, which is used to draw Ne bula labels.
//! - Load the texture used to draw nebula locations into the Nebul a class (for //! - Load the texture used to draw nebula locations into the Nebul a class (for
//! those with no individual texture). //! those with no individual texture).
skipping to change at line 97 skipping to change at line 138
//! Return the matching nebula object's pointer if exists or NULL. //! Return the matching nebula object's pointer if exists or NULL.
//! @param nameI18n The case in-sensistive nebula name or NGC M cata log name : format can //! @param nameI18n The case in-sensistive nebula name or NGC M cata log name : format can
//! be M31, M 31, NGC31, NGC 31 //! be M31, M 31, NGC31, NGC 31
virtual StelObjectP searchByNameI18n(const QString& nameI18n) const; virtual StelObjectP searchByNameI18n(const QString& nameI18n) const;
//! Return the matching nebula if exists or NULL. //! Return the matching nebula if exists or NULL.
//! @param name The case in-sensistive standard program name //! @param name The case in-sensistive standard program 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 deep-sky objects with the proper names only. //! @note Loading deep-sky objects with the proper 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 "Deep-sky objects"; } virtual QString getName() const { return "Deep-sky objects"; }
//! Compute the maximum magntiude for which hints will be displayed. //! Compute the maximum magntiude for which hints will be displayed.
float computeMaxMagHint(const class StelSkyDrawer* skyDrawer) const; float computeMaxMagHint(const class StelSkyDrawer* skyDrawer) const;
void setCatalogFilters(const Nebula::CatalogGroup& cflags);
const Nebula::CatalogGroup& getCatalogFilters() const { return Nebul
a::catalogFilters; }
void setTypeFilters(const Nebula::TypeGroup& tflags) { Nebula::typeF
ilters=tflags; }
const Nebula::TypeGroup& getTypeFilters() const { return Nebula::typ
eFilters; }
bool objectInDisplayedCatalog(NebulaP n); bool objectInDisplayedCatalog(NebulaP n);
//! Get designation for latest selected DSO with priority
//! @note using for bookmarks feature as example
//! @return a designation
QString getLatestSelectedDSODesignation();
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Properties setters and getters // Properties setters and getters
public slots: public slots:
void setCatalogFilters(Nebula::CatalogGroup cflags);
Nebula::CatalogGroup getCatalogFilters() const { return Nebula::cata
logFilters; }
void setTypeFilters(Nebula::TypeGroup tflags);
Nebula::TypeGroup getTypeFilters() const { return Nebula::typeFilter
s; }
//! Set the default color used to draw the nebula symbols (default c ircles, etc). //! Set the default color used to draw the nebula symbols (default c ircles, etc).
//! @param c The color of the nebula symbols //! @param c The color of the nebula symbols
//! @code //! @code
//! // example of usage in scripts //! // example of usage in scripts
//! NebulaMgr.setCirclesColor(Vec3f(0.6,0.8,0.0)); //! NebulaMgr.setCirclesColor(Vec3f(0.6,0.8,0.0));
//! @endcode //! @endcode
void setCirclesColor(const Vec3f& c); void setCirclesColor(const Vec3f& c);
//! Get current value of the nebula circle color. //! Get current value of the nebula circle color.
const Vec3f& getCirclesColor(void) const; const Vec3f& getCirclesColor(void) const;
skipping to change at line 440 skipping to change at line 480
//! Set the color used to draw the stars symbols. //! Set the color used to draw the stars symbols.
//! @param c The color of the stars symbols //! @param c The color of the stars symbols
//! @code //! @code
//! // example of usage in scripts //! // example of usage in scripts
//! NebulaMgr.setStarColor(Vec3f(1.0,1.0,0.0)); //! NebulaMgr.setStarColor(Vec3f(1.0,1.0,0.0));
//! @endcode //! @endcode
void setStarColor(const Vec3f& c); void setStarColor(const Vec3f& c);
//! Get current value of the star symbol color. //! Get current value of the star symbol color.
const Vec3f& getStarColor(void) const; const Vec3f& getStarColor(void) const;
//! Set Nebulae Hints circle scale.
void setCircleScale(float scale);
//! Get Nebulae Hints circle scale.
float getCircleScale(void) const;
//! Set how long it takes for nebula hints to fade in and out when t urned on and off. //! Set how long it takes for nebula hints to fade in and out when t urned on and off.
//! @param duration given in seconds //! @param duration given in seconds
void setHintsFadeDuration(float duration) {hintsFader.setDuration((i nt) (duration * 1000.f));} void setHintsFadeDuration(float duration) {hintsFader.setDuration((i nt) (duration * 1000.f));}
//! Set flag for displaying Nebulae Hints. //! Set flag for displaying Nebulae Hints.
void setFlagHints(bool b) {hintsFader=b;} void setFlagHints(bool b) { if (hintsFader!=b) { hintsFader=b; emit flagHintsDisplayedChanged(b);}}
//! Get flag for displaying Nebulae Hints. //! Get flag for displaying Nebulae Hints.
bool getFlagHints(void) const {return hintsFader;} bool getFlagHints(void) const {return hintsFader;}
//! Set whether hints (symbols) should be scaled according to nebula size. //! Set whether hints (symbols) should be scaled according to nebula size.
void setHintsProportional(const bool proportional); void setHintsProportional(const bool proportional);
//! Get whether hints (symbols) are scaled according to nebula size. //! Get whether hints (symbols) are scaled according to nebula size.
bool getHintsProportional(void) const; bool getHintsProportional(void) const;
//! Set flag for usage designations of DSO for their labels instead
common names.
void setDesignationUsage(const bool flag);
//! Get flag for usage designations of DSO for their labels instead
common names.
bool getDesignationUsage(void) const;
//! Set whether hints (symbols) should be visible according to surfa ce brightness value. //! Set whether hints (symbols) should be visible according to surfa ce brightness value.
void setFlagSurfaceBrightnessUsage(const bool usage) { Nebula::surfa ceBrightnessUsage=usage; } void setFlagSurfaceBrightnessUsage(const bool usage) {if(usage!=Nebu la::surfaceBrightnessUsage){ Nebula::surfaceBrightnessUsage=usage; emit fla gSurfaceBrightnessUsageChanged(usage);}}
//! Get whether hints (symbols) are visible according to surface bri ghtness value. //! Get whether hints (symbols) are visible according to surface bri ghtness value.
bool getFlagSurfaceBrightnessUsage(void) const { return Nebula::surf aceBrightnessUsage; } bool getFlagSurfaceBrightnessUsage(void) const { return Nebula::surf aceBrightnessUsage; }
//! Set flag used to turn on and off Nebula rendering. //! Set flag used to turn on and off Nebula rendering.
void setFlagShow(bool b) { flagShow = b; } void setFlagShow(bool b) { flagShow = b; }
//! Get value of flag used to turn on and off Nebula rendering. //! Get value of flag used to turn on and off Nebula rendering.
bool getFlagShow(void) const { return flagShow; } bool getFlagShow(void) const { return flagShow; }
//! Set flag used to turn on and off DSO type filtering. //! Set flag used to turn on and off DSO type filtering.
void setFlagTypeFiltersUsage(bool b) { Nebula::flagUsageTypeFilter=b ; } void setFlagUseTypeFilters(bool b) { if (Nebula::flagUseTypeFilters! =b) { Nebula::flagUseTypeFilters=b; emit flagUseTypeFiltersChanged(b);}}
//! Get value of flag used to turn on and off DSO type filtering. //! Get value of flag used to turn on and off DSO type filtering.
bool getFlagTypeFiltersUsage(void) const { return Nebula::flagUsageT ypeFilter; } bool getFlagUseTypeFilters(void) const { return Nebula::flagUseTypeF ilters; }
//! Set the color used to draw nebula labels. //! Set the color used to draw nebula labels.
//! @param c The color of the nebula labels //! @param c The color of the nebula labels
//! @code //! @code
//! // example of usage in scripts //! // example of usage in scripts
//! NebulaMgr.setLabelsColor(Vec3f(1.0,0.0,0.0)); //! NebulaMgr.setLabelsColor(Vec3f(1.0,0.0,0.0));
//! @endcode //! @endcode
void setLabelsColor(const Vec3f& c); void setLabelsColor(const Vec3f& c);
//! Get current value of the nebula label color. //! Get current value of the nebula label color.
const Vec3f& getLabelsColor(void) const; const Vec3f& getLabelsColor(void) const;
//! Set the amount of nebulae labels. The real amount is also propor tional with FOV. //! Set the amount of nebulae labels. The real amount is also propor tional with FOV.
//! The limit is set in function of the nebulae magnitude //! The limit is set in function of the nebulae 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 nebulae labels. The real amount is also propor tional with FOV. //! Get the amount of nebulae labels. The real amount is also propor tional 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;}
//! Set the amount of nebulae hints. The real amount is also proport ional with FOV. //! Set the amount of nebulae hints. The real amount is also proport ional with FOV.
//! The limit is set in function of the nebulae magnitude //! The limit is set in function of the nebulae magnitude
//! @param f the amount between 0 and 10. 0 is no hints, 10 is maxim um of hints //! @param f the amount between 0 and 10. 0 is no hints, 10 is maxim um of hints
void setHintsAmount(float f) {hintsAmount = f;} void setHintsAmount(double f) {if(hintsAmount!=f){hintsAmount = f; e mit hintsAmountChanged(f);}}
//! Get the amount of nebulae labels. The real amount is also propor tional with FOV. //! Get the amount of nebulae labels. The real amount is also propor tional with FOV.
//! @return the amount between 0 and 10. 0 is no hints, 10 is maximu m of hints //! @return the amount between 0 and 10. 0 is no hints, 10 is maximu m of hints
float getHintsAmount(void) const {return hintsAmount;} double getHintsAmount(void) const {return hintsAmount;}
signals:
//! Emitted when hints are toggled.
void flagHintsDisplayedChanged(bool b);
//! Emitted when filter types are changed.
void flagUseTypeFiltersChanged(bool b);
//! Emitted when the catalog filter is changed
void catalogFiltersChanged(Nebula::CatalogGroup flags);
//! Emitted when the type filter is changed
void typeFiltersChanged(Nebula::TypeGroup flags);
void hintsProportionalChanged(bool b);
void designationUsageChanged(bool b);
void flagSurfaceBrightnessUsageChanged(bool b);
void labelsAmountChanged(double a);
void hintsAmountChanged(double f);
private slots: private slots:
//! Sets the colors of the Nebula labels and markers according to th
e
//! values in a configuration object
void setStelStyle(const QString& section);
//! Update i18 names from English names according to passed translat or. //! Update i18 names from English names according to passed translat or.
//! The translation is done using gettext with translated strings de fined //! The translation is done using gettext with translated strings de fined
//! in translations.h //! in translations.h
void updateI18n(); void updateI18n();
private: private:
//! Search for a nebula object by name. e.g. M83, NGC 1123, IC 1234. //! Search for a nebula object by name. e.g. M83, NGC 1123, IC 1234.
NebulaP search(const QString& name); NebulaP search(const QString& name);
skipping to change at line 562 skipping to change at line 612
QVector<NebulaP> dsoArray; // The DSO list QVector<NebulaP> dsoArray; // The DSO list
QHash<unsigned int, NebulaP> dsoIndex; QHash<unsigned int, NebulaP> dsoIndex;
LinearFader hintsFader; LinearFader hintsFader;
LinearFader flagShow; LinearFader flagShow;
//! The internal grid for fast positional lookup //! The internal grid for fast positional lookup
StelSphericalIndex nebGrid; StelSphericalIndex nebGrid;
//! The amount of hints (between 0 and 10) //! The amount of hints (between 0 and 10)
float hintsAmount; double hintsAmount;
//! The amount of labels (between 0 and 10) //! The amount of labels (between 0 and 10)
float labelsAmount; double labelsAmount;
//! The selection pointer texture //! The selection pointer texture
StelTextureSP texPointer; StelTextureSP texPointer;
QFont nebulaFont; // Font used for names printing QFont nebulaFont; // Font used for names printing
// For DSO convertor // For DSO convertor
bool flagConverter; bool flagConverter;
bool flagDecimalCoordinates; bool flagDecimalCoordinates;
}; };
 End of changes. 20 change blocks. 
43 lines changed or deleted 88 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/