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
34namespace casacore { // # NAMESPACE CASACORE - BEGIN
35
36// <summary>
37// Stretch length 1 axes in an LCRegion along straight lines
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 LCStretch class is a specialization of class
51// <linkto class=LCRegion>LCRegion</linkto>.
52// It makes it possible to stretch a LCRegion along straight lines to
53// other dimensions. E.g. a circle in the xy-plane can be stretched 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-)stretch 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> Stretch along (slanted) cone lines
67// </todo>
68
69class LCStretch : public LCRegionMulti {
70 public:
72
73 // Stretch the given region along axes as given by <src>stretchAxes</src>
74 // from the bottom left corner (blc) to the top right corner (trc)
75 // as given by <src>stretchBox</src>.
76 // The axes to be stretched need to have length 1 in the original region.
77 // Every kind of box (absolute, relative, fractional, unspecified)
78 // can be used to define the stretch blc and trc.
79 // The dimensionality of the LCStretch region is the same as the
80 // dimensionality of the original region.
81 // <br>
82 // The second version takes over the pointer when the switch is true.
83 // <group>
86 const LCBox& stretchBox);
87 // </group>
88
89 // Copy constructor (copy semantics).
90 LCStretch(const LCStretch& other);
91
92 virtual ~LCStretch();
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 stretch axes.
104 const IPosition& stretchAxes() const;
105
106 // Get the stretch box.
107 const LCBox& stretchBox() 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 LCStretch* 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.
141
144};
145
146inline const LCRegion& LCStretch::region() const { return *(regions()[0]); }
147inline const IPosition& LCStretch::stretchAxes() const { return itsStretchAxes; }
148inline const LCBox& LCStretch::stretchBox() const { return itsStretchBox; }
149
150} // namespace casacore
151
152#endif
const Block< const LCRegion * > & regions() const
Get the contributing regions.
const LCBox & stretchBox() const
Get the stretch box.
Definition LCStretch.h:148
String type() const override
Get the region type.
Bool equals(const LCRegion &other) const override
Comparison.
IPosition doNiceCursorShape(uInt maxPixels) const override
This function is needed here because the niceCursorShape of the contributing region does not make any...
const LCRegion & region() const
Get the original region.
Definition LCStretch.h:146
void fill(const IPosition &stretchAxes, const LCBox &stretchBox)
Fill the object.
TableRecord toRecord(const String &tableName) const override
Convert the (derived) object to a record.
LCRegion * cloneRegion() const override
Make a copy of the derived object.
LCStretch(const LCStretch &other)
Copy constructor (copy semantics).
LCStretch(Bool takeOver, const LCRegion *region, const IPosition &stretchAxes, const LCBox &stretchBox)
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).
LCRegion * doTranslate(const Vector< Float > &translateVector, const IPosition &newLatticeShape) const override
Construct another LCRegion (for e.g.
static LCStretch * fromRecord(const TableRecord &, const String &tableName)
Convert correct object from a record.
void multiGetSlice(Array< Bool > &buffer, const Slicer &section) override
Do the actual getting of the mask.
LCStretch & operator=(const LCStretch &other)
Assignment (copy semantics).
IPosition itsStretchAxes
Definition LCStretch.h:142
const IPosition & stretchAxes() const
Get the stretch axes.
Definition LCStretch.h:147
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