casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
casa::AnnRegion Class Reference

This class represents a annotation referring to a region specified in an ascii region file as proposed in CAS-2285 <author>Dave Mehringer</author> More...

#include <AnnRegion.h>

Inheritance diagram for casa::AnnRegion:
casa::AnnotationBase casa::AnnAnnulus casa::AnnCenterBox casa::AnnCircle casa::AnnEllipse casa::AnnPolygon casa::AnnPolyline casa::AnnRectBox casa::AnnRotBox

List of all members.

Public Member Functions

virtual ~AnnRegion ()
void setAnnotationOnly (const Bool isAnnotationOnly)
Bool isAnnotationOnly () const
 is this region an annotation only? ie just for graphical rendering?
virtual TableRecord asRecord () const
virtual ImageRegion asImageRegion () const
virtual WCRegiongetRegion () const
virtual Bool isRegion () const
 returns True unless overridden.
void setDifference (const Bool difference)
Bool isDifference () const
vector< DoublegetSpectralPixelRange () const
 get the pixel range included in the spectral selection.

Protected Member Functions

 AnnRegion (const Type shape, const String &dirRefFrameString, const CoordinateSystem &csys, const IPosition &imShape, const Quantity &beginFreq, const Quantity &endFreq, const String &freqRefFrame, const String &dopplerString, const Quantity &restfreq, const Vector< Stokes::StokesTypes > stokes, const Bool annotationOnly)
 only to be called by subclasses
 AnnRegion (const Type shape, const CoordinateSystem &csys, const IPosition &imShape, const Vector< Stokes::StokesTypes > &stokes)
 use if all coordinate values will be specified in the same frames as the input coordinate system.
 AnnRegion (const AnnRegion &other)
 implicitly defined copy constructor is fine AnnRegion(AnnRegion& other);
AnnRegionoperator= (const AnnRegion &rhs)
 assignment operator
void _extend ()
 extend the direction plane region over spectral and/or polarization coordinates
void _toRecord (const ImageRegion &region)
Quantity _lengthToAngle (const Quantity &quantity, const uInt pixelAxis) const
 convert a length in pixels to an angle.
virtual void _printPrefix (ostream &os) const
void _setDirectionRegion (const ImageRegion &region)
 subclasses must call this at construction to set their base region defined in the direction plane
Bool _setFrequencyLimits (const Quantity &beginFreq, const Quantity &endFreq, const String &freqRefFrame, const String &dopplerString, const Quantity &restfreq)
 if freqRefFrame=="" -> use the reference frame of the coordinate system if dopplerString=="" -> use the doppler system associated with the coordinate system if restfreq=Quantity(0, "Hz") -> use the rest frequency associated with the coordinate system Tacitly does nothing if the coordinate system has no spectral axis.

Private Member Functions

WCBox _makeExtensionBox (const Vector< Quantity > &freqRange, const Vector< Stokes::StokesTypes > &stokesRange, const IPosition &pixelAxes) const
void _init ()

Private Attributes

Bool _isAnnotationOnly
Bool _isDifference
Bool _constructing
ImageRegion _imageRegion
ImageRegion _directionRegion
IPosition _imShape
vector< Double_spectralPixelRange

Static Private Attributes

static const String _class

Detailed Description

This class represents a annotation referring to a region specified in an ascii region file as proposed in CAS-2285 <author>Dave Mehringer</author>

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Etymology

Holds the specification of an annotation containing a region as specified in ASCII format.

Synopsis

