casacore
Loading...
Searching...
No Matches
LCStretch.h
Go to the documentation of this file.
1//# LCStretch.h: Stretch length 1 axes in an LCRegion along straight lines
2//# Copyright (C) 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_LCSTRETCH_H
27#define LATTICES_LCSTRETCH_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// Stretch length 1 axes in an LCRegion along straight lines
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 LCStretch class is a specialization of class
52// <linkto class=LCRegion>LCRegion</linkto>.
53// It makes it possible to stretch a LCRegion along straight lines to
54// other dimensions. E.g. a circle in the xy-plane can be stretched 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-)stretch 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> Stretch along (slanted) cone lines
68// </todo>
69
71{
72public:
74
75 // Stretch the given region along axes as given by <src>stretchAxes</src>
76 // from the bottom left corner (blc) to the top right corner (trc)
77 // as given by <src>stretchBox</src>.
78 // The axes to be stretched need to have length 1 in the original region.
79 // Every kind of box (absolute, relative, fractional, unspecified)
80 // can be used to define the stretch blc and trc.
81 // The dimensionality of the LCStretch region is the same as the
82 // dimensionality of the original region.
83 // <br>
84 // The second version takes over the pointer when the switch is true.
85 // <group>
88 const LCBox& stretchBox);
89 LCStretch (Bool takeOver,
90 const LCRegion* region,
92 const LCBox& stretchBox);
93 // </group>
94
95 // Copy constructor (copy semantics).
96 LCStretch (const LCStretch& other);
97
98 virtual ~LCStretch();
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 stretch axes.
113 const IPosition& stretchAxes() const;
114
115 // Get the stretch box.
116 const LCBox& stretchBox() 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.
148
149
152};
153
154
155inline const LCRegion& LCStretch::region() const
156{
157 return *(regions()[0]);
158}
160{
161 return itsStretchAxes;
162}
163inline const LCBox& LCStretch::stretchBox() const
164{
165 return itsStretchBox;
166}
167
168
169
170} //# NAMESPACE CASACORE - END
171
172#endif
const PtrBlock< const LCRegion * > & regions() const
Get the contributing regions.
const LCBox & stretchBox() const
Get the stretch box.
Definition LCStretch.h:163
virtual String type() const
Get the region type.
const LCRegion & region() const
Get the original region.
Definition LCStretch.h:155
virtual LCRegion * doTranslate(const Vector< Float > &translateVector, const IPosition &newLatticeShape) const
Construct another LCRegion (for e.g.
void fill(const IPosition &stretchAxes, const LCBox &stretchBox)
Fill the object.
virtual Bool operator==(const LCRegion &other) const
Comparison.
virtual void multiGetSlice(Array< Bool > &buffer, const Slicer &section)
Do the actual getting of the mask.
LCStretch(const LCStretch &other)
Copy constructor (copy semantics).
LCStretch(Bool takeOver, const LCRegion *region, const IPosition &stretchAxes, const LCBox &stretchBox)
virtual TableRecord toRecord(const String &tableName) const
Convert the (derived) object to a record.
LCStretch(const LCRegion &region, const IPosition &stretchAxes, const LCBox &stretchBox)
Stretch the given region along axes as given by stretchAxes from the bottom left corner (blc) to the ...
static String className()
Get the class name (to store in the record).
static LCStretch * fromRecord(const TableRecord &, const String &tableName)
Convert correct object from a record.
LCStretch & operator=(const LCStretch &other)
Assignment (copy semantics).
virtual LCRegion * cloneRegion() const
Make a copy of the derived object.
IPosition itsStretchAxes
Definition LCStretch.h:150
const IPosition & stretchAxes() const
Get the stretch axes.
Definition LCStretch.h:159
virtual IPosition doNiceCursorShape(uInt maxPixels) const
This function is needed here because the niceCursorShape of the contributing region does not make any...
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