source: trunk/Cosy/gui/MGCoordinates.cc@ 18403

Last change on this file since 18403 was 8852, checked in by tbretz, 17 years ago
*** empty log message ***
File size: 1.5 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 "MGCoordinate.h"
10
11#include "MLog.h"
12#include "MLogManip.h"
13
14ClassImp(MGCoordinates);
15
16using namespace std;
17
18MGCoordinates::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
39MGCoordinates::~MGCoordinates()
40{
41 delete fY;
42 delete fX;
43
44 gLog << inf2 << "MGCoordinates destroyed." << endl;
45}
46
47XY MGCoordinates::GetCoordinates() const
48{
49 return XY(fX->GetVal(), fY->GetVal());
50}
51
52void MGCoordinates::SetCoordinates(const XY &xy)
53{
54 fX->SetVal(xy.X());
55 fY->SetVal(xy.Y());
56}
57
58void MGCoordinates::Print(Option_t *o) const
59{
60 fX->Print();
61 fY->Print();
62}
Note: See TracBrowser for help on using the repository browser.