casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Position.h
Go to the documentation of this file.
1 //# Position.h: world coordinates of a point on a display panel
2 //# Copyright (C) 2013
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 
28 #ifndef CASA_DISPLAY_POSITION_H
29 #define CASA_DISPLAY_POSITION_H
31 
32 namespace casa {
33  namespace viewer {
34  // Why not use casacore::MDirection? It's limited by valid astronomical coordinates on the sky Hz vs arcsec does not fly.
35  // The idea here is to represent a point, line, plane, etc. (depending on the dimensions of the coordinate
36  // system and the coordinate contained here) and eventually have positions which can convert themselves to
37  // match different coordinate systems used in other images; removing some of the tangle of linToWorld(...)
38  // et al. that snakes through canvases and display datas currently. It may well be that some of this may
39  // need to remain in the current canvases/datas, but at least the viewer (and regions) will be able to talk
40  // about positions independent of the rest of the viewer hierarchy.
41  class Position {
42  public:
43  Position( ) { }
44  // Later this could check for consistency between the coordinate and the system...
46  coord_(0) = x;
47  coord_(1) = y;
48  }
49  // Later this could check for consistency between the coordinate and the system...
51  coord_(0) = x;
52  coord_(1) = y;
53  coord_(2) = z;
54  }
55  Position( const Position &that ) : csys_(that.csys_), coord_(that.coord_) { }
56 
57  const DisplayCoordinateSystem &csys( ) const {
58  return csys_;
59  }
61  return coord_;
62  }
63 
64  void show( std::ostream &out ) const;
65 
66  protected:
69  };
70 
71  inline std::ostream &operator<<( std::ostream &out, const casa::viewer::Position &pos ) {
72  pos.show(out);
73  return out;
74  }
75 
76  }
77 
78  inline std::ostream &operator<<( std::ostream &out, const casa::viewer::Position &pos ) {
79  pos.show(out);
80  return out;
81  }
82 }
83 
84 inline std::ostream &operator<<( std::ostream &out, const casa::viewer::Position &pos ) {
85  pos.show(out);
86  return out;
87 }
88 
89 #endif
90 
A 1-D Specialization of the Array class.
Position(const DisplayCoordinateSystem &cs, const casacore::Quantity &x, const casacore::Quantity &y, const casacore::Quantity &z)
Later this could check for consistency between the coordinate and the system...
Definition: Position.h:50
ostream & operator<<(ostream &os, const PageHeaderCache &cache)
const DisplayCoordinateSystem & csys() const
Definition: Position.h:57
std::ostream & operator<<(std::ostream &out, const casa::viewer::Position &pos)
Definition: Position.h:71
Position(const Position &that)
Definition: Position.h:55
std::ostream & operator<<(std::ostream &out, const PolarizationType &value)
const casacore::Vector< casacore::Quantity > & coord() const
Definition: Position.h:60
casacore::Vector< casacore::Quantity > coord_
Definition: Position.h:68
void show(std::ostream &out) const
DisplayCoordinateSystem csys_
Definition: Position.h:67
Why not use casacore::MDirection? It&#39;s limited by valid astronomical coordinates on the sky Hz vs arc...
Definition: Position.h:41
Position(const DisplayCoordinateSystem &cs, const casacore::Quantity &x, const casacore::Quantity &y)
Later this could check for consistency between the coordinate and the system...
Definition: Position.h:45