Stellarium 0.15.2
ZoneData.hpp
1 /*
2  * The big star catalogue extension to Stellarium:
3  * Author and Copyright: Johannes Gajdosik, 2006, 2007
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
18  */
19 
20 #ifndef _ZONEDATA_HPP_
21 #define _ZONEDATA_HPP_
22 
23 // just for Vect3d.
24 // Take any Vector class instead, if you want to use the star feature in a
25 // different context.
26 #include "VecMath.hpp"
27 #include "StelObjectType.hpp"
28 
29 class StelObject;
30 
37 struct ZoneData
38 {
40  int getNrOfStars() const
41  {
42  return size;
43  }
44  Vec3f center; // Normalized center of the triangle
45  Vec3f axis0; // Normalized direction vector of axis 0 (use for storing stars position in 2D relative to this axis)
46  Vec3f axis1; // Normalized direction vector of axis 0 (use for storing stars position in 2D relative to this axis)
47  int size; // Number of stars in the stars array
48  void *stars;
49 };
50 
55 template <class Star>
56 struct SpecialZoneData : public ZoneData
57 {
58  StelObjectP createStelObject(const Star *s) const
59  {
60  return s->createStelObject(*this);
61  }
62 
64  Star *getStars(void) const
65  {
66  return reinterpret_cast<Star*>(stars);
67  }
68 };
69 
70 #endif // _ZONEDATA_HPP_
int getNrOfStars() const
Get number of stars in this triangle.
Definition: ZoneData.hpp:40
Wrapper struct around ZoneData.
Definition: Star.hpp:36
The base abstract class for sky objects used in Stellarium like Stars, Planets, Constellations etc...
Definition: StelObject.hpp:36
Star * getStars(void) const
Get array of stars in this zone.
Definition: ZoneData.hpp:64
A single triangle.
Definition: ZoneData.hpp:37
Define the StelObjectP type.