casa::LattRegionHolder Class Reference
[Lattices]

#include <LattRegionHolder.h>

Inheritance diagram for casa::LattRegionHolder:

Inheritance graph
[legend]
Collaboration diagram for casa::LattRegionHolder:

Collaboration graph
[legend]
List of all members.

Detailed Description

Class to hold a region of interest in an image.

Intended use:

Part of API

Prerequisite

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 86 of file 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 (const LattRegionHolder &other)
 Copy constructor (copy semantics).
virtual ~LattRegionHolder ()
LattRegionHolderoperator= (const LattRegionHolder &other)
 Assignment (copy semantics).
virtual LattRegionHolderclone () const
 Clone the object.
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.
 LattRegionHolder (LCRegion *)
 Similar constructors as above, but using a pointer.
 LattRegionHolder (LCSlicer *)
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 LCRegionasLCRegionPtr () const
 Get the region as a pointer to a LCRegion, LCSlicer, or WCRegion.
const LCSlicerasLCSlicerPtr () const
virtual const WCRegionasWCRegionPtr () const
virtual LattRegionHoldermakeUnion (const LattRegionHolder &other) const
 Form a compound from this and the other region.
virtual LattRegionHoldermakeIntersection (const LattRegionHolder &other) const
virtual LattRegionHoldermakeDifference (const LattRegionHolder &other) const
virtual LattRegionHoldermakeComplement () const

Protected Member Functions

 LattRegionHolder (uInt ndim)
 Construct for the given dimensionality (for derived classes).

Private Attributes

LCRegionitsLC
LCSliceritsSlicer
uInt itsNdim


Constructor & Destructor Documentation

casa::LattRegionHolder::LattRegionHolder ( const LCRegion  ) 

Construct from a region based on lattice coordinates.

casa::LattRegionHolder::LattRegionHolder ( const LCSlicer  ) 

Construct from a slicer based on lattice coordinates.

casa::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.

casa::LattRegionHolder::LattRegionHolder ( LCSlicer  )  [explicit]

casa::LattRegionHolder::LattRegionHolder ( const LattRegionHolder other  ) 

Copy constructor (copy semantics).

virtual casa::LattRegionHolder::~LattRegionHolder (  )  [virtual]

casa::LattRegionHolder::LattRegionHolder ( uInt  ndim  )  [explicit, protected]

Construct for the given dimensionality (for derived classes).


Member Function Documentation

LattRegionHolder& casa::LattRegionHolder::operator= ( const LattRegionHolder other  ) 

Assignment (copy semantics).

virtual LattRegionHolder* casa::LattRegionHolder::clone (  )  const [virtual]

Clone the object.

virtual Bool casa::LattRegionHolder::operator== ( const LattRegionHolder other  )  const [virtual]

Comparison.

Bool casa::LattRegionHolder::operator!= ( const LattRegionHolder other  )  const [inline]

Definition at line 177 of file LattRegionHolder.h.

Bool casa::LattRegionHolder::isLCRegion (  )  const [inline]

Test if the underlying region is an LCRegion, etc.

\.

Definition at line 169 of file LattRegionHolder.h.

References itsLC.

Bool casa::LattRegionHolder::isLCSlicer (  )  const [inline]

Definition at line 173 of file LattRegionHolder.h.

References itsSlicer.

virtual Bool casa::LattRegionHolder::isWCRegion (  )  const [virtual]

const LCRegion* casa::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 casa::ImageRegion::asLCRegion().

const LCSlicer* casa::LattRegionHolder::asLCSlicerPtr (  )  const

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

virtual const WCRegion* casa::LattRegionHolder::asWCRegionPtr (  )  const [virtual]

uInt casa::LattRegionHolder::ndim (  )  const [inline]

Get the dimensionality.

Definition at line 181 of file LattRegionHolder.h.

References itsNdim.

LatticeRegion casa::LattRegionHolder::toLatticeRegion ( const IPosition shape  )  const

Convert to a LatticeRegion using the given shape.

virtual LatticeRegion casa::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).

virtual LattRegionHolder* casa::LattRegionHolder::makeUnion ( const LattRegionHolder other  )  const [virtual]

Form a compound from this and the other region.

virtual LattRegionHolder* casa::LattRegionHolder::makeIntersection ( const LattRegionHolder other  )  const [virtual]

virtual LattRegionHolder* casa::LattRegionHolder::makeDifference ( const LattRegionHolder other  )  const [virtual]

virtual LattRegionHolder* casa::LattRegionHolder::makeComplement (  )  const [virtual]


Member Data Documentation

LCRegion* casa::LattRegionHolder::itsLC [private]

Definition at line 163 of file LattRegionHolder.h.

Referenced by isLCRegion().

LCSlicer* casa::LattRegionHolder::itsSlicer [private]

Definition at line 164 of file LattRegionHolder.h.

Referenced by isLCSlicer().

uInt casa::LattRegionHolder::itsNdim [private]

Definition at line 165 of file LattRegionHolder.h.

Referenced by ndim().


The documentation for this class was generated from the following file:
Generated on Mon Sep 1 22:46:21 2008 for NRAOCASA by  doxygen 1.5.1