Nebula.hpp   Nebula.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 _NEBULA_HPP_ #ifndef _NEBULA_HPP_
#define _NEBULA_HPP_ #define _NEBULA_HPP_
#include <QString>
#include "StelObject.hpp" #include "StelObject.hpp"
#include "StelTranslator.hpp" #include "StelTranslator.hpp"
#include "StelProjectorType.hpp" #include "StelTextureTypes.hpp"
#include <QString>
class StelPainter;
class QDataStream; class QDataStream;
class Nebula : public StelObject class Nebula : public StelObject
{ {
friend class NebulaMgr; friend class NebulaMgr;
public: public:
Nebula(); Nebula();
~Nebula(); ~Nebula();
//! Nebula support the following InfoStringGroup flags: //! Nebula support the following InfoStringGroup flags:
//! - Name //! - Name
//! - CatalogNumber //! - CatalogNumber
//! - Magnitude //! - Magnitude
//! - RaDec //! - RaDec
//! - AltAzi //! - AltAzi
//! - Distance //! - Distance
//! - Size //! - Size
//! - Extra1 (contains the Nebula type, which might be "Galaxy", "Cl uster" or similar) //! - Extra (contains the Nebula type, which might be "Galaxy", "Clu ster" or similar)
//! - PlainText //! - PlainText
//! @param core the StelCore object //! @param core the StelCore object
//! @param flags a set of InfoStringGroup items to include in the re turn value. //! @param flags a set of InfoStringGroup items to include in the re turn value.
//! @return a QString containing an HMTL encoded description of the Nebula. //! @return a QString containing an HMTL encoded description of the Nebula.
virtual QString getInfoString(const StelCore *core, const InfoString Group& flags) const; virtual QString getInfoString(const StelCore *core, const InfoString Group& flags) const;
virtual QString getType() const {return "Nebula";} virtual QString getType() const {return "Nebula";}
virtual Vec3d getJ2000EquatorialPos(const StelCore*) const {return X YZ;} virtual Vec3d getJ2000EquatorialPos(const StelCore*) const {return X YZ;}
virtual double getCloseViewFov(const StelCore* core = NULL) const; virtual double getCloseViewFov(const StelCore* core = NULL) const;
virtual float getVMagnitude(const StelCore* core, bool withExtinctio n=false) const; virtual float getVMagnitude(const StelCore* core) const;
virtual float getSelectPriority(const StelCore* core) const; virtual float getSelectPriority(const StelCore* core) const;
virtual Vec3f getInfoColor() const; virtual Vec3f getInfoColor() const;
virtual QString getNameI18n() const {return nameI18;} virtual QString getNameI18n() const {return nameI18;}
virtual QString getEnglishName() const {return englishName;} virtual QString getEnglishName() const {return englishName;}
virtual double getAngularSize(const StelCore*) const {return angular Size*0.5;} virtual double getAngularSize(const StelCore*) const {return angular Size*0.5;}
virtual SphericalRegionP getRegion() const {return pointRegion;} virtual SphericalRegionP getRegion() const {return pointRegion;}
// Methods specific to Nebula // Methods specific to Nebula
void setLabelColor(const Vec3f& v) {labelColor = v;} void setLabelColor(const Vec3f& v) {labelColor = v;}
void setCircleColor(const Vec3f& v) {circleColor = v;} void setCircleColor(const Vec3f& v) {circleColor = v;}
//! Get the printable nebula Type. //! Get the printable nebula Type.
//! @return the nebula type code. //! @return the nebula type code.
QString getTypeString() const; QString getTypeString() const;
float getSurfaceBrightness(const StelCore* core) const;
float getSurfaceBrightnessWithExtinction(const StelCore* core) const
;
private: private:
friend struct DrawNebulaFuncObject; friend struct DrawNebulaFuncObject;
//! Textures used to draw nebula hints.
struct NebulaHintTextures
{
//! The symbolic circle texture. (default)
class StelTextureNew* texCircle;
//! The symbolic galaxy texture. (Type 0)
class StelTextureNew* texGalaxy;
//! The open cluster marker texture. (Type 1)
class StelTextureNew* texOpenCluster;
//! The globular cluster marker texture. (Type 2)
class StelTextureNew* texGlobularCluster;
//! The diffuse nebula marker texture. (Type 3)
class StelTextureNew* texDiffuseNebula;
//! The planetary nebula marker texture. (type 4)
class StelTextureNew* texPlanetaryNebula;
//! The "Open cluster with Nebulosity" nebula marker texture
. (Type 7)
class StelTextureNew* texOpenClusterWithNebulosity;
//! Are we initialized yet?
bool initialized;
//! Default constructor - construct uninitialized NebulaHint
Textures.
NebulaHintTextures(): initialized(false){}
//! Destructor - frees resources if initialized.
~NebulaHintTextures();
//! Lazily initialize the data, using given renderer to crea
te textures/shader.
void lazyInit(class StelRenderer* renderer);
};
//! @enum NebulaType Nebula types //! @enum NebulaType Nebula types
enum NebulaType enum NebulaType
{ {
NebGx=0, //!< Galaxy NebGx=0, //!< Galaxy
NebOc=1, //!< Open star cluster NebOc=1, //!< Open star cluster
NebGc=2, //!< Globular star cluster, usually in the Milk y Way Galaxy NebGc=2, //!< Globular star cluster, usually in the Milk y Way Galaxy
NebN=3, //!< Bright emission or reflection nebula NebN=3, //!< Bright emission or reflection nebula
NebPn=4, //!< Planetary nebula NebPn=4, //!< Planetary nebula
NebDn=5, //!< ??? Dark Nebula? Does not exist in cu rrent catalog NebDn=5, //!< ??? Dark Nebula? Does not exist in cu rrent catalog
NebIg=6, //!< ??? Irregular Galaxy? Does not exist in cu rrent catalog NebIg=6, //!< ??? Irregular Galaxy? Does not exist in cu rrent catalog
NebCn=7, //!< Cluster associated with nebulosity NebCn=7, //!< Cluster associated with nebulosity
NebUnknown=8 //!< Unknown type, catalog errors, "Unidentifie d Southern Objects" etc. NebUnknown=8 //!< Unknown type, catalog errors, "Unidentifie d Southern Objects" etc.
}; };
//! Translate nebula name using the passed translator //! Translate nebula name using the passed translator
void translateName(StelTranslator& trans) {nameI18 = trans.qtranslat e(englishName);} void translateName(const StelTranslator& trans) {nameI18 = trans.qtr anslate(englishName);}
bool readNGC(char *record); bool readNGC(char *record);
void readNGC(QDataStream& in); void readNGC(QDataStream& in);
void drawHints(StelRenderer* renderer, float maxMagHints, NebulaHint void drawLabel(StelPainter& sPainter, float maxMagLabel);
Textures& hintTextures); void drawHints(StelPainter& sPainter, float maxMagHints);
void drawLabel(StelRenderer* renderer, StelProjectorP projector, flo
at maxMagLabel);
unsigned int M_nb; // Messier Catalog number unsigned int M_nb; // Messier Catalog number
unsigned int NGC_nb; // New General Catalog number unsigned int NGC_nb; // New General Catalog number
unsigned int IC_nb; // Index Catalog number unsigned int IC_nb; // Index Catalog number
unsigned int C_nb; // Caldwell Catalog number unsigned int C_nb; // Caldwell Catalog number
QString englishName; // English name QString englishName; // English name
QString nameI18; // Nebula name QString nameI18; // Nebula name
float mag; // Apparent magnitude float mag; // Apparent magnitude
float angularSize; // Angular size in degree float angularSize; // Angular size in degree
Vec3d XYZ; // Cartesian equatorial position Vec3d XYZ; // Cartesian equatorial position
Vec3d XY; // Store temporary 2D position Vec3d XY; // Store temporary 2D position
NebulaType nType; NebulaType nType;
SphericalRegionP pointRegion; SphericalRegionP pointRegion;
static StelTextureSP texCircle; // The symbolic circle texture
static StelTextureSP texGalaxy;
static StelTextureSP texOpenCluster;
static StelTextureSP texGlobularCluster;
static StelTextureSP texPlanetaryNebula;
static StelTextureSP texDiffuseNebula;
static StelTextureSP texOpenClusterWithNebulosity;
static float hintsBrightness; static float hintsBrightness;
static Vec3f labelColor, circleColor; static Vec3f labelColor, circleColor;
static float circleScale; // Define the scaling of the hints c ircle static float circleScale; // Define the scaling of the hints c ircle
}; };
#endif // _NEBULA_HPP_ #endif // _NEBULA_HPP_
 End of changes. 10 change blocks. 
40 lines changed or deleted 20 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/