casacore
Loading...
Searching...
No Matches
WCComplement.h
Go to the documentation of this file.
1//# WCComplement.h: Make the complement of an image region
2//# Copyright (C) 1998,2004
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_WCCOMPLEMENT_H
27#define IMAGES_WCCOMPLEMENT_H
28
29//# Includes
30#include <casacore/casa/aips.h>
31#include <casacore/images/Regions/WCCompound.h>
32
33
34namespace casacore { //# NAMESPACE CASACORE - BEGIN
35
36// <summary>
37// Make the complement of an image region.
38// </summary>
39
40// <use visibility=export>
41
42// <reviewed reviewer="" date="" tests="">
43// </reviewed>
44
45// <prerequisite>
46// <li> <linkto class=WCCompound>WCCompound</linkto>
47// </prerequisite>
48
49// <synopsis>
50// The WCComplement class is a specialization of class
51// <linkto class=WCCompound>WCCompound</linkto>.
52// It makes it possible to take the complement of the given region
53// (which can be a simple WCBox, but also a complex compound region).
54// Note that only world coordinate regions can be used in a compound,
55// thus an LCSlicer object is not allowed in an intersection.
56// <p>
57// Note that a region consists of all its masked-on pixels inside the
58// bounding box of the region. Thus the complement consists of all
59// pixels outside the bounding box and all masked-off pixels inside
60// the bounding box. So the complement of the complement of a region
61// is the region itself.
62// </synopsis>
63
64// <example>
65// <srcblock>
66// </srcblock>
67// </example>
68
69//# <todo asof="1997/11/11">
70//# <li>
71//# </todo>
72
73
75{
76public:
78
79 // Construct the complement of the given region.
80 WCComplement (const ImageRegion& region1);
81
82 // Copy constructor (copy semantics).
83 WCComplement (const WCComplement& other);
84
85 virtual ~WCComplement();
86
87 // Assignment (copy semantics).
89
90 // Comparison
91 virtual Bool operator== (const WCRegion& other) const;
92
93 // Make a copy of the derived object.
94 // cloneRegion needs to return a WCRegion * because the
95 // SGI compiler is smart enough to do the right thing.
96 virtual WCRegion* cloneRegion() const;
97
98 // Get the class name (to store in the record).
99 static String className();
100
101 // Get the region type. Returns className()
102 virtual String type() const;
103
104 // Convert the (derived) object to a record.
105 virtual TableRecord toRecord (const String& tableName) const;
106
107 // Convert correct object from a record.
109 const String& tableName);
110
111 // Construct from multiple regions.
112 // When <src>takeOver</src> is True, the destructor will delete the
113 // given regions. Otherwise a copy of the regions is made.
116
117protected:
118 // Convert to an LCRegion using the given coordinate system and shape.
119 // pixelAxesMap(i) gives the pixel axis in cSys of axes <src>i</src>
120 // in the axesDesc.
122 const IPosition& shape,
123 const IPosition& pixelAxesMap,
124 const IPosition& outOrder) const;
125};
126
127
128
129} //# NAMESPACE CASACORE - END
130
131#endif
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
virtual WCRegion * cloneRegion() const
Make a copy of the derived object.
static String className()
Get the class name (to store in the record).
static WCComplement * fromRecord(const TableRecord &, const String &tableName)
Convert correct object from a record.
virtual String type() const
Get the region type.
virtual Bool operator==(const WCRegion &other) const
Comparison.
virtual LCRegion * doToLCRegion(const CoordinateSystem &cSys, const IPosition &shape, const IPosition &pixelAxesMap, const IPosition &outOrder) const
Convert to an LCRegion using the given coordinate system and shape.
virtual TableRecord toRecord(const String &tableName) const
Convert the (derived) object to a record.
WCComplement & operator=(const WCComplement &other)
Assignment (copy semantics).
WCComplement(const WCComplement &other)
Copy constructor (copy semantics).
WCComplement(const ImageRegion &region1)
Construct the complement of the given region.
WCComplement(Bool takeOver, const PtrBlock< const WCRegion * > &regions)
Construct from multiple regions.
const PtrBlock< const WCRegion * > & regions() const
Get the contributing regions.
Definition WCCompound.h:154
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