ZoneData.hpp   ZoneData.hpp 
skipping to change at line 25 skipping to change at line 25
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA.
*/ */
#ifndef _ZONEDATA_HPP_ #ifndef _ZONEDATA_HPP_
#define _ZONEDATA_HPP_ #define _ZONEDATA_HPP_
#include <boost/intrusive_ptr.hpp> #include <boost/intrusive_ptr.hpp>
// just for Vect3d. // just for Vect3d.
// Take any Vector class instead, if you want to use the star feature in // Take any Vector class instead, if you want to use the star feature in a
a // different context.
// different context. #include "VecMath.hpp"
#include "vecmath.h"
class StelObject; class StelObject;
namespace BigStarCatalogExtension { namespace BigStarCatalogExtension
{
// The stars are arranged in triangular zones according to GeodesicGrid. //! @struct ZoneData
// Bright stars (Star1) are stored in zones with small level, whereas //! A single triangle. The stars are arranged in triangular zones according
// fainter stars (Star2,Star3) are stored in zones with highter level. to
// A ZoneData contains stars of a given type (Star1,Star2 or Star3) of //! StelGeodesicGrid. Bright stars (Star1) are stored in zones with small l
// a given triangle and level of the GeodesicGrid. evel,
//! whereas fainter stars (Star2,Star3) are stored in zones with highter le
struct ZoneData { // a single Triangle vel.
// no virtual functions! //! A ZoneData contains stars of a given type (Star1,Star2 or Star3) of
int getNrOfStars(void) const {return size;} //! a given triangle and level of the StelGeodesicGrid.
Vec3d center; struct ZoneData
Vec3d axis0; {
Vec3d axis1; //! Get number of stars in this triangle.
int size; int getNrOfStars(void) const
void *stars; {
return size;
}
Vec3d center;
Vec3d axis0;
Vec3d axis1;
int size;
void *stars;
}; };
//! @struct SpecialZoneData
//! Wrapper struct around ZoneData.
//! @tparam Star either Star1, Star2 or Star3, depending on the brightness
of
//! stars in this triangle
template <class Star> template <class Star>
struct SpecialZoneData : public ZoneData { struct SpecialZoneData : public ZoneData
boost::intrusive_ptr<StelObject> createStelObject(const Star *s) const {
{return s->createStelObject(*this);} boost::intrusive_ptr<StelObject> createStelObject(const Star *s) con
Star *getStars(void) const {return reinterpret_cast<Star*>(stars);} st
// array of stars in this zone {
return s->createStelObject(*this);
}
//! Get array of stars in this zone.
Star *getStars(void) const
{
return reinterpret_cast<Star*>(stars);
}
}; };
} // namespace BigStarCatalogExtension } // namespace BigStarCatalogExtension
#endif // _ZONEDATA_HPP_ #endif // _ZONEDATA_HPP_
 End of changes. 5 change blocks. 
25 lines changed or deleted 45 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/