This class is meant to be a container for all parameters necessary to specify a region per the format proposal attached to CAS-2285 (https://bugs.nrao.edu/browse/CAS-2285).

Conversions of frequency from one reference frame to another are done here. The position of the reference pixel in the supplied coordinate system is used when converting frequencies.

Definition at line 53 of file AnnRegion.h.


Constructor & Destructor Documentation

virtual casa::AnnRegion::~AnnRegion ( ) [virtual]
casa::AnnRegion::AnnRegion ( const Type  shape,
const String dirRefFrameString,
const CoordinateSystem csys,
const IPosition imShape,
const Quantity beginFreq,
const Quantity endFreq,
const String freqRefFrame,
const String dopplerString,
const Quantity restfreq,
const Vector< Stokes::StokesTypes stokes,
const Bool  annotationOnly 
) [protected]

only to be called by subclasses

beginFreq and endFreq can both be 0, in which case all the spectral range is used if a spectral axis exists in csys</csys>. If one of <src>beginFreq or endFreq is given, the other must be given. Frequency units can either conform to Hz, m/s, or pix. If beginFreq and endFreq are not specifed or if they are specified in pixel units, freqRefFrame, dopplerString, and restfreq are ignored. If provided, beginFreq and endFreq must conform to the same units.

casa::AnnRegion::AnnRegion ( const Type  shape,
const CoordinateSystem csys,
const IPosition imShape,
const Vector< Stokes::StokesTypes > &  stokes 
) [protected]

use if all coordinate values will be specified in the same frames as the input coordinate system.

frequencies and the annotationOnly flag can be set after construction. By default, all frequencies and all polarizations are used, and the annotationOnly flag is False

casa::AnnRegion::AnnRegion ( const AnnRegion other) [protected]

implicitly defined copy constructor is fine AnnRegion(AnnRegion& other);

copy constructor


Member Function Documentation

void casa::AnnRegion::_extend ( ) [protected]

extend the direction plane region over spectral and/or polarization coordinates

void casa::AnnRegion::_init ( ) [private]
Quantity casa::AnnRegion::_lengthToAngle ( const Quantity quantity,
const uInt  pixelAxis 
) const [protected]

convert a length in pixels to an angle.

WCBox casa::AnnRegion::_makeExtensionBox ( const Vector< Quantity > &  freqRange,
const Vector< Stokes::StokesTypes > &  stokesRange,
const IPosition pixelAxes 
) const [private]
virtual void casa::AnnRegion::_printPrefix ( ostream &  os) const [protected, virtual]
void casa::AnnRegion::_setDirectionRegion ( const ImageRegion region) [protected]

subclasses must call this at construction to set their base region defined in the direction plane

Bool casa::AnnRegion::_setFrequencyLimits ( const Quantity beginFreq,
const Quantity endFreq,
const String freqRefFrame,
const String dopplerString,
const Quantity restfreq 
) [protected, virtual]

if freqRefFrame=="" -> use the reference frame of the coordinate system if dopplerString=="" -> use the doppler system associated with the coordinate system if restfreq=Quantity(0, "Hz") -> use the rest frequency associated with the coordinate system Tacitly does nothing if the coordinate system has no spectral axis.

Returns True if frequencies actually need to be set and were set.

Reimplemented from casa::AnnotationBase.

void casa::AnnRegion::_toRecord ( const ImageRegion region) [protected]
virtual ImageRegion casa::AnnRegion::asImageRegion ( ) const [virtual]
virtual TableRecord casa::AnnRegion::asRecord ( ) const [virtual]
virtual WCRegion* casa::AnnRegion::getRegion ( ) const [virtual]

get the pixel range included in the spectral selection.

If there is no spectral axis, a zero length vector is returned. Otherwise, a vector of two values is returned. The zeroth value will always be less than or equal to the first.

is this region an annotation only? ie just for graphical rendering?

Reimplemented from casa::AnnotationBase.

virtual Bool casa::AnnRegion::isRegion ( ) const [virtual]

returns True unless overridden.

Reimplemented from casa::AnnotationBase.

AnnRegion& casa::AnnRegion::operator= ( const AnnRegion rhs) [protected]

assignment operator

void casa::AnnRegion::setAnnotationOnly ( const Bool  isAnnotationOnly)
void casa::AnnRegion::setDifference ( const Bool  difference)

Member Data Documentation

const String casa::AnnRegion::_class [static, private]

Reimplemented from casa::AnnotationBase.

Definition at line 167 of file AnnRegion.h.

Definition at line 162 of file AnnRegion.h.

Definition at line 163 of file AnnRegion.h.

Definition at line 163 of file AnnRegion.h.

Definition at line 164 of file AnnRegion.h.

Definition at line 161 of file AnnRegion.h.

Definition at line 162 of file AnnRegion.h.

Definition at line 165 of file AnnRegion.h.


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