00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _CONSTELLATION_HPP_
00022 #define _CONSTELLATION_HPP_
00023
00024 #include <vector>
00025 #include <QString>
00026 #include <QFont>
00027
00028 #include "StelObject.hpp"
00029 #include "StelUtils.hpp"
00030 #include "StelFader.hpp"
00031 #include "StelTextureTypes.hpp"
00032 #include "StelSphereGeometry.hpp"
00033
00034 class StarMgr;
00035 class StelPainter;
00036
00042 class Constellation : public StelObject
00043 {
00044 friend class ConstellationMgr;
00045 private:
00046 Constellation();
00047 ~Constellation();
00048
00049
00056 virtual QString getInfoString(const StelCore*, const InfoStringGroup& flags) const
00057 {
00058 if (flags&Name) return getNameI18n() + "(" + getShortName() + ")";
00059 else return "";
00060 }
00061
00064 virtual QString getType() const {return "Constellation";}
00065
00067 virtual Vec3d getJ2000EquatorialPos(const StelCore*) const {return XYZname;}
00068
00069 virtual double getAngularSize(const StelCore*) const {Q_ASSERT(0); return 0;}
00070
00078 bool read(const QString& record, StarMgr *starMgr);
00079
00081 void drawName(StelPainter& sPainter) const;
00083 void drawArt(StelPainter& sPainter) const;
00085 void drawBoundaryOptim(StelPainter& sPainter) const;
00086
00092 const Constellation* isStarIn(const StelObject*) const;
00093
00098 StelObjectP getBrightestStarInConstellation(void) const;
00099
00101 QString getNameI18n() const {return nameI18;}
00103 QString getEnglishName() const {return abbreviation;}
00105 QString getShortName() const {return abbreviation;}
00109 void drawOptim(StelPainter& sPainter, const StelCore* core, const SphericalCap& viewportHalfspace) const;
00111 void drawArtOptim(StelPainter& sPainter, const SphericalRegion& region) const;
00113 void update(int deltaTime);
00116 void setFlagLines(const bool b) {lineFader=b;}
00119 void setFlagBoundaries(const bool b) {boundaryFader=b;}
00122 void setFlagLabels(const bool b) {nameFader=b;}
00125 void setFlagArt(const bool b) {artFader=b;}
00128 bool getFlagLines() const {return lineFader;}
00131 bool getFlagBoundaries() const {return boundaryFader;}
00134 bool getFlagLabels() const {return nameFader;}
00137 bool getFlagArt() const {return artFader;}
00138
00140 QString nameI18;
00142 QString englishName;
00144 QString nativeName;
00146 QString abbreviation;
00148 Vec3d XYZname;
00149 Vec3d XYname;
00151 unsigned int numberOfSegments;
00153 StelObjectP* asterism;
00154
00155 StelTextureSP artTexture;
00156 StelVertexArray artPolygon;
00157 SphericalCap boundingCap;
00158
00160 LinearFader artFader, lineFader, nameFader, boundaryFader;
00161 std::vector<std::vector<Vec3f> *> isolatedBoundarySegments;
00162 std::vector<std::vector<Vec3f> *> sharedBoundarySegments;
00163
00165 static Vec3f lineColor;
00166 static Vec3f labelColor;
00167 static Vec3f boundaryColor;
00168
00169 static bool singleSelected;
00170 };
00171
00172 #endif // _CONSTELLATION_HPP_