Stellarium 0.11.3
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure

core/modules/Constellation.hpp

00001 /*
00002  * Stellarium
00003  * Copyright (C) 2002 Fabien Chereau
00004  * Copyright (C) 2012 Timothy Reaves
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335, USA.
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     // StelObject method to override
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;} // TODO
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_
Generated on Thu May 31 10:37:17 2012 for Stellarium by  doxygen 1.6.3