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