| 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 Bool_t flag,
|
|---|
| 15 | const char *txt1, const char *txt2,
|
|---|
| 16 | const UInt_t deg1, const UInt_t min1, const UInt_t sec1,
|
|---|
| 17 | const UInt_t deg2, const UInt_t min2, const UInt_t sec2)
|
|---|
| 18 | : TGFrame(p, 234, 76, kFixedSize)
|
|---|
| 19 | {
|
|---|
| 20 | // p = pointer to MainFrame (not owner)
|
|---|
| 21 | fX = new MGCoordinate(this, flag, txt1, deg1, min1, sec1);
|
|---|
| 22 | fX->Move(0, 0);
|
|---|
| 23 |
|
|---|
| 24 | fY = new MGCoordinate(this, flag, txt2, deg2, min2, sec2);
|
|---|
| 25 | fY->Move(120, 0);
|
|---|
| 26 |
|
|---|
| 27 | MapWindow();
|
|---|
| 28 | }
|
|---|
| 29 |
|
|---|
| 30 | MGCoordinates::~MGCoordinates()
|
|---|
| 31 | {
|
|---|
| 32 | delete fY;
|
|---|
| 33 | delete fX;
|
|---|
| 34 |
|
|---|
| 35 | cout << "MGCoordinates destroyed." << endl;
|
|---|
| 36 | }
|
|---|
| 37 |
|
|---|
| 38 | XY MGCoordinates::GetCoordinates() const
|
|---|
| 39 | {
|
|---|
| 40 | return XY(fX->GetVal(), fY->GetVal());
|
|---|
| 41 | }
|
|---|
| 42 |
|
|---|
| 43 | void MGCoordinates::SetCoordinates(const XY &xy)
|
|---|
| 44 | {
|
|---|
| 45 | fX->SetVal(xy.X());
|
|---|
| 46 | fY->SetVal(xy.Y());
|
|---|
| 47 | }
|
|---|
| 48 |
|
|---|
| 49 | void MGCoordinates::Print()
|
|---|
| 50 | {
|
|---|
| 51 | fX->Print();
|
|---|
| 52 | fY->Print();
|
|---|
| 53 | }
|
|---|