ZoneArray.hpp   ZoneArray.hpp 
skipping to change at line 34 skipping to change at line 34
#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 "StelLoadingBar.hpp"
#include "StelApp.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelSkyDrawer.hpp" #include "StelSkyDrawer.hpp"
#include "StarMgr.hpp" #include "StarMgr.hpp"
#include "bytes.h"
#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))
# define MAP_NORESERVE MAP_AUTORESRV # define MAP_NORESERVE MAP_AUTORESRV
# endif # endif
# else # else
skipping to change at line 88 skipping to change at line 86
{ {
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 //! @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_mmap, bool use_mmap,
StelLoadingBar &lb); StelLoadingBar* lb)
;
virtual ~ZoneArray(void) 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(void) 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 {}
//! 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(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
unsigned int maxMagStarName,float names_brightness * core,
, unsigned int maxMagStarName,float
StelFont *starFont) const = 0; 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 Vec3d &c0,
const Vec3d &c1, const Vec3d &c1,
const Vec3d &c2); const Vec3d &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;
skipping to change at line 142 skipping to change at line 139
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; double 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 readFileWithStelLoadingBar(QFile& file, void *data,
qint64 size,StelLoadingBar &l b); 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;
}; };
skipping to change at line 172 skipping to change at line 169
//! 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 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,
StelLoadingBar &lb,int level,int mag_min, StelLoadingBar*lb,int level,int mag _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 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 prj projector to draw on //! @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 //! @param starFont font of labels
void draw(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, unsigned int maxMagStarName,float names_brightness
StelFont *starFont) const; ) 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;
#ifdef WIN32
HANDLE mapping_handle;
#endif
}; };
//! @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,StelLoadingBar * lb,
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,lb ,level,
mag_min,mag_range,mag_step s) {} 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. 14 change blocks. 
26 lines changed or deleted 22 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/