25 #include "ZoneData.hpp" 32 typedef short int Int16;
33 typedef unsigned short int Uint16;
45 static inline float IndexToBV(
unsigned char bV)
47 return (
float)bV*(4.f/127.f)-0.5f;
107 enum {MaxPosVal=0x7FFFFFFF};
109 void getJ2000Pos(
const ZoneData *z,
float movementFactor,
Vec3f& pos)
const 112 pos*=((float)(getX0())+movementFactor*getDx0());
113 pos+=((float)(getX1())+movementFactor*getDx1())*z->axis1;
116 inline int getBVIndex()
const {
return d.uint8[12];}
117 inline int getMag()
const {
return d.uint8[13];}
118 inline int getSpInt()
const {
return d.uint16[7];}
119 inline int getX0()
const {
return qFromLittleEndian(d.int32[1]);}
120 inline int getX1()
const {
return qFromLittleEndian(d.int32[2]);}
121 inline int getDx0()
const {
return qFromLittleEndian(d.int32[4]);}
122 inline int getDx1()
const {
return qFromLittleEndian(d.int32[5]);}
123 inline int getPlx()
const {
return qFromLittleEndian(d.int32[6]);}
125 inline int getHip()
const 127 quint32 v = d.uint8[0] | d.uint8[1] << 8 | d.uint8[2] << 16;
128 return ((qint32)v) << 8 >> 8;
131 inline int getComponentIds()
const 136 float getBV(
void)
const {
return IndexToBV(getBVIndex());}
137 bool hasName()
const {
return getHip();}
138 QString getNameI18n(
void)
const;
139 int hasComponentID(
void)
const;
171 inline int getX0()
const 173 quint32 v = d[0] | d[1] << 8 | (d[2] & 0xF) << 16;
174 return ((qint32)v) << 12 >> 12;
177 inline int getX1()
const 179 quint32 v = d[2] >> 4 | d[3] << 4 | d[4] << 12;
180 return ((qint32)v) << 12 >> 12;
183 inline int getDx0()
const 185 Uint16 v = d[5] | (d[6] & 0x3F) << 8;
186 return ((Int16)(v << 2)) >> 2;
189 inline int getDx1()
const 191 Uint16 v = d[6] >> 6 | d[7] << 2 | (d[8] & 0xF) << 10;
192 return ((Int16)(v << 2)) >> 2;
195 inline int getBVIndex()
const 197 return d[8] >> 4 | (d[9] & 0x7) << 4;
200 inline int getMag()
const 205 enum {MaxPosVal=((1<<19)-1)};
207 void getJ2000Pos(
const ZoneData *z,
float movementFactor,
Vec3f& pos)
const 210 pos*=((float)(getX0())+movementFactor*getDx0());
211 pos+=((float)(getX1())+movementFactor*getDx1())*z->axis1;
214 float getBV(
void)
const {
return IndexToBV(getBVIndex());}
215 QString getNameI18n(
void)
const {
return QString();}
216 int hasComponentID(
void)
const {
return 0;}
217 bool hasName()
const {
return false;}
241 inline int getX0()
const 243 quint32 v = d[0] | d[1] << 8 | (d[2] & 0x3) << 16;
244 return ((qint32)v) << 14 >> 14;
247 inline int getX1()
const 249 quint32 v = d[2] >> 2 | d[3] << 6 | (d[4] & 0xF) << 14;
250 return ((qint32)v) << 14 >> 14;
253 inline int getBVIndex()
const 255 return d[4] >> 4 | (d[5] & 0x7) << 4;
258 inline int getMag()
const 263 enum {MaxPosVal=((1<<17)-1)};
268 pos*=(float)(getX0());
270 pos+=(float)(getX1())*z->axis1;
272 float getBV()
const {
return IndexToBV(getBVIndex());}
273 QString getNameI18n()
const {
return QString();}
274 int hasComponentID()
const {
return 0;}
275 bool hasName()
const {
return false;}
Wrapper struct around ZoneData.
The base abstract class for sky objects used in Stellarium like Stars, Planets, Constellations etc...
Define the StelObjectP type.
Implements all the virtual methods in ZoneArray.