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
33
34namespace casacore { //# NAMESPACE CASACORE - BEGIN
35
36// <summary>
37// Make the intersection of 2 or more regions.
38// </summary>
39
40// <use visibility=export>
41
42// <reviewed reviewer="" date="" tests="">
43// </reviewed>
44
45// <prerequisite>
46// <li> <linkto class=LCRegion>LCRegion</linkto>
47// </prerequisite>
48
49// <synopsis>
50// The LCIntersection class is a specialization of class
51// <linkto class=LCRegion>LCRegion</linkto>.
52// It makes it possible to find the intersection of
53// given regions.
54// <p>
55// The center of the intersection must be inside the lattice
56// </synopsis>
57
58// <example>
59// <srcblock>
60// </srcblock>
61// </example>
62
63// <todo asof="1997/11/11">
64// <li> Expand along (slanted) cone lines
65// </todo>
66
68{
69public:
71
72 // Construct the intersection of the given regions.
73 LCIntersection (const LCRegion& region1, const LCRegion& region2);
74
75 // Construct from multiple regions.
76 LCIntersection (Bool takeOver, const LCRegion* region1,
77 const LCRegion* region2 = 0,
78 const LCRegion* region3 = 0,
79 const LCRegion* region4 = 0,
80 const LCRegion* region5 = 0,
81 const LCRegion* region6 = 0,
82 const LCRegion* region7 = 0,
83 const LCRegion* region8 = 0,
84 const LCRegion* region9 = 0,
85 const LCRegion* region10 = 0);
86
87 // Construct from multiple regions given as a Block.
88 // When <src>takeOver</src> is True, the destructor will delete the
89 // given regions. Otherwise a copy of the regions is made.
91
92 // Copy constructor (copy semantics).
94
95 virtual ~LCIntersection();
96
97 // Assignment (copy semantics).
99
100 // Comparison
101 virtual Bool operator== (const LCRegion& other) const;
102
103 // Make a copy of the derived object.
104 virtual LCRegion* cloneRegion() const;
105
106 // Get the class name (to store in the record).
108
109 // Get the region type. Returns className()
110 virtual String type() const;
111
112 // Convert the (derived) object to a record.
113 virtual TableRecord toRecord (const String& tableName) const;
114
115 // Convert correct object from a record.
117 const String& tableName);
118
119protected:
120 // Construct another LCRegion (for e.g. another lattice) by moving
121 // this one. It recalculates the bounding box and mask.
122 // A positive translation value indicates "to right".
123 virtual LCRegion* doTranslate (const Vector<Float>& translateVector,
124 const IPosition& newLatticeShape) const;
125
126 // Do the actual getting of the mask.
127 virtual void multiGetSlice (Array<Bool>& buffer, const Slicer& section);
128
129private:
130 // Make the bounding box and determine the offsets.
131 void defineBox();
132
133
134 //# Define the offsets where to start reading from constituting regions.
136};
137
138
139
140} //# NAMESPACE CASACORE - END
141
142#endif
simple 1-D array
Definition Block.h:198
virtual String type() const
Get the region type.
static LCIntersection * fromRecord(const TableRecord &, const String &tableName)
Convert correct object from a record.
LCIntersection & operator=(const LCIntersection &other)
Assignment (copy semantics).
virtual TableRecord toRecord(const String &tableName) const
Convert the (derived) object to a record.
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.
virtual void multiGetSlice(Array< Bool > &buffer, const Slicer &section)
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).
virtual LCRegion * cloneRegion() const
Make a copy of the derived object.
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.
virtual LCRegion * doTranslate(const Vector< Float > &translateVector, const IPosition &newLatticeShape) const
Construct another LCRegion (for e.g.
virtual Bool operator==(const LCRegion &other) const
Comparison.
LCIntersection(Bool takeOver, const PtrBlock< const LCRegion * > &regions)
Construct from multiple regions given as a Block.
const PtrBlock< const LCRegion * > & regions() const
Get the contributing regions.
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
this file contains all the compiler specific defines
Definition mainpage.dox:28
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40