~ubuntu-branches/debian/experimental/stellarium/experimental

« back to all changes in this revision

Viewing changes to plugins/Supernovas/src/Supernova.hpp

  • Committer: Package Import Robot
  • Author(s): Tomasz Buchert
  • Date: 2012-05-18 13:26:18 UTC
  • mfrom: (1.2.7)
  • Revision ID: package-import@ubuntu.com-20120518132618-3uso09fo68c218cx
Tags: 0.11.2-1
* Imported Upstream version 0.11.1 and then 0.11.2 (Closes: #658431)
* Change maintainer (Closes: #668916)
* Machine-readable copyright file
* Bump Standards-Version to 3.9.3
* Update debhelper compat to 9
* Fix lintian duplicate-font-file warning
* Fix copyright-refers-to-symlink-license lintian tag
* Add lintian override for embedded-library error

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2011 Alexander Wolf
3
 
 *
4
 
 * This program is free software; you can redistribute it and/or
5
 
 * modify it under the terms of the GNU General Public License
6
 
 * as published by the Free Software Foundation; either version 2
7
 
 * of the License, or (at your option) any later version.
8
 
 *
9
 
 * This program is distributed in the hope that it will be useful,
10
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 
 * GNU General Public License for more details.
13
 
 *
14
 
 * You should have received a copy of the GNU General Public License
15
 
 * along with this program; if not, write to the Free Software
16
 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
17
 
 */
18
 
 
19
 
#ifndef _SUPERNOVA_HPP_
20
 
#define _SUPERNOVA_HPP_ 1
21
 
 
22
 
#include <QVariant>
23
 
#include <QString>
24
 
#include <QStringList>
25
 
#include <QFont>
26
 
#include <QList>
27
 
#include <QDateTime>
28
 
 
29
 
#include "StelObject.hpp"
30
 
#include "StelTextureTypes.hpp"
31
 
#include "StelPainter.hpp"
32
 
 
33
 
class StelPainter;
34
 
 
35
 
//! @class Supernova
36
 
//! A Supernova object represents one supernova on the sky.
37
 
//! Details about the supernovas are passed using a QVariant which contains
38
 
//! a map of data from the json file.
39
 
 
40
 
class Supernova : public StelObject
41
 
{
42
 
        friend class Supernovas;
43
 
public:
44
 
        //! @param id The official designation for a supernova, e.g. "SN 1054A"
45
 
        Supernova(const QVariantMap& map);
46
 
        ~Supernova();
47
 
 
48
 
        //! Get a QVariantMap which describes the supernova.  Could be used to
49
 
        //! create a duplicate.
50
 
        QVariantMap getMap(void);
51
 
 
52
 
        virtual QString getType(void) const
53
 
        {
54
 
                return "Supernova";
55
 
        }
56
 
        virtual float getSelectPriority(const StelCore* core) const;
57
 
 
58
 
        //! Get an HTML string to describe the object
59
 
        //! @param core A pointer to the core
60
 
        //! @flags a set of flags with information types to include.
61
 
        virtual QString getInfoString(const StelCore* core, const InfoStringGroup& flags) const;
62
 
        virtual Vec3f getInfoColor(void) const;
63
 
        virtual Vec3d getJ2000EquatorialPos(const StelCore*) const
64
 
        {
65
 
                return XYZ;
66
 
        }
67
 
        virtual float getVMagnitude(const StelCore* core) const;
68
 
        virtual double getAngularSize(const StelCore* core) const;
69
 
        virtual QString getNameI18n(void) const
70
 
        {
71
 
                return designation;
72
 
        }
73
 
        virtual QString getEnglishName(void) const
74
 
        {
75
 
                return designation;
76
 
        }
77
 
 
78
 
        void update(double deltaTime);
79
 
 
80
 
private:
81
 
        bool initialized;
82
 
 
83
 
        Vec3d XYZ;                         // holds J2000 position
84
 
 
85
 
        static StelTextureSP hintTexture;
86
 
 
87
 
        void draw(StelCore* core, StelPainter& painter);
88
 
 
89
 
        // Supernova
90
 
        QString designation;               //! The ID of the supernova
91
 
        QString sntype;                    //! Type of the supernova
92
 
        float maxMagnitude;                //! Maximal visual magnitude
93
 
        double peakJD;                     //! Julian Day of max. vis. mag.
94
 
        double snra;                       //! R.A. for the supernova
95
 
        double snde;                       //! Dec. for the supernova
96
 
        QString note;                      //! Notes for the supernova
97
 
        double distance;                   //! Distance to supernova (10^3 ly)
98
 
};
99
 
 
100
 
#endif // _SUPERNOVA_HPP_