Nebula.hpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _NEBULA_HPP_
00022 #define _NEBULA_HPP_
00023
00024 #include <QString>
00025 #include "StelObject.hpp"
00026 #include "StelTranslator.hpp"
00027 #include "StelProjectorType.hpp"
00028
00029 class QDataStream;
00030
00031 class Nebula : public StelObject
00032 {
00033 friend class NebulaMgr;
00034 public:
00035 Nebula();
00036 ~Nebula();
00037
00051 virtual QString getInfoString(const StelCore *core, const InfoStringGroup& flags) const;
00052 virtual QString getType() const {return "Nebula";}
00053 virtual Vec3d getJ2000EquatorialPos(const StelCore*) const {return XYZ;}
00054 virtual double getCloseViewFov(const StelCore* core = NULL) const;
00055 virtual float getVMagnitude(const StelCore* core, bool withExtinction=false) const;
00056 virtual float getSelectPriority(const StelCore* core) const;
00057 virtual Vec3f getInfoColor() const;
00058 virtual QString getNameI18n() const {return nameI18;}
00059 virtual QString getEnglishName() const {return englishName;}
00060 virtual double getAngularSize(const StelCore*) const {return angularSize*0.5;}
00061 virtual SphericalRegionP getRegion() const {return pointRegion;}
00062
00063
00064 void setLabelColor(const Vec3f& v) {labelColor = v;}
00065 void setCircleColor(const Vec3f& v) {circleColor = v;}
00066
00069 QString getTypeString() const;
00070
00071 private:
00072 friend struct DrawNebulaFuncObject;
00073
00075 struct NebulaHintTextures
00076 {
00078 class StelTextureNew* texCircle;
00080 class StelTextureNew* texOpenCluster;
00082 class StelTextureNew* texGlobularCluster;
00084 class StelTextureNew* texPlanetaryNebula;
00086 bool initialized;
00087
00089 NebulaHintTextures(): initialized(false){}
00091 ~NebulaHintTextures();
00093 void lazyInit(class StelRenderer* renderer);
00094 };
00095
00097 enum NebulaType
00098 {
00099 NebGx=0,
00100 NebOc=1,
00101 NebGc=2,
00102 NebN=3,
00103 NebPn=4,
00104 NebDn=5,
00105 NebIg=6,
00106 NebCn=7,
00107 NebUnknown=8
00108 };
00109
00111 void translateName(StelTranslator& trans) {nameI18 = trans.qtranslate(englishName);}
00112
00113 bool readNGC(char *record);
00114 void readNGC(QDataStream& in);
00115
00116 void drawHints(StelRenderer* renderer, float maxMagHints, NebulaHintTextures& hintTextures);
00117 void drawLabel(StelRenderer* renderer, StelProjectorP projector, float maxMagLabel);
00118
00119 unsigned int M_nb;
00120 unsigned int NGC_nb;
00121 unsigned int IC_nb;
00122 QString englishName;
00123 QString nameI18;
00124 float mag;
00125 float angularSize;
00126 Vec3d XYZ;
00127 Vec3d XY;
00128 NebulaType nType;
00129
00130 SphericalRegionP pointRegion;
00131
00132 static float hintsBrightness;
00133
00134 static Vec3f labelColor, circleColor;
00135 static float circleScale;
00136 };
00137
00138 #endif // _NEBULA_HPP_
00139