casacore
Loading...
Searching...
No Matches
LCComplement.h
Go to the documentation of this file.
1//# LCComplement.h: Make the complement of a region
2//# Copyright (C) 1998
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#ifndef LATTICES_LCCOMPLEMENT_H
29#define LATTICES_LCCOMPLEMENT_H
30
31//# Includes
32#include <casacore/casa/aips.h>
33#include <casacore/lattices/LRegions/LCRegionMulti.h>
34
35
36namespace casacore { //# NAMESPACE CASACORE - BEGIN
37
38// <summary>
39// Make the complement of a region.
40// </summary>
41
42// <use visibility=export>
43
44// <reviewed reviewer="" date="" tests="">
45// </reviewed>
46
47// <prerequisite>
48// <li> <linkto class=LCRegion>LCRegion</linkto>
49// </prerequisite>
50
51// <synopsis>
52// The LCComplement class is a specialization of class
53// <linkto class=LCRegion>LCRegion</linkto>.
54// It makes it possible to take the complement of a region with
55// respect to a given lattice shape.
56// <p>
57// The center of the complement must be inside the lattice
58// </synopsis>
59
60// <example>
61// <srcblock>
62// </srcblock>
63// </example>
64
65// <todo asof="1997/11/11">
66// <li> Expand along (slanted) cone lines
67// </todo>
68
70{
71public:
73
74 // Construct the complement of the given region.
75 LCComplement (const LCRegion& region1);
76
77 // Construct from multiple regions given as a Block.
78 // When <src>takeOver</src> is True, the destructor will delete the
79 // given regions. Otherwise a copy of the regions is made.
81
82 // Copy constructor (copy semantics).
83 LCComplement (const LCComplement& other);
84
85 virtual ~LCComplement();
86
87 // Assignment (copy semantics).
89
90 // Comparison
91 virtual Bool operator== (const LCRegion& other) const;
92
93 // Make a copy of the derived object.
94 virtual LCRegion* cloneRegion() const;
95
96 // Get the class name (to store in the record).
97 static String className();
98
99 // Get the region type. Returns className()
100 virtual String type() const;
101
102 // Convert the (derived) object to a record.
103 virtual TableRecord toRecord (const String& tableName) const;
104
105 // Convert correct object from a record.
107 const String& tableName);
108
109protected:
110 // Construct another LCRegion (for e.g. another lattice) by moving
111 // this one. It recalculates the bounding box and mask.
112 // A positive translation value indicates "to right".
113 virtual LCRegion* doTranslate (const Vector<Float>& translateVector,
114 const IPosition& newLatticeShape) const;
115
116 // Do the actual getting of the mask.
117 virtual void multiGetSlice (Array<Bool>& buffer, const Slicer& section);
118
119private:
120 // Make the bounding box and determine the offsets.
121 void defineBox();
122};
123
124
125
126} //# NAMESPACE CASACORE - END
127
128#endif
static String className()
Get the class name (to store in the record).
static LCComplement * fromRecord(const TableRecord &, const String &tableName)
Convert correct object from a record.
virtual Bool operator==(const LCRegion &other) const
Comparison.
void defineBox()
Make the bounding box and determine the offsets.
virtual String type() const
Get the region type.
virtual LCRegion * doTranslate(const Vector< Float > &translateVector, const IPosition &newLatticeShape) const
Construct another LCRegion (for e.g.
LCComplement & operator=(const LCComplement &other)
Assignment (copy semantics).
LCComplement(Bool takeOver, const PtrBlock< const LCRegion * > &regions)
Construct from multiple regions given as a Block.
LCComplement(const LCRegion &region1)
Construct the complement of the given region.
LCComplement(const LCComplement &other)
Copy constructor (copy semantics).
virtual void multiGetSlice(Array< Bool > &buffer, const Slicer &section)
Do the actual getting of the mask.
virtual LCRegion * cloneRegion() const
Make a copy of the derived object.
virtual TableRecord toRecord(const String &tableName) const
Convert the (derived) object to a record.
const PtrBlock< const LCRegion * > & regions() const
Get the contributing regions.
A drop-in replacement for Block<T*>.
Definition Block.h:814
String: the storage and methods of handling collections of characters.
Definition String.h:225
this file contains all the compiler specific defines
Definition mainpage.dox:28
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:42