Loading...
Searching...
No Matches
casacore::LattRegionHolder Class Reference
lattices package (libcasa_lattices) » LRegions_module

More...

`#include <LattRegionHolder.h>`

## Public Member Functions

| LattRegionHolder (const LCRegion &)
| Construct from a region based on lattice coordinates.
| LattRegionHolder (const LCSlicer &)
| Construct from a slicer based on lattice coordinates.
| LattRegionHolder (LCRegion *)
| Similar constructors as above, but using a pointer.
| LattRegionHolder (LCSlicer *)
| LattRegionHolder (const LattRegionHolder &other)
| Copy constructor (copy semantics).
virtual | ~LattRegionHolder ()
LattRegionHolder & | operator= (const LattRegionHolder &other)
| Assignment (copy semantics).
virtual LattRegionHolder * | clone () const
| Clone the object.
virtual Bool | operator== (const LattRegionHolder &other) const
| Comparison.
Bool | operator!= (const LattRegionHolder &other) const
Bool | isLCRegion () const
| Test if the underlying region is an LCRegion, etc.
Bool | isLCSlicer () const
virtual Bool | isWCRegion () const
const LCRegion * | asLCRegionPtr () const
| Get the region as a pointer to a LCRegion, LCSlicer, or WCRegion.
const LCSlicer * | asLCSlicerPtr () const
virtual const WCRegion * | asWCRegionPtr () const
uInt | ndim () const
| Get the dimensionality.
LatticeRegion | toLatticeRegion (const IPosition &shape) const
| Convert to a LatticeRegion using the given shape.
virtual LatticeRegion | toLatticeRegion (const CoordinateSystem &cSys, const IPosition &shape) const
| Convert to a LatticeRegion using the given coordinate system (with reference pixel) and shape.
virtual LattRegionHolder * | makeUnion (const LattRegionHolder &other) const
| Form a compound from this and the other region.
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).

## Private Attributes

LCRegion * | itsLC
LCSlicer * | itsSlicer
uInt | itsNdim

## Detailed Description

Class to hold a region of interest in an image.

### Intended use:

Public interface

### Prerequisite

- LCSlicer
- LCRegion

### Synopsis

The only purpose of LattRegionHolder is to have a single object for the various kinds of regions. It can hold a LCRegion, and LCSlicer.

### Example

### Motivation

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 85 of file LattRegionHolder.h.

## Constructor & Destructor Documentation

## LattRegionHolder() [1/6]

casacore::LattRegionHolder::LattRegionHolder | ( | const LCRegion & |  | ) |

Construct from a region based on lattice coordinates.

Referenced by clone(), LattRegionHolder(), casacore::ImageRegion::makeComplement(), makeComplement(), casacore::ImageRegion::makeDifference(), makeDifference(), casacore::ImageRegion::makeIntersection(), makeIntersection(), casacore::ImageRegion::makeUnion(), makeUnion(), operator!=(), operator=(), casacore::ImageRegion::operator==(), and operator==().

## LattRegionHolder() [2/6]

casacore::LattRegionHolder::LattRegionHolder | ( | const LCSlicer & |  | ) |

Construct from a slicer based on lattice coordinates.

## LattRegionHolder() [3/6]

casacore::LattRegionHolder::LattRegionHolder | ( | LCRegion * |  | ) |

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.

## LattRegionHolder() [4/6]

casacore::LattRegionHolder::LattRegionHolder | ( | LCSlicer * |  | ) |

explicit

## LattRegionHolder() [5/6]

casacore::LattRegionHolder::LattRegionHolder | ( | const LattRegionHolder & | other | ) |

Copy constructor (copy semantics).

References LattRegionHolder().

## ~LattRegionHolder()

virtual casacore::LattRegionHolder::~LattRegionHolder | ( |  | ) |

virtual

## LattRegionHolder() [6/6]

casacore::LattRegionHolder::LattRegionHolder | ( | uInt | ndim | ) |

explicit protected

Construct for the given dimensionality (for derived classes).

References ndim().

## Member Function Documentation

## asLCRegionPtr()

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().

## asLCSlicerPtr()

