Stellarium 0.15.2
CustomObject.hpp
1 /*
2  * Copyright (C) 2016 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., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
17  */
18 
19 #ifndef _CUSTOMOBJECT_HPP_
20 #define _CUSTOMOBJECT_HPP_ 1
21 
22 #include <QVariant>
23 #include <QString>
24 #include <QStringList>
25 #include <QFont>
26 #include <QList>
27 
28 #include "StelObject.hpp"
29 #include "StelTextureTypes.hpp"
30 #include "StelFader.hpp"
31 
32 class StelPainter;
33 
34 class CustomObject : public StelObject
35 {
36  friend class CustomObjectMgr;
37 public:
38  CustomObject(const QString& codesignation, const Vec3d& coordinates, const bool isVisible);
39  ~CustomObject();
40 
42  virtual QString getType(void) const
43  {
44  return "CustomObject";
45  }
46 
47  virtual float getSelectPriority(const StelCore* core) const;
48 
52  virtual QString getInfoString(const StelCore* core, const InfoStringGroup& flags) const;
53  virtual Vec3f getInfoColor(void) const;
54  virtual Vec3d getJ2000EquatorialPos(const StelCore*) const
55  {
56  return XYZ;
57  }
59  virtual float getVMagnitude(const StelCore* core) const;
61  virtual double getAngularSize(const StelCore* core) const;
63  virtual QString getNameI18n(void) const;
65  virtual QString getEnglishName(void) const
66  {
67  return designation;
68  }
69 
70  void update(double deltaTime);
71 
72 private:
73  bool initialized;
74 
75  Vec3d XYZ; // holds J2000 position
76 
77  StelTextureSP markerTexture;
78  static Vec3f markerColor;
79  static float markerSize;
80 
81  void draw(StelCore* core, StelPainter *painter);
82 
83  QString designation;
84  bool isMarker;
85 
86  LinearFader labelsFader;
87 };
88 
89 #endif // _CUSTOMOBJECT_HPP_
virtual Vec3f getInfoColor(void) const
Get a color used to display info about the object.
virtual double getAngularSize(const StelCore *core) const
Get the angular size of pulsar.
Implementation of StelFader which implements a linear transition.
Definition: StelFader.hpp:77
The base abstract class for sky objects used in Stellarium like Stars, Planets, Constellations etc...
Definition: StelObject.hpp:36
virtual Vec3d getJ2000EquatorialPos(const StelCore *) const
Get observer-centered equatorial coordinates at equinox J2000.
Define the StelTextureSP type.
virtual float getSelectPriority(const StelCore *core) const
Return a priority value which is used to discriminate objects by priority As for magnitudes, the lower is the higher priority.
Main class for Stellarium core processing.
Definition: StelCore.hpp:48
virtual QString getInfoString(const StelCore *core, const InfoStringGroup &flags) const
Get an HTML string to describe the object.
virtual float getVMagnitude(const StelCore *core) const
Get the visual magnitude of pulsar.
virtual QString getType(void) const
Get the type of object.
Provides functions for performing openGL drawing operations.
Definition: StelPainter.hpp:40
QSharedPointer< StelTexture > StelTextureSP
Use shared pointer to simplify memory managment.
virtual QString getEnglishName(void) const
Get the english name of pulsar.
virtual void update(double)
Update the module with respect to the time.
virtual void draw(StelCore *core)
Execute all the drawing functions for this module.
virtual QString getNameI18n(void) const
Get the localized name of pulsar.