source: trunk/MagicSoft/Cosy/catalog/StarCatalog.h@ 9406

Last change on this file since 9406 was 8847, checked in by tbretz, 17 years ago
*** empty log message ***
File size: 2.0 KB
Line 
1#ifndef STARCATALOG_H
2#define STARCATALOG_H
3
4#ifndef ROOT_TROOT
5#include <TROOT.h>
6#endif
7#ifndef ROOT_GuiTypes
8#include <GuiTypes.h>
9#endif
10#ifndef COSY_SlaStars
11#include "SlaStars.h"
12#endif
13
14typedef unsigned char byte;
15
16class MStarList;
17class MAstroCatalog;
18
19class StarCatalog : public SlaStars
20{
21private:
22
23 int fW;
24 int fH;
25
26
27 MAstroCatalog *fAstro;
28
29 double fPixSize; // [rad/pix] size of one pixel
30 double fSinAngle;
31 double fCosAngle;
32
33 float fLimitMag; // [M] limiting magnitude for display
34
35 AltAz fAltAz; // [rad]
36 RaDec fRaDec; // [rad]
37
38 static void DrawCross(byte *img, const int x, const int y);
39 static void DrawCircle(int color, byte *img, int xx, int yy, int size);
40
41 void SetRaDec(const RaDec &radec);
42 void SetAltAz(const AltAz &altaz);
43
44 int fBox;
45
46public:
47 StarCatalog(MObservatory::LocationName_t key);
48 virtual ~StarCatalog();
49
50 void GetImg(byte *img, byte *cimg, MStarList &list) const;
51 void PaintImg(unsigned char *buf, int w, int h);
52
53 const AltAz GetAltAz() const /*[deg]*/ { return fAltAz*TMath::RadToDeg(); }
54 const ZdAz GetZdAz() const /*[deg]*/ { return ZdAz(TMath::Pi()/2-fAltAz.Alt(), fAltAz.Az())*kRad2Deg; }
55 const RaDec GetRaDec() const /*[deg]*/ { return fRaDec*kRad2Deg; }
56
57 void SetPixSize(const double pixsize);
58 void SetLimitMag(const float mag);
59 void SetRotationAngle(const float angle) { fSinAngle = sin(angle/kRad2Deg); fCosAngle = cos(angle/kRad2Deg); }
60 void Reload();
61
62 double GetPixSize() const;
63
64 AltAz CalcAltAzFromPix(Double_t pixx, Double_t pixy) const;
65
66 virtual void SetMjd(double mjd);
67
68 void SetPointing(double mjd, const RaDec &radec)
69 {
70 SetMjd(mjd); SetRaDec(radec);
71 }
72
73 //void CalcStars(MStarList &list);
74 void CalcStars(MStarList &list, int xc, int yc, int xo, int yo) const;
75 static void DrawStars(MStarList &list, byte *img);
76
77 void SetBox(int box) { fBox = box; }
78
79 ClassDef(StarCatalog, 0)
80};
81
82#endif
Note: See TracBrowser for help on using the repository browser.