casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
WCEllipsoid.h
Go to the documentation of this file.
1 //# WCPolygon.h: Class to define a polygonal world coordinate region
2 //# Copyright (C) 1998,1999,2001
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 
29 #ifndef IMAGES_WCELLIPSOID_H
30 #define IMAGES_WCELLIPSOID_H
31 
32 #include <casacore/casa/aips.h>
38 
39 namespace casacore { //# NAMESPACE CASACORE - BEGIN
40 
41 
42 // <summary>
43 // Class to define an n-dimensional ellipsoid in world coordinates.
44 //
45 // </summary>
46 //
47 // <use visibility=export>
48 //
49 // <reviewed reviewer="" date="" tests="">
50 // </reviewed>
51 //
52 // <prerequisite>
53 // <li> <linkto class=WCRegion>WCRegion</linkto>
54 // <li> <linkto class=WCRegion>WCPolygon</linkto>
55 // <li> <linkto class=LCRegion>LCRegion</linkto>
56 // <li> <linkto class=CoordinateSystem>CoordinateSystem</linkto>
57 // </prerequisite>
58 //
59 // <synopsis>
60 //
61 // </synopsis>
62 //
63 
64 // <motivation>
65 // Users must be able to specify ellipsoids in world as well as lattice
66 // coordinates.
67 // </motivation>
68 //
69 
70 
71 class WCEllipsoid : public WCRegion
72 {
73 public:
74 
75  // ellipsoid with axes parallel to coordinate axes
77  const Vector<Quantity>& center,
78  const Vector<Quantity>& radii,
79  const IPosition& pixelAxes,
80  const CoordinateSystem& cSys,
82  );
83 
84  // sphere. <src>pixelAxes</src> must have the same base units
85  // and those pixels musb be square or an exception is thrown.
87  const Vector<Quantity>& center,
88  const Quantity& radius,
89  const IPosition& pixelAxes,
90  const CoordinateSystem& cSys,
92  );
93 
94  // 2-D ellipse . The axes must have the same base units
95  // and those pixels must be square or an exception is thrown.
96  // <src>theta</src> is the angle between the <src>pixelAxis0</src> and
97  // the major axis of the ellipse.
99  const Quantity& xcenter, const Quantity& ycenter,
100  const Quantity& majorAxis, const Quantity& minorAxis,
101  const Quantity& theta,
102  const uInt pixelAxis0, const uInt pixelAxis1,
103  const CoordinateSystem& cSys,
105  );
106 
107  WCEllipsoid(const WCEllipsoid& that);
108 
109  WCEllipsoid& operator= (const WCEllipsoid& that);
110 
111  Bool operator== (const WCRegion& other) const;
112 
113  WCRegion* cloneRegion() const;
114 
115  Bool canExtend() const;
116 
117  String type() const;
118 
119  static String className();
120 
121  static WCEllipsoid* fromRecord(
122  const TableRecord& rec,
123  const String&
124  );
125 
126  TableRecord toRecord(const String& tableName) const;
127 
129  const CoordinateSystem& csys,
130  const IPosition& latticeShape,
131  const IPosition& pixelAxesMap,
132  const IPosition& outOrder
133  ) const;
134 
135 private:
136 
137  // WARN do not change the order of the members of this enum
138  // or you will break backward compatibility with records previously
139  // saved persistently. Add new types to the end of the enum.
140  enum SpecialType {
144  };
145 
146  WCEllipsoid();
147 
150 
156 
157  void _checkPixelAxes() const;
158  void _checkUnits() const;
159 
160  void _init();
161 
162 };
163 
164 } //# NAMESPACE CASACORE - END
165 
166 #endif
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
SpecialType _specType
Definition: WCEllipsoid.h:155
A 1-D Specialization of the Array class.
Vector< Quantity > _center
Definition: WCEllipsoid.h:148
void _checkPixelAxes() const
WCEllipsoid & operator=(const WCEllipsoid &that)
String type() const
Return region type.
TableRecord toRecord(const String &tableName) const
Convert the (derived) object to a record.
static String className()
static WCEllipsoid * fromRecord(const TableRecord &rec, const String &)
AbsRelType
Define if a region is absolute or relative.
Definition: RegionType.h:75
Vector< Quantity > _radii
Definition: WCEllipsoid.h:149
CoordinateSystem _csys
Definition: WCEllipsoid.h:152
LCRegion * doToLCRegion(const CoordinateSystem &csys, const IPosition &latticeShape, const IPosition &pixelAxesMap, const IPosition &outOrder) const
Convert to an LCRegion using the given coordinate system and shape.
RegionType::AbsRelType _absRel
Definition: WCEllipsoid.h:153
Bool canExtend() const
Can the region extend itself? By default it cannot.
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
void _checkUnits() const
A hierarchical collection of named fields of various types.
Definition: TableRecord.h:182
Bool operator==(const WCRegion &other) const
Comparison.
Class to define an n-dimensional ellipsoid in world coordinates.
Definition: WCEllipsoid.h:71
SpecialType
WARN do not change the order of the members of this enum or you will break backward compatibility wit...
Definition: WCEllipsoid.h:140
Base class to define world coordinate regions of interest in an image.
Definition: WCRegion.h:95
String: the storage and methods of handling collections of characters.
Definition: String.h:223
WCRegion * cloneRegion() const
Clone a WCRegion object.
Interconvert pixel and world coordinates.
unsigned int uInt
Definition: aipstype.h:51
Abstract base class to define a region of interest in lattice coordinates.
Definition: LCRegion.h:87
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42