casacore
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>
33 #include <casacore/coordinates/Coordinates/CoordinateSystem.h>
34 #include <casacore/images/Regions/WCRegion.h>
35 #include <casacore/lattices/LRegions/RegionType.h>
36 #include <casacore/casa/Arrays/Vector.h>
37 #include <casacore/casa/Quanta/Quantum.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 
110 
111  Bool operator== (const WCRegion& other) const;
112 
114 
115  Bool canExtend() const;
116 
117  String type() const;
118 
119  static String className();
120 
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 {
143  ELLIPSE_2D
144  };
145 
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
AbsRelType
Define if a region is absolute or relative.
Definition: RegionType.h:75
String: the storage and methods of handling collections of characters.
Definition: String.h:225
WCEllipsoid(const Vector< Quantity > &center, const Vector< Quantity > &radii, const IPosition &pixelAxes, const CoordinateSystem &cSys, const RegionType::AbsRelType absRel=RegionType::Abs)
ellipsoid with axes parallel to coordinate axes
Vector< Quantity > _radii
Definition: WCEllipsoid.h:149
TableRecord toRecord(const String &tableName) const
Convert the (derived) object to a record.
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.
WCRegion * cloneRegion() const
Clone a WCRegion object.
SpecialType _specType
Definition: WCEllipsoid.h:155
RegionType::AbsRelType _absRel
Definition: WCEllipsoid.h:153
Bool operator==(const WCRegion &other) const
Comparison.
Bool canExtend() const
Can the region extend itself? By default it cannot.
CoordinateSystem _csys
Definition: WCEllipsoid.h:152
static String className()
WCEllipsoid(const Vector< Quantity > &center, const Quantity &radius, const IPosition &pixelAxes, const CoordinateSystem &cSys, const RegionType::AbsRelType absRel=RegionType::Abs)
sphere.
static WCEllipsoid * fromRecord(const TableRecord &rec, const String &)
void _checkUnits() const
WCEllipsoid(const Quantity &xcenter, const Quantity &ycenter, const Quantity &majorAxis, const Quantity &minorAxis, const Quantity &theta, const uInt pixelAxis0, const uInt pixelAxis1, const CoordinateSystem &cSys, const RegionType::AbsRelType absRel=RegionType::Abs)
2-D ellipse.
WCEllipsoid & operator=(const WCEllipsoid &that)
SpecialType
WARN do not change the order of the members of this enum or you will break backward compatibility wit...
Definition: WCEllipsoid.h:140
WCEllipsoid(const WCEllipsoid &that)
void _checkPixelAxes() const
String type() const
Return region type.
Vector< Quantity > _center
Definition: WCEllipsoid.h:148
this file contains all the compiler specific defines
Definition: mainpage.dox:28
unsigned int uInt
Definition: aipstype.h:51
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42