NebulaMgr.hpp   NebulaMgr.hpp 
skipping to change at line 24 skipping to change at line 24
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#ifndef _NEBULAMGR_HPP_ #ifndef _NEBULAMGR_HPP_
#define _NEBULAMGR_HPP_ #define _NEBULAMGR_HPP_
#include <QString>
#include <QStringList>
#include <QFont>
#include "Nebula.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 <QString>
#include <QStringList>
#include <QFont>
class Nebula; class Nebula;
class StelTranslator; class StelTranslator;
class StelToneReproducer; class StelToneReproducer;
class QSettings; class QSettings;
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
READ getFlagHints
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
//! those with no individual texture). //! those with no individual texture).
//! - Load the pointer texture. //! - Load the pointer texture.
//! - Set flags values from ini parser which relate to nebula displ ay. //! - Set flags values from ini parser which relate to nebula displ ay.
//! - call updateI18n() to translate names. //! - call updateI18n() to translate names.
virtual void init(); virtual void init();
//! Draws all nebula objects. //! Draws all nebula objects.
virtual void draw(StelCore* core, class StelRenderer* renderer); virtual void draw(StelCore* core);
//! Update state which is time dependent. //! Update state which is time dependent.
virtual void update(double deltaTime) {hintsFader.update((int)(delta Time*1000)); flagShow.update((int)(deltaTime*1000));} virtual void update(double deltaTime) {hintsFader.update((int)(delta Time*1000)); flagShow.update((int)(deltaTime*1000));}
//! Determines the order in which the various modules are drawn. //! Determines the order in which the various modules are drawn.
virtual double getCallOrder(StelModuleActionName actionName) const; virtual double getCallOrder(StelModuleActionName actionName) const;
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Methods defined in StelObjectManager class // Methods defined in StelObjectManager class
//! Used to get a vector of objects which are near to some position. //! Used to get a vector of objects which are near to some position.
skipping to change at line 107 skipping to change at line 112
//! 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) const;
// empty for now // empty for now
virtual QStringList listAllObjects(bool inEnglish) const { Q_UNUSED( inEnglish) return QStringList(); } virtual QStringList listAllObjects(bool inEnglish) const { Q_UNUSED( inEnglish) return QStringList(); }
virtual QString getName() const { return "Nebulae"; } virtual QString getName() const { return "Nebulae"; }
//! Compute the maximum magntiude for which hints will be displayed.
float computeMaxMagHint(const class StelSkyDrawer* skyDrawer) const;
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// 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 color used to draw the nebula symbols (circles, boxes. e tc).
//! @param c The color of the nebula symbols
//! @code
//! // example of usage in scripts
//! NebulaMgr.setCirclesColor(Vec3f(1.0,0.0,0.0));
//! @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 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.
skipping to change at line 135 skipping to change at line 148
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 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 the color used to draw nebula labels. //! Set the color used to draw nebula labels.
//! @param c The color of the nebula labels
//! @code
//! // example of usage in scripts
//! NebulaMgr.setLabelsColor(Vec3f(1.0,0.0,0.0));
//! @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(float a) {labelsAmount=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
skipping to change at line 166 skipping to change at line 184
//! Sets the colors of the Nebula labels and markers according to th e //! Sets the colors of the Nebula labels and markers according to th e
//! values in a configuration object //! values in a configuration object
void setStelStyle(const QString& section); 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);
//! Search the Nebulae by position //! Search the Nebulae by position
NebulaP search(const Vec3d& pos); NebulaP search(const Vec3d& pos);
//! Load a set of nebula images. //! Load a set of nebula images.
//! 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, class StelRenderer* renderer) ; void drawPointer(const StelCore* core, StelPainter& sPainter);
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);
bool loadNGC(const QString& fileName); bool loadNGC(const QString& fileName);
bool loadNGCOld(const QString& catNGC); bool loadNGCOld(const QString& catNGC);
bool loadNGCNames(const QString& fileName); bool loadNGCNames(const QString& fileName);
QVector<NebulaP> nebArray; // The nebulas list QVector<NebulaP> nebArray; // The nebulas list
skipping to change at line 205 skipping to change at line 224
//! 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
StelTextureNew* texPointer; StelTextureSP texPointer;
QFont nebulaFont; // Font used for names printing QFont nebulaFont; // Font used for names printing
//! Textures used to draw nebula hints.
Nebula::NebulaHintTextures nebulaHintTextures;
}; };
#endif // _NEBULAMGR_HPP_ #endif // _NEBULAMGR_HPP_
 End of changes. 12 change blocks. 
10 lines changed or deleted 26 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/