casacore
Loading...
Searching...
No Matches
WCCompound.h
Go to the documentation of this file.
1// # WCCompound.h: Base class for compound WCRegion objects
2// # Copyright (C) 1998,1999,2003
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: casa-feedback@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#ifndef IMAGES_WCCOMPOUND_H
27#define IMAGES_WCCOMPOUND_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/images/Regions/WCRegion.h>
32#include <casacore/casa/Containers/Block.h>
33#include <casacore/casa/Arrays/IPosition.h>
34
35namespace casacore { // # NAMESPACE CASACORE - BEGIN
36
37// # Forward Declarations
38class ImageRegion;
39class LCRegion;
41class RecordInterface;
42class TableRecord;
43class String;
44
45// <summary>
46// Base class for compound WCRegion objects.
47// </summary>
48
49// <use visibility=local>
50
51// <reviewed reviewer="" date="" tests="">
52// </reviewed>
53
54// <prerequisite>
55// <li> <linkto class=WCRegion>WCRegion</linkto>
56// </prerequisite>
57
58// <synopsis>
59// WCCompound is the base class for world coordinate regions.
60// It defines the functionality simply as conversion to an LCRegion.
61// This is because you need an LCRegion to be able to access the
62// pixels in a Lattice.
63
64// The conversion functions should be flexible in that the
65// supplied CoordinateSystem does not have to be the same
66// as that with which the derived class was constructed.
67// This means that you can apply a WCCompound from one image
68// to another, provided that operation has some meaning.
69// </synopsis>
70
71// <example>
72// <srcblock>
73// </srcblock>
74// </example>
75
76// # <todo asof="1997/11/11">
77// # <li>
78// # </todo>
79
80class WCCompound : public WCRegion {
81 public:
82 // Construct from one or more image regions.
83 // The image regions have to contain WCRegion objects, otherwise an
84 // exception is thrown.
85 // <group>
86 WCCompound(const ImageRegion& region1, const ImageRegion& region2);
87 WCCompound(const ImageRegion* region1, const ImageRegion* region2 = 0,
88 const ImageRegion* region3 = 0, const ImageRegion* region4 = 0,
89 const ImageRegion* region5 = 0, const ImageRegion* region6 = 0,
90 const ImageRegion* region7 = 0, const ImageRegion* region8 = 0,
91 const ImageRegion* region9 = 0, const ImageRegion* region10 = 0);
93 // </group>
94
95 // Construct from multiple regions given as a Block.
96 // When <src>takeOver</src> is True, the destructor will delete the
97 // given regions. Otherwise a copy of the regions is made.
99
100 // Copy constructor (copy semantics).
101 WCCompound(const WCCompound& other);
102
103 virtual ~WCCompound();
104
105 // Comparison
106 virtual Bool operator==(const WCRegion& other) const;
107
108 // Get the contributing regions.
109 const Block<const WCRegion*>& regions() const;
110
111 protected:
112 // Assignment (copy semantics) makes only sense for a derived class.
114
115 // Convert each WCRegion to an LCRegion.
116 // The axes argument tells which axes to use from the coordinate
117 // system and shape.
119 const IPosition& shape, const IPosition& pixelAxesMap,
120 const IPosition& extendAxes) const;
121
122 // Store the contributing regions in a record.
123 TableRecord makeRecord(const String& tableName) const;
124
125 // Retrieve the contributing objects from the record.
126 static void unmakeRecord(Block<const WCRegion*>&, const TableRecord&, const String& tableName);
127
128 private:
129 // Check if the ImageRegion's contain WCRegion's and extract them.
131
132 // Check if the regions are correct.
133 // If needed, make a copy of the region objects.
134 void init(Bool takeOver);
135
136 // # Member variables.
139};
140
142
143} // namespace casacore
144
145#endif
String: the storage and methods of handling collections of characters.
Definition String.h:355
Block< const WCRegion * > itsRegions
Definition WCCompound.h:137
WCCompound(const ImageRegion *region1, const ImageRegion *region2=0, const ImageRegion *region3=0, const ImageRegion *region4=0, const ImageRegion *region5=0, const ImageRegion *region6=0, const ImageRegion *region7=0, const ImageRegion *region8=0, const ImageRegion *region9=0, const ImageRegion *region10=0)
void init(Bool takeOver)
Check if the regions are correct.
WCCompound(const Block< const ImageRegion * > &regions)
virtual Bool operator==(const WCRegion &other) const
Comparison.
static void unmakeRecord(Block< const WCRegion * > &, const TableRecord &, const String &tableName)
Retrieve the contributing objects from the record.
const Block< const WCRegion * > & regions() const
Get the contributing regions.
Definition WCCompound.h:141
Block< IPosition > itsAxesUsed
Definition WCCompound.h:138
WCCompound(const ImageRegion &region1, const ImageRegion &region2)
Construct from one or more image regions.
void makeWCRegion(const Block< const ImageRegion * > &)
Check if the ImageRegion's contain WCRegion's and extract them.
TableRecord makeRecord(const String &tableName) const
Store the contributing regions in a record.
WCCompound(Bool takeOver, const Block< const WCRegion * > &regions)
Construct from multiple regions given as a Block.
WCCompound & operator=(const WCCompound &other)
Assignment (copy semantics) makes only sense for a derived class.
WCCompound(const WCCompound &other)
Copy constructor (copy semantics).
void multiToLCRegion(Block< const LCRegion * > &regions, const CoordinateSystem &cSys, const IPosition &shape, const IPosition &pixelAxesMap, const IPosition &extendAxes) const
Convert each WCRegion to an LCRegion.
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
IPosition shape(const RecordFieldId &) const
Get the actual shape of this field.
RecordInterface()
The default constructor creates an empty record with a variable structure.
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40