Home · All Namespaces · All Classes · Functions · Coding Style · Plugins · File Structure

modules/ZoneData.hpp

00001 /*
00002  * The big star catalogue extension to Stellarium:
00003  * Author and Copyright: Johannes Gajdosik, 2006, 2007
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018  */
00019 
00020 #ifndef _ZONEDATA_HPP_
00021 #define _ZONEDATA_HPP_
00022 
00023 #include <boost/intrusive_ptr.hpp>
00024 
00025 // just for Vect3d.
00026 // Take any Vector class instead, if you want to use the star feature in a
00027 // different context.
00028 #include "VecMath.hpp"
00029 
00030 class StelObject;
00031 
00032 namespace BigStarCatalogExtension
00033 {
00034 
00041 struct ZoneData
00042 {
00044     int getNrOfStars(void) const
00045     {
00046         return size;
00047     }
00048     Vec3d center;
00049     Vec3d axis0;
00050     Vec3d axis1;
00051     int size;
00052     void *stars;
00053 };
00054 
00059 template <class Star>
00060 struct SpecialZoneData : public ZoneData
00061 {
00062     boost::intrusive_ptr<StelObject> createStelObject(const Star *s) const
00063     {
00064         return s->createStelObject(*this);
00065     }
00066     
00068     Star *getStars(void) const
00069     {
00070         return reinterpret_cast<Star*>(stars);
00071     }
00072 };
00073 
00074 } // namespace BigStarCatalogExtension
00075 
00076 #endif // _ZONEDATA_HPP_

Generated on Mon Mar 9 16:16:16 2009 for Stellarium by  doxygen 1.5.5