casacore
Loading...
Searching...
No Matches
LCIntersection.h
Go to the documentation of this file.
1// # LCIntersection.h: Make the intersection 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_LCINTERSECTION_H
27#define LATTICES_LCINTERSECTION_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 intersection 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 LCIntersection class is a specialization of class
50// <linkto class=LCRegion>LCRegion</linkto>.
51// It makes it possible to find the intersection of
52// given regions.
53// <p>
54// The center of the intersection 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 intersection of the given regions.
71 LCIntersection(const LCRegion& region1, const LCRegion& region2);
72
73 // Construct from multiple regions.
74 LCIntersection(Bool takeOver, const LCRegion* region1, const LCRegion* region2 = 0,
75 const LCRegion* region3 = 0, const LCRegion* region4 = 0,
76 const LCRegion* region5 = 0, const LCRegion* region6 = 0,
77 const LCRegion* region7 = 0, const LCRegion* region8 = 0,
78 const LCRegion* region9 = 0, const LCRegion* region10 = 0);
79
80 // Construct from multiple regions given as a Block.
81 // When <src>takeOver</src> is True, the destructor will delete the
82 // given regions. Otherwise a copy of the regions is made.
84
85 // Copy constructor (copy semantics).
87
88 virtual ~LCIntersection();
89
90 // Assignment (copy semantics).
92
93 // Make a copy of the derived object.
94 LCRegion* cloneRegion() const override;
95
96 // Get the class name (to store in the record).
97 static String className();
98
99 // Get the region type. Returns className()
100 String type() const override;
101
102 // Convert the (derived) object to a record.
103 TableRecord toRecord(const String& tableName) const override;
104
105 // Convert correct object from a record.
106 static LCIntersection* fromRecord(const TableRecord&, const String& tableName);
107
108 protected:
109 Bool equals(const LCRegion& other) const override;
110
111 // Construct another LCRegion (for e.g. another lattice) by moving
112 // this one. It recalculates the bounding box and mask.
113 // A positive translation value indicates "to right".
114 LCRegion* doTranslate(const Vector<Float>& translateVector,
115 const IPosition& newLatticeShape) const override;
116
117 // Do the actual getting of the mask.
118 void multiGetSlice(Array<Bool>& buffer, const Slicer& section) override;
119
120 private:
121 // Make the bounding box and determine the offsets.
122 void defineBox();
123
124 // # Define the offsets where to start reading from constituting regions.
126};
127
128} // namespace casacore
129
130#endif
static LCIntersection * fromRecord(const TableRecord &, const String &tableName)
Convert correct object from a record.
LCIntersection & operator=(const LCIntersection &other)
Assignment (copy semantics).
LCRegion * cloneRegion() const override
Make a copy of the derived object.
LCIntersection(Bool takeOver, const Block< const LCRegion * > &regions)
Construct from multiple regions given as a Block.
Bool equals(const LCRegion &other) const override
LCRegion * doTranslate(const Vector< Float > &translateVector, const IPosition &newLatticeShape) const override
Construct another LCRegion (for e.g.
Block< IPosition > itsOffsets
LCIntersection(const LCIntersection &other)
Copy constructor (copy semantics).
LCIntersection(const LCRegion &region1, const LCRegion &region2)
Construct the intersection of the given regions.
void multiGetSlice(Array< Bool > &buffer, const Slicer &section) override
Do the actual getting of the mask.
void defineBox()
Make the bounding box and determine the offsets.
static String className()
Get the class name (to store in the record).
TableRecord toRecord(const String &tableName) const override
Convert the (derived) object to a record.
LCIntersection(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.
String type() const override
Get the region type.
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