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
33namespace casacore { // # NAMESPACE CASACORE - BEGIN
34
35// <summary>
36// Make the difference of 2 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 LCDifference class is a specialization of class
50// <linkto class=LCRegion>LCRegion</linkto>.
51// It makes it possible to "subtract" one region from
52// another. For example, imagine an overlapping box
53// and circle. The box - circle is the box with the
54// chunk taken out of it where the circle overlaps.
55// The circle - box is the circle with the chunk
56// taken out of it where the box overlaps.
57// <p>
58// The center of the difference must be inside the lattice
59// </synopsis>
60
61// <example>
62// <srcblock>
63// </srcblock>
64// </example>
65
66// <todo asof="1997/11/11">
67// </todo>
68
70 public:
72
73 // Construct the difference region1 - region2.
74 LCDifference(const LCRegion& region1, const LCRegion& region2);
75
76 // Construct from multiple regions given as a Block.
77 // When <src>takeOver</src> is True, the destructor will delete the
78 // given regions. Otherwise a copy of the regions is made.
80
81 // Copy constructor (copy semantics).
83
84 virtual ~LCDifference();
85
86 // Assignment (copy semantics).
88
89 // Make a copy of the derived object.
90 LCRegion* cloneRegion() const override;
91
92 // Get the class name (to store in the record).
93 static String className();
94
95 // Get the region type. Returns className()
96 String type() const override;
97
98 // Convert the (derived) object to a record.
99 TableRecord toRecord(const String& tableName) const override;
100
101 // Convert correct object from a record.
102 static LCDifference* fromRecord(const TableRecord&, const String& tableName);
103
104 protected:
105 // Comparison
106 Bool equals(const LCRegion& other) const override;
107
108 // Construct another LCRegion (for e.g. another lattice) by moving
109 // this one. It recalculates the bounding box and mask.
110 // A positive translation value indicates "to right".
111 LCRegion* doTranslate(const Vector<Float>& translateVector,
112 const IPosition& newLatticeShape) const override;
113
114 // Do the actual getting of the mask.
115 void multiGetSlice(Array<Bool>& buffer, const Slicer& section) override;
116
117 private:
118 // Make the bounding box and determine the offsets.
119 void defineBox();
120};
121
122} // namespace casacore
123
124#endif
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.
static LCDifference * fromRecord(const TableRecord &, const String &tableName)
Convert correct object from a record.
Bool equals(const LCRegion &other) const override
Comparison.
static String className()
Get the class name (to store in the record).
LCDifference(const LCRegion &region1, const LCRegion &region2)
Construct the difference region1 - region2.
LCRegion * doTranslate(const Vector< Float > &translateVector, const IPosition &newLatticeShape) const override
Construct another LCRegion (for e.g.
LCDifference(const LCDifference &other)
Copy constructor (copy semantics).
String type() const override
Get the region type.
LCDifference & operator=(const LCDifference &other)
Assignment (copy semantics).
void defineBox()
Make the bounding box and determine the offsets.
LCDifference(Bool takeOver, const Block< const LCRegion * > &regions)
Construct from multiple regions given as a Block.
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