Star.hpp   Star.hpp 
skipping to change at line 32 skipping to change at line 32
#ifndef _STAR_HPP_ #ifndef _STAR_HPP_
#define _STAR_HPP_ #define _STAR_HPP_
#include "ZoneData.hpp" #include "ZoneData.hpp"
#include "StelObjectType.hpp" #include "StelObjectType.hpp"
#include <QString> #include <QString>
#include <QtEndian> #include <QtEndian>
class StelObject; class StelObject;
typedef unsigned char Uint8;
typedef int Int32;
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.
skipping to change at line 89 skipping to change at line 86
24 plx | | 24 plx | |
25 | | 25 | |
26 | | 26 | |
27 |_______________| 27 |_______________|
*/ */
// componentIds 8 // componentIds 8
// hip 24 // hip 24
// //
// Int32 x0 32 // qint32 x0 32
// Int32 x1 32 // qint32 x1 32
// //
// unsigned char bV 8 // unsigned char bV 8
// unsigned char mag 8 // unsigned char mag 8
// Uint16 spInt 16 // Uint16 spInt 16
// //
// Int32 dx0,dx1,plx 32 // qint32 dx0,dx1,plx 32
private: private:
Uint8 d[28]; quint8 d[28];
public: public:
enum {MaxPosVal=0x7FFFFFFF}; enum {MaxPosVal=0x7FFFFFFF};
StelObjectP createStelObject(const SpecialZoneArray<Star1> *a, const SpecialZoneData<Star1> *z) const; StelObjectP createStelObject(const SpecialZoneArray<Star1> *a, const SpecialZoneData<Star1> *z) const;
void getJ2000Pos(const ZoneData *z,float movementFactor, Vec3f& pos) const void getJ2000Pos(const ZoneData *z,float movementFactor, Vec3f& pos) const
{ {
pos = z->axis0; pos = z->axis0;
pos*=((float)(getX0())+movementFactor*getDx0()); pos*=((float)(getX0())+movementFactor*getDx0());
pos+=((float)(getX1())+movementFactor*getDx1())*z->axis1; pos+=((float)(getX1())+movementFactor*getDx1())*z->axis1;
pos+=z->center; pos+=z->center;
} }
inline int getBVIndex() const {return d[12];} inline int getBVIndex() const {return d[12];}
inline int getMag() const {return d[13];} inline int getMag() const {return d[13];}
inline int getSpInt() const {return ((Uint16*)d)[7];} inline int getSpInt() const {return ((Uint16*)d)[7];}
inline int getX0() const { return qFromLittleEndian(((Int32*)d)[1]); inline int getX0() const { return qFromLittleEndian(((qint32*)d)[1])
} ; }
inline int getX1() const { return qFromLittleEndian(((Int32*)d)[2]); inline int getX1() const { return qFromLittleEndian(((qint32*)d)[2])
} ; }
inline int getDx0() const {return qFromLittleEndian(((Int32*)d)[4]); inline int getDx0() const {return qFromLittleEndian(((qint32*)d)[4])
} ;}
inline int getDx1() const {return qFromLittleEndian(((Int32*)d)[5]); inline int getDx1() const {return qFromLittleEndian(((qint32*)d)[5])
} ;}
inline int getPlx() const {return qFromLittleEndian(((Int32*)d)[6]); inline int getPlx() const {return qFromLittleEndian(((qint32*)d)[6])
} ;}
inline int getHip() const inline int getHip() const
{ {
Uint32 v = d[0] | d[1] << 8 | d[2] << 16; quint32 v = d[0] | d[1] << 8 | d[2] << 16;
return ((Int32)v) << 8 >> 8; return ((qint32)v) << 8 >> 8;
} }
inline int getComponentIds() const inline int getComponentIds() const
{ {
return (Int32)d[3]; return (qint32)d[3];
} }
float getBV(void) const {return IndexToBV(getBVIndex());} float getBV(void) const {return IndexToBV(getBVIndex());}
bool hasName() const {return getHip();} bool hasName() const {return getHip();}
QString getNameI18n(void) const; QString getNameI18n(void) const;
int hasComponentID(void) const; int hasComponentID(void) const;
void print(void); void print(void);
}; };
struct Star2 { // 10 byte struct Star2 { // 10 byte
skipping to change at line 161 skipping to change at line 158
int x0 :20; int x0 :20;
int x1 :20; int x1 :20;
int dx0 :14; int dx0 :14;
int dx1 :14; int dx1 :14;
unsigned int bV :7; unsigned int bV :7;
unsigned int mag:5; unsigned int mag:5;
*/ */
private: private:
Uint8 d[10]; quint8 d[10];
public: public:
inline int getX0() const inline int getX0() const
{ {
Uint32 v = d[0] | d[1] << 8 | (d[2] & 0xF) << 16; quint32 v = d[0] | d[1] << 8 | (d[2] & 0xF) << 16;
return ((Int32)v) << 12 >> 12; return ((qint32)v) << 12 >> 12;
} }
inline int getX1() const inline int getX1() const
{ {
Uint32 v = d[2] >> 4 | d[3] << 4 | d[4] << 12; quint32 v = d[2] >> 4 | d[3] << 4 | d[4] << 12;
return ((Int32)v) << 12 >> 12; return ((qint32)v) << 12 >> 12;
} }
inline int getDx0() const inline int getDx0() const
{ {
Uint16 v = d[5] | (d[6] & 0x3F) << 8; Uint16 v = d[5] | (d[6] & 0x3F) << 8;
return (Int16)v; return ((Int16)(v << 2)) >> 2;
} }
inline int getDx1() const inline int getDx1() const
{ {
Uint16 v = d[6] >> 6 | d[7] << 2 | (d[8] & 0xF) << 10; Uint16 v = d[6] >> 6 | d[7] << 2 | (d[8] & 0xF) << 10;
return (Int16)v; return ((Int16)(v << 2)) >> 2;
} }
inline int getBVIndex() const inline int getBVIndex() const
{ {
return d[8] >> 4 | (d[9] & 0x7) << 4; return d[8] >> 4 | (d[9] & 0x7) << 4;
} }
inline int getMag() const inline int getMag() const
{ {
return d[9] >> 3; return d[9] >> 3;
skipping to change at line 231 skipping to change at line 228
3 |_______ | 3 |_______ |
4 bV |_______|_______| 4 bV |_______|_______|
5 mag |_________|_____| bV 5 mag |_________|_____| bV
int x0 :18 int x0 :18
int x1 :18 int x1 :18
unsigned int bV :7 unsigned int bV :7
unsigned int mag :5 unsigned int mag :5
*/ */
private: private:
Uint8 d[6]; quint8 d[6];
public: public:
inline int getX0() const inline int getX0() const
{ {
Uint32 v = d[0] | d[1] << 8 | (d[2] & 0x3) << 16; quint32 v = d[0] | d[1] << 8 | (d[2] & 0x3) << 16;
return ((Int32)v) << 14 >> 14; return ((qint32)v) << 14 >> 14;
} }
inline int getX1() const inline int getX1() const
{ {
Uint32 v = d[2] >> 2 | d[3] << 6 | (d[4] & 0xF) << 14; quint32 v = d[2] >> 2 | d[3] << 6 | (d[4] & 0xF) << 14;
return ((Int32)v) << 14 >> 14; return ((qint32)v) << 14 >> 14;
} }
inline int getBVIndex() const inline int getBVIndex() const
{ {
return d[4] >> 4 | (d[5] & 0x7) << 4; return d[4] >> 4 | (d[5] & 0x7) << 4;
} }
inline int getMag() const inline int getMag() const
{ {
return d[5] >> 3; return d[5] >> 3;
 End of changes. 15 change blocks. 
32 lines changed or deleted 29 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/