00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _STAR_HPP_
00023 #define _STAR_HPP_ 1
00024
00025 #include "ZoneData.hpp"
00026
00027 #include <boost/intrusive_ptr.hpp>
00028
00029 #include <QString>
00030
00031 class StelObject;
00032
00033 namespace BigStarCatalogExtension {
00034
00035 typedef int Int32;
00036 typedef unsigned int Uint32;
00037 typedef short int Int16;
00038 typedef unsigned short int Uint16;
00039
00040
00041 template <class Star> struct SpecialZoneArray;
00042 template <class Star> struct SpecialZoneData;
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 static inline float IndexToBV(unsigned char bV) {
00053 return (float)bV*(4.f/127.f)-0.5f;
00054 }
00055
00056 #if (defined(__sgi) && defined(_COMPILER_VERSION) && !defined(__GNUC__))
00057 #pragma pack(1)
00058 #endif
00059 struct Star1 {
00060 int hip:24;
00061 unsigned char componentIds;
00062 Int32 x0;
00063 Int32 x1;
00064 unsigned char bV;
00065 unsigned char mag;
00066 Uint16 spInt;
00067 Int32 dx0,dx1,plx;
00068 enum {MaxPosVal=0x7FFFFFFF};
00069 boost::intrusive_ptr<StelObject>
00070 createStelObject(const SpecialZoneArray<Star1> *a,
00071 const SpecialZoneData<Star1> *z) const;
00072 Vec3d getJ2000Pos(const ZoneData *z,double movementFactor) const {
00073 Vec3d pos = z->center
00074 + (x0+movementFactor*dx0)*z->axis0
00075 + (x1+movementFactor*dx1)*z->axis1;
00076
00077 return pos;
00078 }
00079 float getBV(void) const {return IndexToBV(bV);}
00080 QString getNameI18n(void) const;
00081 void repack(bool fromBe);
00082 void print(void);
00083 }
00084 #if defined(__GNUC__)
00085 __attribute__ ((__packed__))
00086 #endif
00087 ;
00088 #if (defined(__sgi) && defined(_COMPILER_VERSION) && !defined(__GNUC__))
00089 #pragma pack(0)
00090 #endif
00091
00092
00093 #if (defined(__sgi) && defined(_COMPILER_VERSION) && !defined(__GNUC__))
00094 #pragma pack(1)
00095 #endif
00096 struct Star2 {
00097 int x0:20;
00098 int x1:20;
00099 int dx0:14;
00100 int dx1:14;
00101 unsigned int bV:7;
00102 unsigned int mag:5;
00103 enum {MaxPosVal=((1<<19)-1)};
00104 boost::intrusive_ptr<StelObject>
00105 createStelObject(const SpecialZoneArray<Star2> *a,
00106 const SpecialZoneData<Star2> *z) const;
00107 Vec3d getJ2000Pos(const ZoneData *z,double movementFactor) const {
00108 Vec3d pos = z->center
00109 + (x0+movementFactor*dx0)*z->axis0
00110 + (x1+movementFactor*dx1)*z->axis1;
00111
00112 return pos;
00113 }
00114 float getBV(void) const {return IndexToBV(bV);}
00115 QString getNameI18n(void) const {return "";}
00116 void repack(bool fromBe);
00117 void print(void);
00118 }
00119 #if defined(__GNUC__)
00120 __attribute__ ((__packed__))
00121 #endif
00122 ;
00123 #if (defined(__sgi) && defined(_COMPILER_VERSION) && !defined(__GNUC__))
00124 #pragma pack(0)
00125 #endif
00126
00127
00128 #if (defined(__sgi) && defined(_COMPILER_VERSION) && !defined(__GNUC__))
00129 #pragma pack(1)
00130 #endif
00131 struct Star3 {
00132 int x0:18;
00133 int x1:18;
00134 unsigned int bV:7;
00135 unsigned int mag:5;
00136 enum {MaxPosVal=((1<<17)-1)};
00137 boost::intrusive_ptr<StelObject>
00138 createStelObject(const SpecialZoneArray<Star3> *a,
00139 const SpecialZoneData<Star3> *z) const;
00140 Vec3d getJ2000Pos(const ZoneData *z,double) const {
00141 Vec3d pos = z->center + (double)(x0)*z->axis0 + (double)(x1)*z->axis1;
00142
00143 return pos;
00144 }
00145 float getBV(void) const {return IndexToBV(bV);}
00146 QString getNameI18n(void) const {return "";}
00147 void repack(bool fromBe);
00148 void print(void);
00149 }
00150 #if defined(__GNUC__)
00151 __attribute__ ((__packed__))
00152 #endif
00153 ;
00154 #if (defined(__sgi) && defined(_COMPILER_VERSION) && !defined(__GNUC__))
00155 #pragma pack(0)
00156 #endif
00157
00158 }
00159
00160 #endif // _STAR_HPP_