casacore
Loading...
Searching...
No Matches
LCExtension.h
Go to the documentation of this file.
1// # LCExtension.h: Extend an LCRegion along straight lines to other dimensions
2// # Copyright (C) 1998,2001
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_LCEXTENSION_H
27#define LATTICES_LCEXTENSION_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/lattices/LRegions/LCRegionMulti.h>
32#include <casacore/lattices/LRegions/LCBox.h>
33
34namespace casacore { // # NAMESPACE CASACORE - BEGIN
35
36// <summary>
37// Extend an LCRegion along straight lines to other dimensions
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 LCExtension class is a specialization of class
51// <linkto class=LCRegion>LCRegion</linkto>.
52// It makes it possible to extend a LCRegion along straight lines to
53// other dimensions. E.g. a circle in the xy-plane can be extended to
54// a cylinder in the xyz-space.
55// It can be used for a lattice of any dimensionality as long as the
56// dimensionality of the (hyper-)extension matches the dimensionality of
57// the lattice.
58// </synopsis>
59
60// <example>
61// <srcblock>
62// </srcblock>
63// </example>
64
65// <todo asof="1997/11/11">
66// <li> Extend along (slanted) cone lines
67// </todo>
68
69class LCExtension : public LCRegionMulti {
70 public:
72
73 // Extend the given region along axes as given by <src>extendAxes</src>
74 // from the bottom left corner (blc) to the top right corner (trc)
75 // as given by <src>extendBox</src>.
76 // Every kind of box (absolute, relative, fractional, unspecified)
77 // can be used to define the extension blc and trc.
78 // The sum of the dimensionality of the region and the extend box
79 // make up the dimensionality of the LCExtension region.
80 // Similarly the lattice shapes in region and box are combined.
81 // <br>
82 // The second version takes over the pointer when the switch is true.
83 // <group>
86 const LCBox& extendBox);
87 // </group>
88
89 // Copy constructor (copy semantics).
90 LCExtension(const LCExtension& other);
91
92 virtual ~LCExtension();
93
94 // Assignment (copy semantics).
96
97 // Make a copy of the derived object.
98 LCRegion* cloneRegion() const override;
99
100 // Get the original region.
101 const LCRegion& region() const;
102
103 // Get the extend axes.
104 const IPosition& extendAxes() const;
105
106 // Get the extend box.
107 const LCBox& extendBox() const;
108
109 // Get the class name (to store in the record).
111
112 // Get the region type. Returns the class name.
113 String type() const override;
114
115 // Convert the (derived) object to a record.
116 TableRecord toRecord(const String& tableName) const override;
117
118 // Convert correct object from a record.
119 static LCExtension* fromRecord(const TableRecord&, const String& tableName);
120
121 protected:
122 // Comparison
123 Bool equals(const LCRegion& other) const override;
124
125 // Construct another LCRegion (for e.g. another lattice) by moving
126 // this one. It recalculates the bounding box and mask.
127 // A positive translation value indicates "to right".
128 LCRegion* doTranslate(const Vector<Float>& translateVector,
129 const IPosition& newLatticeShape) const override;
130
131 // Do the actual getting of the mask.
132 void multiGetSlice(Array<Bool>& buffer, const Slicer& section) override;
133
134 // This function is needed here because the niceCursorShape of the
135 // contributing region does not make any sense (other dimensionality).
136 IPosition doNiceCursorShape(uInt maxPixels) const override;
137
138 private:
139 // Fill the object.
140 // <group>
142 void fill(const IPosition& stretchAxes, const LCBox& stretchBox);
143 // </group>
144
148};
149
150inline const LCRegion& LCExtension::region() const { return *(regions()[0]); }
151inline const IPosition& LCExtension::extendAxes() const { return itsExtendAxes; }
152inline const LCBox& LCExtension::extendBox() const { return itsExtendBox; }
153
154} // namespace casacore
155
156#endif
LCRegion * doTranslate(const Vector< Float > &translateVector, const IPosition &newLatticeShape) const override
Construct another LCRegion (for e.g.
String type() const override
Get the region type.
LCExtension(const LCRegion &region, const IPosition &extendAxes, const LCBox &extendBox)
Extend the given region along axes as given by extendAxes from the bottom left corner (blc) to the to...
TableRecord toRecord(const String &tableName) const override
Convert the (derived) object to a record.
LCExtension(Bool takeOver, const LCRegion *region, const IPosition &extendAxes, const LCBox &extendBox)
LCExtension(const LCExtension &other)
Copy constructor (copy semantics).
const LCRegion & region() const
Get the original region.
Bool equals(const LCRegion &other) const override
Comparison.
LCExtension & operator=(const LCExtension &other)
Assignment (copy semantics).
static LCExtension * fromRecord(const TableRecord &, const String &tableName)
Convert correct object from a record.
void fillRegionAxes()
Fill the object.
static String className()
Get the class name (to store in the record).
const LCBox & extendBox() const
Get the extend box.
IPosition doNiceCursorShape(uInt maxPixels) const override
This function is needed here because the niceCursorShape of the contributing region does not make any...
void multiGetSlice(Array< Bool > &buffer, const Slicer &section) override
Do the actual getting of the mask.
const IPosition & extendAxes() const
Get the extend axes.
LCRegion * cloneRegion() const override
Make a copy of the derived object.
void fill(const IPosition &stretchAxes, const LCBox &stretchBox)
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
unsigned int uInt
Definition aipstype.h:49
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40