NebulaMgr.hpp   NebulaMgr.hpp 
skipping to change at line 30 skipping to change at line 30
*/ */
#ifndef _NEBULAMGR_HPP_ #ifndef _NEBULAMGR_HPP_
#define _NEBULAMGR_HPP_ #define _NEBULAMGR_HPP_
#include "StelObjectType.hpp" #include "StelObjectType.hpp"
#include "StelFader.hpp" #include "StelFader.hpp"
#include "StelSphericalIndex.hpp" #include "StelSphericalIndex.hpp"
#include "StelObjectModule.hpp" #include "StelObjectModule.hpp"
#include "StelTextureTypes.hpp" #include "StelTextureTypes.hpp"
#include "Nebula.hpp"
#include <QString> #include <QString>
#include <QStringList> #include <QStringList>
#include <QFont> #include <QFont>
class Nebula;
class StelTranslator; class StelTranslator;
class StelToneReproducer; class StelToneReproducer;
class QSettings; class QSettings;
class StelPainter; class StelPainter;
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
Q_PROPERTY(bool flagHintDisplayed Q_PROPERTY(bool flagHintDisplayed
READ getFlagHints READ getFlagHints
WRITE setFlagHints) WRITE setFlagHints)
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
skipping to change at line 117 skipping to change at line 117
//! @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) 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);
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Properties setters and getters // Properties setters and getters
public slots: public slots:
//! Set the color used to draw the nebula symbols (circles, boxes. e tc). //! 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(1.0,0.0,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;
//! Set the color used to draw the galaxy symbols (ellipses).
//! @param c The color of the galaxy symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setGalaxyColor(Vec3f(1.0,0.0,0.0));
//! @endcode
void setGalaxyColor(const Vec3f& c);
//! Get current value of the galaxy symbol color.
const Vec3f& getGalaxyColor(void) const;
//! Set the color used to draw the active galaxy symbols (ellipses).
//! @param c The color of the active galaxy symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setActiveGalaxyColor(Vec3f(1.0,0.0,0.0));
//! @endcode
void setActiveGalaxyColor(const Vec3f& c);
//! Get current value of the active galaxy symbol color.
const Vec3f& getActiveGalaxyColor(void) const;
//! Set the color used to draw the interacting galaxy symbols (ellip
ses).
//! @param c The color of the interacting galaxy symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setInteractingGalaxyColor(Vec3f(1.0,0.0,0.0));
//! @endcode
void setInteractingGalaxyColor(const Vec3f& c);
//! Get current value of the interacting galaxy symbol color.
const Vec3f& getInteractingGalaxyColor(void) const;
//! Set the color used to draw the radio galaxy symbols (ellipses).
//! @param c The color of the radio galaxy symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setRadioGalaxyColor(Vec3f(1.0,0.0,0.0));
//! @endcode
void setRadioGalaxyColor(const Vec3f& c);
//! Get current value of the radio galaxy symbol color.
const Vec3f& getRadioGalaxyColor(void) const;
//! Set the color used to draw the bright nebula symbols (emission n
ebula boxes, planetary nebulae circles).
//! @param c The color of the nebula symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setBrightNebulaColor(Vec3f(0.0,1.0,0.0));
//! @endcode
void setBrightNebulaColor(const Vec3f& c);
//! Get current value of the nebula circle color.
const Vec3f& getBrightNebulaColor(void) const;
//! Set the color used to draw the ionized hydrogen region symbols.
//! @param c The color of the ionized hydrogen region symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setHydrogenRegionColor(Vec3f(0.0,1.0,0.0));
//! @endcode
void setHydrogenRegionColor(const Vec3f& c);
//! Get current value of the hydrogen region symbol color.
const Vec3f& getHydrogenRegionColor(void) const;
//! Set the color used to draw the supernova remnant symbols.
//! @param c The color of the supernova remnant symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setSupernovaRemnantColor(Vec3f(0.0,1.0,0.0));
//! @endcode
void setSupernovaRemnantColor(const Vec3f& c);
//! Get current value of the supernova remnant symbol color.
const Vec3f& getSupernovaRemnantColor(void) const;
//! Set the color used to draw the dark nebula symbols (gray boxes).
//! @param c The color of the dark nebula symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setDarkNebulaColor(Vec3f(0.2,0.2,0.2));
//! @endcode
void setDarkNebulaColor(const Vec3f& c);
//! Get current value of the dark nebula color.
const Vec3f& getDarkNebulaColor(void) const;
//! Set the color used to draw the star cluster symbols (Open/Globul
ar).
//! @param c The color of the cluster symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setClusterColor(Vec3f(1.0,1.0,0.0));
//! @endcode
void setClusterColor(const Vec3f& c);
//! Get current value of the nebula circle color.
const Vec3f& getClusterColor(void) const;
//! Set Nebulae Hints circle scale. //! Set Nebulae Hints circle scale.
void setCircleScale(float scale); void setCircleScale(float scale);
//! Get Nebulae Hints circle scale. //! Get Nebulae Hints circle scale.
float getCircleScale(void) const; 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) {hintsFader=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 whether hints (symbols) should be visible according to surfa
ce brightness value.
void setFlagSurfaceBrightnessUsage(const bool usage) { Nebula::surfa
ceBrightnessUsage=usage; }
//! Get whether hints (symbols) are visible according to surface bri
ghtness value.
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.
void setFlagTypeFiltersUsage(bool b) { Nebula::flagUsageTypeFilter=b
; }
//! Get value of flag used to turn on and off DSO type filtering.
bool getFlagTypeFiltersUsage(void) const { return Nebula::flagUsageT
ypeFilter; }
//! 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;
skipping to change at line 209 skipping to change at line 309
//! Each sub-directory of the INSTALLDIR/nebulae directory contains a set of //! Each sub-directory of the INSTALLDIR/nebulae directory contains a set of
//! nebula textures. The sub-directory is the setName. Each set ha s its //! nebula textures. The sub-directory is the setName. Each set ha s its
//! own nebula_textures.fab file and corresponding image files. //! own nebula_textures.fab file and corresponding image files.
//! This function loads a set of textures. //! This function loads a set of textures.
//! @param setName a string which corresponds to the directory where the set resides //! @param setName a string which corresponds to the directory where the set resides
void loadNebulaSet(const QString& setName); void loadNebulaSet(const QString& setName);
//! Draw a nice animated pointer around the object //! Draw a nice animated pointer around the object
void drawPointer(const StelCore* core, StelPainter& sPainter); void drawPointer(const StelCore* core, StelPainter& sPainter);
NebulaP searchDSO(unsigned int DSO);
NebulaP searchM(unsigned int M); NebulaP searchM(unsigned int M);
NebulaP searchNGC(unsigned int NGC); NebulaP searchNGC(unsigned int NGC);
NebulaP searchIC(unsigned int IC); NebulaP searchIC(unsigned int IC);
NebulaP searchC(unsigned int C); NebulaP searchC(unsigned int C);
NebulaP searchB(unsigned int B); NebulaP searchB(unsigned int B);
NebulaP searchSh2(unsigned int Sh2); NebulaP searchSh2(unsigned int Sh2);
NebulaP searchVdB(unsigned int VdB); NebulaP searchVdB(unsigned int VdB);
NebulaP searchRCW(unsigned int RCW); NebulaP searchRCW(unsigned int RCW);
NebulaP searchLDN(unsigned int LDN); NebulaP searchLDN(unsigned int LDN);
NebulaP searchLBN(unsigned int LBN); NebulaP searchLBN(unsigned int LBN);
NebulaP searchCr(unsigned int Cr); NebulaP searchCr(unsigned int Cr);
NebulaP searchMel(unsigned int Mel); NebulaP searchMel(unsigned int Mel);
bool loadNGC(const QString& fileName); NebulaP searchPGC(unsigned int PGC);
bool loadNGCOld(const QString& catNGC); NebulaP searchUGC(unsigned int UGC);
bool loadNGCNames(const QString& fileName); NebulaP searchCed(QString Ced);
bool loadBarnard(const QString& filename);
bool loadSharpless(const QString& filename); // Load catalog of DSO
bool loadVandenBergh(const QString& filename); bool loadDSOCatalog(const QString& filename);
bool loadRCW(const QString& filename); void convertDSOCatalog(const QString& in, const QString& out, bool d
bool loadLDN(const QString& filename); ecimal);
bool loadLBN(const QString& filename); // Load proper names for DSO
bool loadDSONames(const QString& filename);
QVector<NebulaP> dsoArray; // The DSO list
QHash<unsigned int, NebulaP> dsoIndex;
QVector<NebulaP> nebArray; // The nebulas list
QHash<unsigned int, NebulaP> ngcIndex;
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; float hintsAmount;
//! The amount of labels (between 0 and 10) //! The amount of labels (between 0 and 10)
float labelsAmount; float 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
bool flagConverter;
bool flagDecimalCoordinates;
}; };
#endif // _NEBULAMGR_HPP_ #endif // _NEBULAMGR_HPP_
 End of changes. 13 change blocks. 
16 lines changed or deleted 135 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/