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