ZoneArray.hpp   ZoneArray.hpp 
skipping to change at line 33 skipping to change at line 33
#ifndef _ZONEARRAY_HPP_ #ifndef _ZONEARRAY_HPP_
#define _ZONEARRAY_HPP_ #define _ZONEARRAY_HPP_
#include <QString> #include <QString>
#include <QFile> #include <QFile>
#include <QDebug> #include <QDebug>
#include "ZoneData.hpp" #include "ZoneData.hpp"
#include "Star.hpp" #include "Star.hpp"
#include "StelLoadingBar.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelSkyDrawer.hpp" #include "StelSkyDrawer.hpp"
#include "StarMgr.hpp" #include "StarMgr.hpp"
#include "StelPainter.hpp" #include "StelPainter.hpp"
// Patch by Rainer Canavan for compilation on irix with mipspro compiler pa rt 1 // Patch by Rainer Canavan for compilation on irix with mipspro compiler pa rt 1
#ifndef MAP_NORESERVE #ifndef MAP_NORESERVE
# ifdef MAP_AUTORESRV # ifdef MAP_AUTORESRV
# if (defined(__sgi) && defined(_COMPILER_VERSION)) # if (defined(__sgi) && defined(_COMPILER_VERSION))
skipping to change at line 83 skipping to change at line 82
//! returns an instance of one of its subclasses. All it really does is //! returns an instance of one of its subclasses. All it really does is
//! bootstrap the loading process. //! bootstrap the loading process.
class ZoneArray class ZoneArray
{ {
public: public:
//! Named public constructor for ZoneArray. Opens a catalog, reads i ts //! Named public constructor for ZoneArray. Opens a catalog, reads i ts
//! header info, and creates a SpecialZoneArray or HipZoneArray for //! header info, and creates a SpecialZoneArray or HipZoneArray for
//! loading. //! loading.
//! @param extended_file_name path of the star catalog to load from //! @param extended_file_name path of the star catalog to load from
//! @param use_mmap whether or not to mmap the star catalog //! @param use_mmap whether or not to mmap the star catalog
//! @param lb the loading bar on the splash screen
//! @return an instance of SpecialZoneArray or HipZoneArray //! @return an instance of SpecialZoneArray or HipZoneArray
static ZoneArray *create(const QString &extended_file_name, static ZoneArray *create(const QString &extended_file_name, bool use
bool use_mmap, _mmap);
StelLoadingBar* lb) virtual ~ZoneArray()
;
virtual ~ZoneArray(void)
{ {
nr_of_zones = 0; nr_of_zones = 0;
} }
//! Get the total number of stars in this catalog. //! Get the total number of stars in this catalog.
unsigned int getNrOfStars(void) const { return nr_of_stars; } unsigned int getNrOfStars() const { return nr_of_stars; }
//! Dummy method that does nothing. See subclass implementation. //! Dummy method that does nothing. See subclass implementation.
virtual void updateHipIndex(HipIndexStruct hipIndex[]) const {} virtual void updateHipIndex(HipIndexStruct hipIndex[]) const {Q_UNUS ED(hipIndex);}
//! Pure virtual method. See subclass implementation. //! Pure virtual method. See subclass implementation.
virtual void searchAround(const StelNavigator* nav, int index,const Vec3d &v,double cosLimFov, virtual void searchAround(const StelNavigator* nav, int index,const Vec3d &v,double cosLimFov,
QList<StelObjectP > &result) = 0; QList<StelObjectP > &result) = 0;
//! Pure virtual method. See subclass implementation. //! Pure virtual method. See subclass implementation.
virtual void draw(StelPainter* sPainter, int index,bool is_inside, virtual void draw(StelPainter* sPainter, int index,bool is_inside,
const float *rcmag_table, StelCore * core, const float *rcmag_table, StelCore * core,
unsigned int maxMagStarName,float names_brightness) const = 0; unsigned int maxMagStarName,float names_brightness) const = 0;
//! Get whether or not the catalog was successfully loaded. //! Get whether or not the catalog was successfully loaded.
//! @return @c true if at least one zone was loaded, otherwise @c fa lse //! @return @c true if at least one zone was loaded, otherwise @c fa lse
bool isInitialized(void) const { return (nr_of_zones>0); } bool isInitialized(void) const { return (nr_of_zones>0); }
//! Initialize the ZoneData struct at the given index. //! Initialize the ZoneData struct at the given index.
void initTriangle(int index, void initTriangle(int index,
const Vec3d &c0, const Vec3f &c0,
const Vec3d &c1, const Vec3f &c1,
const Vec3d &c2); const Vec3f &c2);
virtual void scaleAxis(void) = 0; virtual void scaleAxis(void) = 0;
//! File path of the catalog. //! File path of the catalog.
const QString fname; const QString fname;
//! Level in StelGeodesicGrid. //! Level in StelGeodesicGrid.
const int level; const int level;
//! Lower bound of magnitudes in this catalog. //! Lower bound of magnitudes in this catalog.
const int mag_min; const int mag_min;
//! Range of magnitudes in this catalog. //! Range of magnitudes in this catalog.
const int mag_range; const int mag_range;
//! Number of steps used to describe values in @em mag_range. //! Number of steps used to describe values in @em mag_range.
const int mag_steps; const int mag_steps;
double star_position_scale; float star_position_scale;
protected: protected:
//! Load a catalog and display its progress on the splash screen. //! Load a catalog and display its progress on the splash screen.
//! @return @c true if successful, or @c false if an error occurred //! @return @c true if successful, or @c false if an error occurred
static bool readFileWithStelLoadingBar(QFile& file, void *data, static bool readFile(QFile& file, void *data, qint64 size);
qint64 size,StelLoadingBa
r* lb);
//! Protected constructor. Initializes fields and does not load anyt hing. //! Protected constructor. Initializes fields and does not load anyt hing.
ZoneArray(const QString& fname, QFile* file, int level, int mag_min, ZoneArray(const QString& fname, QFile* file, int level, int mag_min,
int mag_range, int mag_steps); int mag_range, int mag_steps);
unsigned int nr_of_zones; unsigned int nr_of_zones;
unsigned int nr_of_stars; unsigned int nr_of_stars;
ZoneData *zones; ZoneData *zones;
QFile* file; QFile* file;
}; };
//! @class SpecialZoneArray //! @class SpecialZoneArray
//! Implements all the virtual methods in ZoneArray. Is only separate from //! Implements all the virtual methods in ZoneArray. Is only separate from
//! %ZoneArray because %ZoneArray decides on the template parameter. //! %ZoneArray because %ZoneArray decides on the template parameter.
//! @tparam Star either Star1, Star2 or Star3, depending on the brightness of //! @tparam Star either Star1, Star2 or Star3, depending on the brightness of
//! stars in this catalog. //! stars in this catalog.
template<class Star> template<class Star>
class SpecialZoneArray : public ZoneArray class SpecialZoneArray : public ZoneArray
{ {
public: public:
//! Handles loading of the meaty part of star catalogs. //! Handles loading of the meaty part of star catalogs.
//! @param file catalog to load from //! @param file catalog to load from
//! @param byte_swap whether to switch endianness of catalog data //! @param byte_swap whether to switch endianness of catalog data
//! @param use_mmap whether or not to mmap the star catalog //! @param use_mmap whether or not to mmap the star catalog
//! @param lb the loading bar on the splash screen
//! @param level level in StelGeodesicGrid //! @param level level in StelGeodesicGrid
//! @param mag_min lower bound of magnitudes //! @param mag_min lower bound of magnitudes
//! @param mag_range range of magnitudes //! @param mag_range range of magnitudes
//! @param mag_steps number of steps used to describe values in rang e //! @param mag_steps number of steps used to describe values in rang e
SpecialZoneArray(QFile* file,bool byte_swap,bool use_mmap, SpecialZoneArray(QFile* file,bool byte_swap,bool use_mmap,int level,
StelLoadingBar*lb,int level,int mag int mag_min,
_min,
int mag_range,int mag_steps); int mag_range,int mag_steps);
~SpecialZoneArray(void); ~SpecialZoneArray(void);
protected: protected:
//! Get an array of all SpecialZoneData objects in this catalog. //! Get an array of all SpecialZoneData objects in this catalog.
SpecialZoneData<Star> *getZones(void) const SpecialZoneData<Star> *getZones(void) const
{ {
return static_cast<SpecialZoneData<Star>*>(zones); return static_cast<SpecialZoneData<Star>*>(zones);
} }
//! Draw stars and their names onto the viewport. //! Draw stars and their names onto the viewport.
//! @param sPainter the painter to use
//! @param index zone index to draw //! @param index zone index to draw
//! @param is_inside whether the zone is inside the current viewport //! @param is_inside whether the zone is inside the current viewport
//! @param rcmag_table table of magnitudes //! @param rcmag_table table of magnitudes
//! @param core core to use for drawing //! @param core core to use for drawing
//! @param maxMagStarName magnitude limit of stars that display labe ls //! @param maxMagStarName magnitude limit of stars that display labe ls
//! @param names_brightness brightness of labels //! @param names_brightness brightness of labels
//! @param starFont font of labels
void draw(StelPainter* sPainter, int index,bool is_inside, void draw(StelPainter* sPainter, int index,bool is_inside,
const float *rcmag_table, StelCore* core, const float *rcmag_table, StelCore* core,
unsigned int maxMagStarName,float names_brightness ) const; unsigned int maxMagStarName,float names_brightness ) const;
void scaleAxis(void); void scaleAxis(void);
void searchAround(const StelNavigator* nav, int index,const Vec3d &v ,double cosLimFov, void searchAround(const StelNavigator* nav, int index,const Vec3d &v ,double cosLimFov,
QList<StelObjectP > &result); QList<StelObjectP > &result);
Star *stars; Star *stars;
private: private:
uchar *mmap_start; uchar *mmap_start;
}; };
//! @class HipZoneArray //! @class HipZoneArray
//! ZoneArray of Hipparcos stars. It's just a SpecialZoneArray<Star1> that //! ZoneArray of Hipparcos stars. It's just a SpecialZoneArray<Star1> that
//! implements updateHipIndex(HipIndexStruct). //! implements updateHipIndex(HipIndexStruct).
class HipZoneArray : public SpecialZoneArray<Star1> class HipZoneArray : public SpecialZoneArray<Star1>
{ {
public: public:
HipZoneArray(QFile* file,bool byte_swap,bool use_mmap,StelLoadingBar * lb, HipZoneArray(QFile* file,bool byte_swap,bool use_mmap,
int level,int mag_min,int mag_range,int mag_steps) int level,int mag_min,int mag_range,int mag_steps)
: SpecialZoneArray<Star1>(file,byte_swap,use_mmap,lb ,level, : SpecialZoneArray<Star1>(file,byte_swap,use_mmap,le vel,
ma g_min,mag_range,mag_steps) {} ma g_min,mag_range,mag_steps) {}
//! Add Hipparcos information for all stars in this catalog into @em hipIndex. //! Add Hipparcos information for all stars in this catalog into @em hipIndex.
//! @param hipIndex array of Hipparcos info structs //! @param hipIndex array of Hipparcos info structs
void updateHipIndex(HipIndexStruct hipIndex[]) const; void updateHipIndex(HipIndexStruct hipIndex[]) const;
}; };
} // namespace BigStarCatalogExtension } // namespace BigStarCatalogExtension
#endif // _ZONEARRAY_HPP_ #endif // _ZONEARRAY_HPP_
 End of changes. 15 change blocks. 
25 lines changed or deleted 18 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/