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;
40class CoordinateSystem;
41class RecordInterface;
42class TableRecord;
43class String;
44
45
46// <summary>
47// Base class for compound WCRegion objects.
48// </summary>
49
50// <use visibility=local>
51
52// <reviewed reviewer="" date="" tests="">
53// </reviewed>
54
55// <prerequisite>
56// <li> <linkto class=WCRegion>WCRegion</linkto>
57// </prerequisite>
58
59// <synopsis>
60// WCCompound is the base class for world coordinate regions.
61// It defines the functionality simply as conversion to an LCRegion.
62// This is because you need an LCRegion to be able to access the
63// pixels in a Lattice.
64
65// The conversion functions should be flexible in that the
66// supplied CoordinateSystem does not have to be the same
67// as that with which the derived class was constructed.
68// This means that you can apply a WCCompound from one image
69// to another, provided that operation has some meaning.
70// </synopsis>
71
72// <example>
73// <srcblock>
74// </srcblock>
75// </example>
76
77//# <todo asof="1997/11/11">
78//# <li>
79//# </todo>
80
81
82class WCCompound : public WCRegion
83{
84public:
85 // Construct from one or more image regions.
86 // The image regions have to contain WCRegion objects, otherwise an
87 // exception is thrown.
88 // <group>
89 WCCompound (const ImageRegion& region1, const ImageRegion& region2);
90 WCCompound (const ImageRegion* region1,
91 const ImageRegion* region2 = 0,
92 const ImageRegion* region3 = 0,
93 const ImageRegion* region4 = 0,
94 const ImageRegion* region5 = 0,
95 const ImageRegion* region6 = 0,
96 const ImageRegion* region7 = 0,
97 const ImageRegion* region8 = 0,
98 const ImageRegion* region9 = 0,
99 const ImageRegion* region10 = 0);
101 // </group>
102
103 // Construct from multiple regions given as a Block.
104 // When <src>takeOver</src> is True, the destructor will delete the
105 // given regions. Otherwise a copy of the regions is made.
107
108 // Copy constructor (copy semantics).
109 WCCompound (const WCCompound& other);
110
111 virtual ~WCCompound();
112
113 // Comparison
114 virtual Bool operator==(const WCRegion& other) const;
115
116 // Get the contributing regions.
117 const PtrBlock<const WCRegion*>& regions() const;
118
119protected:
120 // Assignment (copy semantics) makes only sense for a derived class.
122
123 // Convert each WCRegion to an LCRegion.
124 // The axes argument tells which axes to use from the coordinate
125 // system and shape.
127 const CoordinateSystem& cSys,
128 const IPosition& shape,
129 const IPosition& pixelAxesMap,
130 const IPosition& extendAxes) const;
131
132 // Store the contributing regions in a record.
133 TableRecord makeRecord (const String& tableName) const;
134
135 // Retrieve the contributing objects from the record.
137 const TableRecord&,
138 const String& tableName);
139
140private:
141 // Check if the ImageRegion's contain WCRegion's and extract them.
143
144 // Check if the regions are correct.
145 // If needed, make a copy of the region objects.
146 void init (Bool takeOver);
147
148 //# Member variables.
151};
152
153
155{
156 return itsRegions;
157}
158
159
160
161} //# NAMESPACE CASACORE - END
162
163#endif
simple 1-D array
Definition Block.h:198
A drop-in replacement for Block<T*>.
Definition Block.h:812
String: the storage and methods of handling collections of characters.
Definition String.h:223
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.
virtual Bool operator==(const WCRegion &other) const
Comparison.
Block< IPosition > itsAxesUsed
Definition WCCompound.h:150
WCCompound(const ImageRegion &region1, const ImageRegion &region2)
Construct from one or more image regions.
TableRecord makeRecord(const String &tableName) const
Store the contributing regions in a record.
WCCompound(const PtrBlock< const ImageRegion * > &regions)
WCCompound & operator=(const WCCompound &other)
Assignment (copy semantics) makes only sense for a derived class.
WCCompound(const WCCompound &other)
Copy constructor (copy semantics).
WCCompound(Bool takeOver, const PtrBlock< const WCRegion * > &regions)
Construct from multiple regions given as a Block.
PtrBlock< const WCRegion * > itsRegions
Definition WCCompound.h:149
static void unmakeRecord(PtrBlock< const WCRegion * > &, const TableRecord &, const String &tableName)
Retrieve the contributing objects from the record.
const PtrBlock< const WCRegion * > & regions() const
Get the contributing regions.
Definition WCCompound.h:154
void makeWCRegion(const PtrBlock< const ImageRegion * > &)
Check if the ImageRegion's contain WCRegion's and extract them.
void multiToLCRegion(PtrBlock< const LCRegion * > &regions, const CoordinateSystem &cSys, const IPosition &shape, const IPosition &pixelAxesMap, const IPosition &extendAxes) const
Convert each WCRegion to an LCRegion.
this file contains all the compiler specific defines
Definition mainpage.dox:28
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape.
Definition ExprNode.h:1991
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40