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