ZoneArray.hpp   ZoneArray.hpp 
skipping to change at line 26 skipping to change at line 26
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* 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., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#ifndef _ZONEARRAY_HPP_ #ifndef _ZONEARRAY_HPP_
#define _ZONEARRAY_HPP_ #define _ZONEARRAY_HPP_
#include <QString>
#include <QFile>
#include <QDebug>
#include "ZoneData.hpp" #include "ZoneData.hpp"
#include "Star.hpp" #include "Star.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StarMgr.hpp"
#include "StelProjector.hpp"
#include "StelSkyDrawer.hpp" #include "StelSkyDrawer.hpp"
#include "StarMgr.hpp"
#include <QString>
#include <QFile>
#include <QDebug>
#ifdef __OpenBSD__ #ifdef __OpenBSD__
#include <unistd.h> #include <unistd.h>
#endif #endif
class StelPainter;
// 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
# define MAP_NORESERVE 0 # define MAP_NORESERVE 0
# endif # endif
#endif #endif
namespace BigStarCatalogExtension
{
#define NR_OF_HIP 120416 #define NR_OF_HIP 120416
#define FILE_MAGIC 0x835f040a #define FILE_MAGIC 0x835f040a
#define FILE_MAGIC_OTHER_ENDIAN 0x0a045f83 #define FILE_MAGIC_OTHER_ENDIAN 0x0a045f83
#define FILE_MAGIC_NATIVE 0x835f040b #define FILE_MAGIC_NATIVE 0x835f040b
#define MAX_MAJOR_FILE_VERSION 0 #define MAX_MAJOR_FILE_VERSION 0
//! @struct HipIndexStruct //! @struct HipIndexStruct
//! Container for Hipparcos information. Stores a pointer to a Hipparcos st ar, //! Container for Hipparcos information. Stores a pointer to a Hipparcos st ar,
//! its catalog and its triangle. //! its catalog and its triangle.
struct HipIndexStruct struct HipIndexStruct
skipping to change at line 100 skipping to change at line 98
} }
//! Get the total number of stars in this catalog. //! Get the total number of stars in this catalog.
unsigned int getNrOfStars() 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 {Q_UNUS ED(hipIndex);} 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 StelCore* core, int index,const Vec3 d &v,double cosLimFov, virtual void searchAround(const StelCore* core, int index,const Vec3 d &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(StelProjectorP projector, class StelRenderer* rend virtual void draw(StelPainter* sPainter, int index,bool is_inside,
erer, int index, const RCMag* rcmag_table, int limi
bool is_inside, const float *rcmag_table, StelCore tMagIndex, StelCore* core,
* core, int maxMagStarName, float names_br
unsigned int maxMagStarName,float names_brightness ightness,
) const = 0; const QVector<SphericalCap>& bound
ingCaps) 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 Vec3f &c0, const Vec3f &c1, const
const Vec3f &c0, Vec3f &c2);
const Vec3f &c1,
const Vec3f &c2); virtual void scaleAxis() = 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. Units: millimag. May be negative for brightest stars. //! Lower bound of magnitudes in this level. Units: millimag. May be negative for brightest stars.
const int mag_min; const int mag_min;
//! Range of magnitudes in this catalog. Units: millimags //! Range of magnitudes in this level. Units: millimags
const int mag_range; const int mag_range;
//! Number of steps used to describe values in @em mag_range. Always positive. Individual stars have their mag entries from 0..mag_steps. //! Number of steps used to describe values in @em mag_range. Always positive. Individual stars have their mag entries from 0..mag_steps.
const int mag_steps; const int mag_steps;
float 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
skipping to change at line 176 skipping to change at line 173
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 projector Projector to project 3D coords to the vi //! @param sPainter the painter to use
ewport. //! @param index zone index to draw
//! @param renderer Renderer to use for drawing. //! @param isInsideViewport whether the zone is inside the current v
//! @param index zone index to draw iewport
//! @param is_inside whether the zone is inside the current v //! @param rcmag_table table of magnitudes
iewport //! @param limitMagIndex index from rcmag_table at which stars are n
//! @param rcmag_table table of magnitudes ot visible anymore
//! @param core core to use for drawing //! @param core core to use for drawing
//! @param maxMagStarName magnitude limit of stars that display la //! @param maxMagStarName magnitude limit of stars that display labe
bels ls
//! @param names_brightness brightness of labels //! @param names_brightness brightness of labels
void draw(StelProjectorP projector, class StelRenderer* renderer, in virtual void draw(StelPainter* sPainter, int index, bool isInsideVie
t index, wport,
bool is_inside, const float *rcmag_table, StelCore* core, const RCMag *rcmag_table, int limitMagIndex, StelC
unsigned int maxMagStarName,float names_brightness) const; ore* core,
int maxMagStarName, float names_brightness,
const QVector<SphericalCap>& boundingCaps) const;
void scaleAxis(void); virtual void scaleAxis();
void searchAround(const StelCore* core, int index,const Vec3d &v,dou virtual void searchAround(const StelCore* core, int index,const Vec3
ble cosLimFov, d &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).
skipping to change at line 213 skipping to change at line 211
HipZoneArray(QFile* file,bool byte_swap,bool use_mmap, 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,le vel, : 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
#endif // _ZONEARRAY_HPP_ #endif // _ZONEARRAY_HPP_
 End of changes. 14 change blocks. 
42 lines changed or deleted 40 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/