source: trunk/MagicSoft/Cosy/gui/MGCoordinates.cc@ 1959

Last change on this file since 1959 was 1111, checked in by tbretz, 23 years ago
*** empty log message ***
File size: 1.4 KB
Line 
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
14ClassImp(MGCoordinates);
15
16MGCoordinates::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
37MGCoordinates::~MGCoordinates()
38{
39 delete fY;
40 delete fX;
41
42 cout << "MGCoordinates destroyed." << endl;
43}
44
45XY MGCoordinates::GetCoordinates() const
46{
47 return XY(fX->GetVal(), fY->GetVal());
48}
49
50void MGCoordinates::SetCoordinates(const XY &xy)
51{
52 fX->SetVal(xy.X());
53 fY->SetVal(xy.Y());
54}
55
56void MGCoordinates::Print()
57{
58 fX->Print();
59 fY->Print();
60}
Note: See TracBrowser for help on using the repository browser.