const LCSlicer * casacore::LattRegionHolder::asLCSlicerPtr | ( |  | ) | const

Referenced by casacore::ImageRegion::asLCSlicer().

## asWCRegionPtr()

virtual const WCRegion * casacore::LattRegionHolder::asWCRegionPtr | ( |  | ) | const

virtual

Reimplemented in casacore::ImageRegion.

## clone()

virtual LattRegionHolder * casacore::LattRegionHolder::clone | ( |  | ) | const

virtual

Clone the object.

Reimplemented in casacore::ImageRegion.

References LattRegionHolder().

## isLCRegion()

Bool casacore::LattRegionHolder::isLCRegion | ( |  | ) | const

inline

Test if the underlying region is an LCRegion, etc.

Definition at line 168 of file LattRegionHolder.h.

References itsLC.

## isLCSlicer()

Bool casacore::LattRegionHolder::isLCSlicer | ( |  | ) | const

inline

Definition at line 172 of file LattRegionHolder.h.

References itsSlicer.

## isWCRegion()

virtual Bool casacore::LattRegionHolder::isWCRegion | ( |  | ) | const

virtual

Reimplemented in casacore::ImageRegion.

## makeComplement()

virtual LattRegionHolder * casacore::LattRegionHolder::makeComplement | ( |  | ) | const

virtual

Reimplemented in casacore::ImageRegion.

References LattRegionHolder().

## makeDifference()

virtual LattRegionHolder * casacore::LattRegionHolder::makeDifference | ( | const LattRegionHolder & | other | ) | const

virtual

Reimplemented in casacore::ImageRegion.

References LattRegionHolder().

## makeIntersection()

virtual LattRegionHolder * casacore::LattRegionHolder::makeIntersection | ( | const LattRegionHolder & | other | ) | const

virtual

Reimplemented in casacore::ImageRegion.

References LattRegionHolder().

## makeUnion()

virtual LattRegionHolder * casacore::LattRegionHolder::makeUnion | ( | const LattRegionHolder & | other | ) | const

virtual

Form a compound from this and the other region.

Reimplemented in casacore::ImageRegion.

References LattRegionHolder().

## ndim()

uInt casacore::LattRegionHolder::ndim | ( |  | ) | const

inline

Get the dimensionality.

Definition at line 180 of file LattRegionHolder.h.

References itsNdim.

Referenced by LattRegionHolder().

## operator!=()

Bool casacore::LattRegionHolder::operator!= | ( | const LattRegionHolder & | other | ) | const

inline

Definition at line 176 of file LattRegionHolder.h.

References LattRegionHolder().

## operator=()

LattRegionHolder & casacore::LattRegionHolder::operator= | ( | const LattRegionHolder & | other | ) |

Assignment (copy semantics).

References LattRegionHolder().

## operator==()

virtual Bool casacore::LattRegionHolder::operator== | ( | const LattRegionHolder & | other | ) | const

virtual

Comparison.

Reimplemented in casacore::ImageRegion.

References LattRegionHolder().

## toLatticeRegion() [1/2]

virtual LatticeRegion casacore::LattRegionHolder::toLatticeRegion | ( | const CoordinateSystem & | cSys,
|  | const IPosition & | shape ) const

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.

References casacore::shape().

## toLatticeRegion() [2/2]

LatticeRegion casacore::LattRegionHolder::toLatticeRegion | ( | const IPosition & | shape | ) | const

Convert to a LatticeRegion using the given shape.

References casacore::shape().

## Member Data Documentation

## itsLC

LCRegion* casacore::LattRegionHolder::itsLC

private

Definition at line 162 of file LattRegionHolder.h.

Referenced by isLCRegion().

## itsNdim

uInt casacore::LattRegionHolder::itsNdim

private

Definition at line 164 of file LattRegionHolder.h.

Referenced by ndim().

## itsSlicer

LCSlicer* casacore::LattRegionHolder::itsSlicer

private

Definition at line 163 of file LattRegionHolder.h.

Referenced by isLCSlicer().

The documentation for this class was generated from the following file:

- lattices/LRegions/LattRegionHolder.h