Star.hpp   Star.hpp 
skipping to change at line 23 skipping to change at line 23
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* 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 _STAR_HPP_ #ifndef _STAR_HPP_
#define _STAR_HPP_ 1 #define _STAR_HPP_
#include "ZoneData.hpp" #include "ZoneData.hpp"
#include "StelObjectType.hpp" #include "StelObjectType.hpp"
#include <QString> #include <QString>
class StelObject; class StelObject;
namespace BigStarCatalogExtension {
typedef int Int32; typedef int Int32;
typedef unsigned int Uint32; typedef unsigned int Uint32;
typedef short int Int16; typedef short int Int16;
typedef unsigned short int Uint16; typedef unsigned short int Uint16;
template <class Star> class SpecialZoneArray; template <class Star> class SpecialZoneArray;
template <class Star> struct SpecialZoneData; template <class Star> struct SpecialZoneData;
// structs for storing the stars in binary form. The idea is // structs for storing the stars in binary form. The idea is
// to store much data for bright stars (Star1), but only little or even // to store much data for bright stars (Star1), but only little or even
// very little data for faints stars (Star3). Using only 6 bytes for Star3 // very little data for faints stars (Star3). Using only 6 bytes for Star3
// makes it feasable to store hundreds of millions of them in main memory. // makes it feasable to store hundreds of millions of them in main memory.
static inline float IndexToBV(unsigned char bV) { static inline float IndexToBV(unsigned char bV)
return (float)bV*(4.f/127.f)-0.5f; {
return (float)bV*(4.f/127.f)-0.5f;
} }
#if (defined(__sgi) && defined(_COMPILER_VERSION) && !defined(__GNUC__)) #if (defined(__sgi) && defined(_COMPILER_VERSION) && !defined(__GNUC__))
#pragma pack(1) #pragma pack(1)
#elif defined(_MSC_VER)
#pragma pack(push, 1)
#endif #endif
struct Star1 { // 28 byte struct Star1 { // 28 byte
#ifdef _MSC_BUILD #ifdef _MSC_VER
unsigned int hip:24; // 17 bits needed unsigned int hip:24; // 24 bits needed
unsigned int componentIds:8; // 5 bits needed unsigned int componentIds:8; // 8 bits needed
#else #else
int hip:24; // 17 bits needed int hip:24; // 24 bits needed
unsigned char componentIds; // 5 bits needed unsigned char componentIds; // 8 bits needed
#endif #endif
Int32 x0; // 32 bits needed Int32 x0; // 32 bits needed
Int32 x1; // 32 bits needed Int32 x1; // 32 bits needed
unsigned char bV; // 7 bits needed unsigned char bV; // 8 bits needed
unsigned char mag; // 8 bits needed unsigned char mag; // 8 bits needed
Uint16 spInt; // 14 bits needed Uint16 spInt; // 16 bits needed
Int32 dx0,dx1,plx; Int32 dx0,dx1,plx; // 32 bits needed (x3)
enum {MaxPosVal=0x7FFFFFFF}; enum {MaxPosVal=0x7FFFFFFF};
StelObjectP createStelObject(const SpecialZoneArray<Star1> *a, StelObjectP createStelObject(const SpecialZoneArray<Star1> *a, const
const SpecialZoneData<Star1> *z) co SpecialZoneData<Star1> *z) const;
nst; void getJ2000Pos(const ZoneData *z,float movementFactor, Vec3f& pos)
void getJ2000Pos(const ZoneData *z,float movementFactor, Vec3f& pos) cons const
t { {
pos = z->axis0; pos = z->axis0;
pos*=((float)(x0)+movementFactor*dx0); pos*=((float)(x0)+movementFactor*dx0);
pos+=((float)(x1)+movementFactor*dx1)*z->axis1; pos+=((float)(x1)+movementFactor*dx1)*z->axis1;
pos+=z->center; pos+=z->center;
} }
float getBV(void) const {return IndexToBV(bV);} float getBV(void) const {return IndexToBV(bV);}
bool hasName() const {return hip;} bool hasName() const {return hip;}
QString getNameI18n(void) const; QString getNameI18n(void) const;
int hasComponentID(void) const; int hasComponentID(void) const;
void repack(bool fromBe); void repack(bool fromBe);
void print(void); void print(void);
} }
#if defined(__GNUC__) #if defined(__GNUC__)
__attribute__ ((__packed__)) __attribute__ ((__packed__))
#endif #endif
; ;
#if (defined(__sgi) && defined(_COMPILER_VERSION) && !defined(__GNUC__)) #if (defined(__sgi) && defined(_COMPILER_VERSION) && !defined(__GNUC__))
#pragma pack(0) #pragma pack(0)
#elif defined(_MSC_VER)
#pragma pack(pop)
#endif #endif
#if (defined(__sgi) && defined(_COMPILER_VERSION) && !defined(__GNUC__)) #if (defined(__sgi) && defined(_COMPILER_VERSION) && !defined(__GNUC__))
#pragma pack(1) #pragma pack(1)
#elif defined(_MSC_VER)
#pragma pack(push, 1)
#endif #endif
struct Star2 { // 10 byte struct Star2 { // 10 byte
int x0:20; int x0:20; // 20 bits needed
int x1:20; int x1:20; // 20 bits needed
int dx0:14; int dx0:14; // 14 bits needed
int dx1:14; int dx1:14; // 14 bits needed
unsigned int bV:7; unsigned int bV:7; // 7 bits needed
unsigned int mag:5; unsigned int mag:5; // 5 bits needed
enum {MaxPosVal=((1<<19)-1)}; enum {MaxPosVal=((1<<19)-1)};
StelObjectP createStelObject(const SpecialZoneArray<Star2> *a, StelObjectP createStelObject(const SpecialZoneArray<Star2> *a, const
const SpecialZoneData<Star2> *z) co SpecialZoneData<Star2> *z) const;
nst; void getJ2000Pos(const ZoneData *z,float movementFactor, Vec3f& pos)
void getJ2000Pos(const ZoneData *z,float movementFactor, Vec3f& pos) cons const
t { {
pos = z->axis0; pos = z->axis0;
pos*=((float)(x0)+movementFactor*dx0); pos*=((float)(x0)+movementFactor*dx0);
pos+=((float)(x1)+movementFactor*dx1)*z->axis1; pos+=((float)(x1)+movementFactor*dx1)*z->axis1;
pos+=z->center; pos+=z->center;
} }
float getBV(void) const {return IndexToBV(bV);} float getBV(void) const {return IndexToBV(bV);}
QString getNameI18n(void) const {return QString();} QString getNameI18n(void) const {return QString();}
int hasComponentID(void) const {return 0;} int hasComponentID(void) const {return 0;}
bool hasName() const {return false;} bool hasName() const {return false;}
void repack(bool fromBe); void repack(bool fromBe);
void print(void); void print(void);
} }
#if defined(__GNUC__) #if defined(__GNUC__)
__attribute__ ((__packed__)) __attribute__ ((__packed__))
#endif #endif
; ;
#if (defined(__sgi) && defined(_COMPILER_VERSION) && !defined(__GNUC__)) #if (defined(__sgi) && defined(_COMPILER_VERSION) && !defined(__GNUC__))
#pragma pack(0) #pragma pack(0)
#elif defined(_MSC_VER)
#pragma pack(pop)
#endif #endif
#if (defined(__sgi) && defined(_COMPILER_VERSION) && !defined(__GNUC__)) #if (defined(__sgi) && defined(_COMPILER_VERSION) && !defined(__GNUC__))
#pragma pack(1) #pragma pack(1)
#elif defined(_MSC_VER)
#pragma pack(push, 1)
#endif #endif
struct Star3 { // 6 byte struct Star3 { // 6 byte
int x0:18; int x0:18; // 18 bits needed
int x1:18; int x1:18; // 18 bits needed
unsigned int bV:7; unsigned int bV:7; // 7 bits needed
unsigned int mag:5; unsigned int mag:5; // 5 bits needed
enum {MaxPosVal=((1<<17)-1)}; enum {MaxPosVal=((1<<17)-1)};
StelObjectP createStelObject(const SpecialZoneArray<Star3> *a, StelObjectP createStelObject(const SpecialZoneArray<Star3> *a, const
const SpecialZoneData<Star3> *z) co SpecialZoneData<Star3> *z) const;
nst; void getJ2000Pos(const ZoneData *z,float, Vec3f& pos) const
void getJ2000Pos(const ZoneData *z,float, Vec3f& pos) const { {
pos = z->axis0; pos = z->axis0;
pos*=(float)(x0); pos*=(float)(x0);
pos+=z->center; pos+=z->center;
pos+=(float)(x1)*z->axis1; pos+=(float)(x1)*z->axis1;
} }
float getBV(void) const {return IndexToBV(bV);} float getBV() const {return IndexToBV(bV);}
QString getNameI18n(void) const {return QString();} QString getNameI18n() const {return QString();}
int hasComponentID(void) const {return 0;} int hasComponentID() const {return 0;}
bool hasName() const {return false;} bool hasName() const {return false;}
void repack(bool fromBe); void repack(bool fromBe);
void print(void); void print();
} }
#if defined(__GNUC__) #if defined(__GNUC__)
__attribute__ ((__packed__)) __attribute__ ((__packed__))
#endif #endif
; ;
#if (defined(__sgi) && defined(_COMPILER_VERSION) && !defined(__GNUC__)) #if (defined(__sgi) && defined(_COMPILER_VERSION) && !defined(__GNUC__))
#pragma pack(0) #pragma pack(0)
#elif defined(_MSC_VER)
#pragma pack(pop)
#endif #endif
} // namespace BigStarCatalogExtension
#endif // _STAR_HPP_ #endif // _STAR_HPP_
 End of changes. 18 change blocks. 
81 lines changed or deleted 90 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/