casacore
Loading...
Searching...
No Matches
LCUnion.h
Go to the documentation of this file.
1// # LCUnion.h: Make the union of 2 or more regions
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_LCUNION_H
27#define LATTICES_LCUNION_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 union of 2 or more regions.
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 LCUnion class is a specialization of class
50// <linkto class=LCRegion>LCRegion</linkto>.
51// It makes it possible to extend a LCRegion along straight lines to
52// other dimensions. E.g. a circle in the xy-plane can be extended to
53// a cylinder in the xyz-space.
54// includes the union border.
55// It can only be used for a lattice of any dimensionality as long as the
56// dimensionality of the (hyper-)union matches the dimensionality of
57// the lattice.
58// <p>
59// The center of the union must be inside the lattice
60// </synopsis>
61
62// <example>
63// <srcblock>
64// </srcblock>
65// </example>
66
67// <todo asof="1997/11/11">
68// <li> Expand along (slanted) cone lines
69// </todo>
70
71class LCUnion : public LCRegionMulti {
72 public:
74
75 // Construct the union of the given regions.
76 LCUnion(const LCRegion& region1, const LCRegion& region2);
77
78 // Construct from multiple regions.
79 // When <src>takeOver</src> is True, the destructor will delete the
80 // given regions. Otherwise a copy of the regions is made.
81 // <group>
82 LCUnion(Bool takeOver, const LCRegion* region1, const LCRegion* region2 = 0,
83 const LCRegion* region3 = 0, const LCRegion* region4 = 0, const LCRegion* region5 = 0,
84 const LCRegion* region6 = 0, const LCRegion* region7 = 0, const LCRegion* region8 = 0,
85 const LCRegion* region9 = 0, const LCRegion* region10 = 0);
87 // </group>
88
89 // Copy constructor (copy semantics).
90 LCUnion(const LCUnion& other);
91
92 virtual ~LCUnion();
93
94 // Assignment (copy semantics).
95 LCUnion& operator=(const LCUnion& other);
96
97 // Make a copy of the derived object.
98 LCRegion* cloneRegion() const override;
99
100 // Get the class name (to store in the record).
102
103 // Get the region type. Returns className()
104 String type() const override;
105
106 // Convert the (derived) object to a record.
107 TableRecord toRecord(const String& tableName) const override;
108
109 // Convert correct object from a record.
110 static LCUnion* fromRecord(const TableRecord&, const String& tableName);
111
112 protected:
113 Bool equals(const LCRegion& other) const override;
114
115 // Construct another LCRegion (for e.g. another lattice) by moving
116 // this one. It recalculates the bounding box and mask.
117 // A positive translation value indicates "to right".
118 LCRegion* doTranslate(const Vector<Float>& translateVector,
119 const IPosition& newLatticeShape) const override;
120
121 // Do the actual getting of the mask.
122 void multiGetSlice(Array<Bool>& buffer, const Slicer& section) override;
123
124 private:
125 // Make the bounding box and determine the offsets.
126 void defineBox();
127};
128
129} // namespace casacore
130
131#endif
const Block< const LCRegion * > & regions() const
Get the contributing regions.
virtual ~LCUnion()
TableRecord toRecord(const String &tableName) const override
Convert the (derived) object to a record.
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.
LCUnion(const LCUnion &other)
Copy constructor (copy semantics).
LCUnion & operator=(const LCUnion &other)
Assignment (copy semantics).
static String className()
Get the class name (to store in the record).
LCRegion * cloneRegion() const override
Make a copy of the derived object.
static LCUnion * fromRecord(const TableRecord &, const String &tableName)
Convert correct object from a record.
String type() const override
Get the region type.
LCUnion(const LCRegion &region1, const LCRegion &region2)
Construct the union of the given regions.
LCUnion(Bool takeOver, const LCRegion *region1, const LCRegion *region2=0, const LCRegion *region3=0, const LCRegion *region4=0, const LCRegion *region5=0, const LCRegion *region6=0, const LCRegion *region7=0, const LCRegion *region8=0, const LCRegion *region9=0, const LCRegion *region10=0)
Construct from multiple regions.
LCUnion(Bool takeOver, const Block< const LCRegion * > &regions)
void defineBox()
Make the bounding box and determine the offsets.
void multiGetSlice(Array< Bool > &buffer, const Slicer &section) override
Do the actual getting of the mask.
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