Stellarium 0.12.4
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 
31 namespace BigStarCatalogExtension
32 {
33 
40 struct ZoneData
41 {
43  int getNrOfStars(void) const
44  {
45  return size;
46  }
47  Vec3f center;
48  Vec3f axis0;
49  Vec3f axis1;
50  int size;
51  void *stars;
52 };
53 
58 template <class Star>
59 struct SpecialZoneData : public ZoneData
60 {
61  StelObjectP createStelObject(const Star *s) const
62  {
63  return s->createStelObject(*this);
64  }
65 
67  Star *getStars(void) const
68  {
69  return reinterpret_cast<Star*>(stars);
70  }
71 };
72 
73 } // namespace BigStarCatalogExtension
74 
75 #endif // _ZONEDATA_HPP_