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