1 | //
|
---|
2 | // This File contains the definition of the MGCoordinates-class
|
---|
3 | //
|
---|
4 | // Author: Thomas Bretz
|
---|
5 | // Version: V1.0 (1-8-2000)
|
---|
6 |
|
---|
7 | #include "MGCoordinates.h"
|
---|
8 |
|
---|
9 | #include <iostream> // cout
|
---|
10 |
|
---|
11 | #include "MGCoordinate.h"
|
---|
12 | #include "coord.h"
|
---|
13 |
|
---|
14 | ClassImp(MGCoordinates);
|
---|
15 |
|
---|
16 | using namespace std;
|
---|
17 |
|
---|
18 | MGCoordinates::MGCoordinates(const TGWindow* p,
|
---|
19 | const Int_t type,
|
---|
20 | const Int_t flag,
|
---|
21 | const Int_t deg1, const UInt_t min1, const UInt_t sec1,
|
---|
22 | const Int_t deg2, const UInt_t min2, const UInt_t sec2)
|
---|
23 | : TGFrame(p, 244, 76, kFixedSize)
|
---|
24 | {
|
---|
25 | const Int_t t = type==kETypeZdAz ? kETypeDeg : kETypeH;
|
---|
26 | const char *txt1 = type==kETypeZdAz ? "Zenith Dist [\xb0]:" : "Right Ascension [h]:";
|
---|
27 | const char *txt2 = type==kETypeZdAz ? "Azimuth [\xb0]:" : "Declination [\xb0]:";
|
---|
28 |
|
---|
29 | // p = pointer to MainFrame (not owner)
|
---|
30 | fX = new MGCoordinate(this, t, flag, flag>1?"":txt1, deg1, min1, sec1);
|
---|
31 | fX->Move(0, 0);
|
---|
32 |
|
---|
33 | fY = new MGCoordinate(this, kETypeDeg, flag, flag>1?"":txt2, deg2, min2, sec2);
|
---|
34 | fY->Move(125, 0);
|
---|
35 |
|
---|
36 | MapWindow();
|
---|
37 | }
|
---|
38 |
|
---|
39 | MGCoordinates::~MGCoordinates()
|
---|
40 | {
|
---|
41 | delete fY;
|
---|
42 | delete fX;
|
---|
43 |
|
---|
44 | cout << "MGCoordinates destroyed." << endl;
|
---|
45 | }
|
---|
46 |
|
---|
47 | XY MGCoordinates::GetCoordinates() const
|
---|
48 | {
|
---|
49 | return XY(fX->GetVal(), fY->GetVal());
|
---|
50 | }
|
---|
51 |
|
---|
52 | void MGCoordinates::SetCoordinates(const XY &xy)
|
---|
53 | {
|
---|
54 | fX->SetVal(xy.X());
|
---|
55 | fY->SetVal(xy.Y());
|
---|
56 | }
|
---|
57 |
|
---|
58 | void MGCoordinates::Print(Option_t *o) const
|
---|
59 | {
|
---|
60 | fX->Print();
|
---|
61 | fY->Print();
|
---|
62 | }
|
---|