casacore
Loading...
Searching...
No Matches
LCDifference.h
Go to the documentation of this file.
1//# LCDifference.h: Make the difference of 2 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_LCDIFFERENCE_H
27#define LATTICES_LCDIFFERENCE_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 difference of 2 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 LCDifference class is a specialization of class
51// <linkto class=LCRegion>LCRegion</linkto>.
52// It makes it possible to "subtract" one region from
53// another. For example, imagine an overlapping box
54// and circle. The box - circle is the box with the
55// chunk taken out of it where the circle overlaps.
56// The circle - box is the circle with the chunk
57// taken out of it where the box overlaps.
58// <p>
59// The center of the difference must be inside the lattice
60// </synopsis>
61
62// <example>
63// <srcblock>
64// </srcblock>
65// </example>
66
67// <todo asof="1997/11/11">
68// </todo>
69
71{
72public:
74
75 // Construct the difference region1 - region2.
76 LCDifference (const LCRegion& region1, const LCRegion& region2);
77
78 // Construct from multiple regions given as a Block.
79 // When <src>takeOver</src> is True, the destructor will delete the
80 // given regions. Otherwise a copy of the regions is made.
82
83 // Copy constructor (copy semantics).
84 LCDifference (const LCDifference& other);
85
86 virtual ~LCDifference();
87
88 // Assignment (copy semantics).
90
91 // Comparison
92 virtual Bool operator== (const LCRegion& other) const;
93
94 // Make a copy of the derived object.
95 virtual LCRegion* cloneRegion() const;
96
97 // Get the class name (to store in the record).
98 static String className();
99
100 // Get the region type. Returns className()
101 virtual String type() const;
102
103 // Convert the (derived) object to a record.
104 virtual TableRecord toRecord (const String& tableName) const;
105
106 // Convert correct object from a record.
108 const String& tableName);
109
110protected:
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 virtual LCRegion* doTranslate (const Vector<Float>& translateVector,
115 const IPosition& newLatticeShape) const;
116
117 // Do the actual getting of the mask.
118 virtual void multiGetSlice (Array<Bool>& buffer, const Slicer& section);
119
120private:
121 // Make the bounding box and determine the offsets.
122 void defineBox();
123};
124
125
126
127} //# NAMESPACE CASACORE - END
128
129#endif
static LCDifference * fromRecord(const TableRecord &, const String &tableName)
Convert correct object from a record.
virtual LCRegion * doTranslate(const Vector< Float > &translateVector, const IPosition &newLatticeShape) const
Construct another LCRegion (for e.g.
static String className()
Get the class name (to store in the record).
LCDifference(const LCRegion &region1, const LCRegion &region2)
Construct the difference region1 - region2.
virtual LCRegion * cloneRegion() const
Make a copy of the derived object.
virtual String type() const
Get the region type.
LCDifference(const LCDifference &other)
Copy constructor (copy semantics).
LCDifference & operator=(const LCDifference &other)
Assignment (copy semantics).
virtual Bool operator==(const LCRegion &other) const
Comparison.
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.
LCDifference(Bool takeOver, const PtrBlock< const LCRegion * > &regions)
Construct from multiple regions given as a Block.
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: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