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
34
35namespace casacore { //# NAMESPACE CASACORE - BEGIN
36
37// <summary>
38// Extend an LCRegion along straight lines to other dimensions
39// </summary>
40
41// <use visibility=export>
42
43// <reviewed reviewer="" date="" tests="">
44// </reviewed>
45
46// <prerequisite>
47// <li> <linkto class=LCRegion>LCRegion</linkto>
48// </prerequisite>
49
50// <synopsis>
51// The LCExtension class is a specialization of class
52// <linkto class=LCRegion>LCRegion</linkto>.
53// It makes it possible to extend a LCRegion along straight lines to
54// other dimensions. E.g. a circle in the xy-plane can be extended to
55// a cylinder in the xyz-space.
56// It can be used for a lattice of any dimensionality as long as the
57// dimensionality of the (hyper-)extension matches the dimensionality of
58// the lattice.
59// </synopsis>
60
61// <example>
62// <srcblock>
63// </srcblock>
64// </example>
65
66// <todo asof="1997/11/11">
67// <li> Extend along (slanted) cone lines
68// </todo>
69
71{
72public:
74
75 // Extend the given region along axes as given by <src>extendAxes</src>
76 // from the bottom left corner (blc) to the top right corner (trc)
77 // as given by <src>extendBox</src>.
78 // Every kind of box (absolute, relative, fractional, unspecified)
79 // can be used to define the extension blc and trc.
80 // The sum of the dimensionality of the region and the extend box
81 // make up the dimensionality of the LCExtension region.
82 // Similarly the lattice shapes in region and box are combined.
83 // <br>
84 // The second version takes over the pointer when the switch is true.
85 // <group>
87 const IPosition& extendAxes,
88 const LCBox& extendBox);
89 LCExtension (Bool takeOver,
90 const LCRegion* region,
91 const IPosition& extendAxes,
92 const LCBox& extendBox);
93 // </group>
94
95 // Copy constructor (copy semantics).
96 LCExtension (const LCExtension& other);
97
98 virtual ~LCExtension();
99
100 // Assignment (copy semantics).
102
103 // Comparison
104 virtual Bool operator== (const LCRegion& other) const;
105
106 // Make a copy of the derived object.
107 virtual LCRegion* cloneRegion() const;
108
109 // Get the original region.
110 const LCRegion& region() const;
111
112 // Get the extend axes.
113 const IPosition& extendAxes() const;
114
115 // Get the extend box.
116 const LCBox& extendBox() const;
117
118 // Get the class name (to store in the record).
120
121 // Get the region type. Returns the class name.
122 virtual String type() const;
123
124 // Convert the (derived) object to a record.
125 virtual TableRecord toRecord (const String& tableName) const;
126
127 // Convert correct object from a record.
129 const String& tableName);
130
131protected:
132 // Construct another LCRegion (for e.g. another lattice) by moving
133 // this one. It recalculates the bounding box and mask.
134 // A positive translation value indicates "to right".
135 virtual LCRegion* doTranslate (const Vector<Float>& translateVector,
136 const IPosition& newLatticeShape) const;
137
138 // Do the actual getting of the mask.
139 virtual void multiGetSlice (Array<Bool>& buffer, const Slicer& section);
140
141 // This function is needed here because the niceCursorShape of the
142 // contributing region does not make any sense (other dimensionality).
143 virtual IPosition doNiceCursorShape (uInt maxPixels) const;
144
145private:
146 // Fill the object.
147 // <group>
149 void fill (const IPosition& stretchAxes, const LCBox& stretchBox);
150 // </group>
151
155};
156
157
158inline const LCRegion& LCExtension::region() const
159{
160 return *(regions()[0]);
161}
163{
164 return itsExtendAxes;
165}
166inline const LCBox& LCExtension::extendBox() const
167{
168 return itsExtendBox;
169}
170
171
172
173} //# NAMESPACE CASACORE - END
174
175#endif
virtual LCRegion * cloneRegion() const
Make a copy of the derived object.
virtual Bool operator==(const LCRegion &other) const
Comparison.
virtual IPosition doNiceCursorShape(uInt maxPixels) const
This function is needed here because the niceCursorShape of the contributing region does not make any...
virtual void multiGetSlice(Array< Bool > &buffer, const Slicer &section)
Do the actual getting of the mask.
virtual LCRegion * doTranslate(const Vector< Float > &translateVector, const IPosition &newLatticeShape) const
Construct another LCRegion (for e.g.
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...
LCExtension(Bool takeOver, const LCRegion *region, const IPosition &extendAxes, const LCBox &extendBox)
virtual TableRecord toRecord(const String &tableName) const
Convert the (derived) object to a record.
LCExtension(const LCExtension &other)
Copy constructor (copy semantics).
const LCRegion & region() const
Get the original region.
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.
virtual String type() const
Get the region type.
const IPosition & extendAxes() const
Get the extend axes.
void fill(const IPosition &stretchAxes, const LCBox &stretchBox)
const PtrBlock< const LCRegion * > & regions() const
Get the contributing regions.
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
unsigned int uInt
Definition aipstype.h:49
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40