casacore
|
Class to hold a region of interest in an image. More...
#include <LattRegionHolder.h>
Public Member Functions | |
LattRegionHolder (const LCRegion &) | |
Construct from a region based on lattice coordinates. More... | |
LattRegionHolder (const LCSlicer &) | |
Construct from a slicer based on lattice coordinates. More... | |
LattRegionHolder (LCRegion *) | |
Similar constructors as above, but using a pointer. More... | |
LattRegionHolder (LCSlicer *) | |
LattRegionHolder (const LattRegionHolder &other) | |
Copy constructor (copy semantics). More... | |
virtual | ~LattRegionHolder () |
LattRegionHolder & | operator= (const LattRegionHolder &other) |
Assignment (copy semantics). More... | |
virtual LattRegionHolder * | clone () const |
Clone the object. More... | |
virtual Bool | operator== (const LattRegionHolder &other) const |
Comparison. More... | |
Bool | operator!= (const LattRegionHolder &other) const |
Bool | isLCRegion () const |
Test if the underlying region is an LCRegion, etc. More... | |
Bool | isLCSlicer () const |
virtual Bool | isWCRegion () const |
const LCRegion * | asLCRegionPtr () const |
Get the region as a pointer to a LCRegion, LCSlicer, or WCRegion. More... | |
const LCSlicer * | asLCSlicerPtr () const |
virtual const WCRegion * | asWCRegionPtr () const |
uInt | ndim () const |
Get the dimensionality. More... | |
LatticeRegion | toLatticeRegion (const IPosition &shape) const |
Convert to a LatticeRegion using the given shape. More... | |
virtual LatticeRegion | toLatticeRegion (const CoordinateSystem &cSys, const IPosition &shape) const |
Convert to a LatticeRegion using the given coordinate system (with reference pixel) and shape. More... | |
virtual LattRegionHolder * | makeUnion (const LattRegionHolder &other) const |
Form a compound from this and the other region. More... | |
virtual LattRegionHolder * | makeIntersection (const LattRegionHolder &other) const |
virtual LattRegionHolder * | makeDifference (const LattRegionHolder &other) const |
virtual LattRegionHolder * | makeComplement () const |
Protected Member Functions | |
LattRegionHolder (uInt ndim) | |
Construct for the given dimensionality (for derived classes). More... | |
Private Attributes | |
LCRegion * | itsLC |
LCSlicer * | itsSlicer |
uInt | itsNdim |
Class to hold a region of interest in an image.
Public interface
The only purpose of LattRegionHolder is to have a single object for the various kinds of regions. It can hold a LCRegion , and LCSlicer .
It was felt that making an abstract base class LatticeRegion for LCRegion and WCRegion would create undesirable dependencies of module Lattices on module Coordinates. E.g. it would be impossible to have a function toWCRegion. Therefore the container class LattRegionHolder is chosen, from which the container ImageRegion is derived.
Definition at line 87 of file LattRegionHolder.h.
casacore::LattRegionHolder::LattRegionHolder | ( | const LCRegion & | ) |
Construct from a region based on lattice coordinates.
casacore::LattRegionHolder::LattRegionHolder | ( | const LCSlicer & | ) |
Construct from a slicer based on lattice coordinates.
|
explicit |
Similar constructors as above, but using a pointer.
It takes over the pointer, so the user should not delete the object. It is deleted by the LattRegionHolder destructor.
|
explicit |
casacore::LattRegionHolder::LattRegionHolder | ( | const LattRegionHolder & | other | ) |
Copy constructor (copy semantics).
|
virtual |
|
explicitprotected |
Construct for the given dimensionality (for derived classes).
const LCRegion* casacore::LattRegionHolder::asLCRegionPtr | ( | ) | const |
Get the region as a pointer to a LCRegion, LCSlicer, or WCRegion.
An exception is thrown if the region is not the correct type. Functions isWCRegion()
, etc. can be used to test the type.
Referenced by casacore::ImageRegion::asLCRegion().
const LCSlicer* casacore::LattRegionHolder::asLCSlicerPtr | ( | ) | const |
Referenced by casacore::ImageRegion::asLCSlicer().
|
virtual |
Reimplemented in casacore::ImageRegion.
|
virtual |
Clone the object.
Reimplemented in casacore::ImageRegion.
|
inline |
Test if the underlying region is an LCRegion, etc.
Definition at line 170 of file LattRegionHolder.h.
References itsLC.
|
inline |
Definition at line 174 of file LattRegionHolder.h.
References itsSlicer.
|
virtual |
Reimplemented in casacore::ImageRegion.
|
virtual |
Reimplemented in casacore::ImageRegion.
|
virtual |
Reimplemented in casacore::ImageRegion.
|
virtual |
Reimplemented in casacore::ImageRegion.
|
virtual |
Form a compound from this and the other region.
Reimplemented in casacore::ImageRegion.
|
inline |
|
inline |
Definition at line 178 of file LattRegionHolder.h.
LattRegionHolder& casacore::LattRegionHolder::operator= | ( | const LattRegionHolder & | other | ) |
Assignment (copy semantics).
|
virtual |
Comparison.
Reimplemented in casacore::ImageRegion.
LatticeRegion casacore::LattRegionHolder::toLatticeRegion | ( | const IPosition & | shape | ) | const |
Convert to a LatticeRegion using the given shape.
|
virtual |
Convert to a LatticeRegion using the given coordinate system (with reference pixel) and shape.
It will also make the region complete (absolute and non-fractional).
Reimplemented in casacore::ImageRegion.
|
private |
Definition at line 164 of file LattRegionHolder.h.
Referenced by isLCRegion().
|
private |
Definition at line 166 of file LattRegionHolder.h.
Referenced by ndim().
|
private |
Definition at line 165 of file LattRegionHolder.h.
Referenced by isLCSlicer().