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

An ordered list of annotations and comments representing an ascii region file. <author>Dave Mehringer</author> More...

#include <RegionTextList.h>

List of all members.

Public Member Functions

 RegionTextList (const Bool deletePointersOnDestruct=True)
 create an empty list which can be appended to.
 RegionTextList (const CoordinateSystem &csys, const IPosition shape, const Bool deletePointersOnDestruct=True)
 create an empty list which can be appended to.
 RegionTextList (const String &filename, const CoordinateSystem &csys, const IPosition shape, const Int requireAtLeastThisVersion=RegionTextParser::CURRENT_VERSION, const Bool deletePointersOnDestruct=True)
 create a list by reading it from a file.
 RegionTextList (const CoordinateSystem &csys, const String &text, const IPosition shape, const Bool deletePointersOnDestruct=True)
 create a list by reading it from a text string.
 ~RegionTextList ()
 
         

void addLine (const AsciiAnnotationFileLine &line)
 add a line to the end of the list
uInt nLines () const
 number of lines in the list
AsciiAnnotationFileLine lineAt (const uInt i) const
 get the line at the specified index
const Vector
< AsciiAnnotationFileLine > & 
getLines () const
 get all lines in the list
ostream & print (ostream &os) const
WCRegiongetRegion () const
 get the composite region.
Record regionAsRecord () const
 get the composite region as a region record.

Private Attributes

Vector< AsciiAnnotationFileLine_lines
Bool _deletePointersOnDestruct
PtrBlock< WCRegion * > _regions
CoordinateSystem _csys
IPosition _shape
Bool _canGetRegion

Detailed Description

An ordered list of annotations and comments representing an ascii region file. <author>Dave Mehringer</author>

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Etymology

An order list of annotations and comments representing an ascii region file.

Synopsis

A list of regions and annotations and comments representing an ascii region file. See the region file format proposal attached to CAS-2285 (https://bugs.nrao.edu/browse/CAS-2285)

Definition at line 50 of file RegionTextList.h.


Constructor & Destructor Documentation

casa::RegionTextList::RegionTextList ( const Bool  deletePointersOnDestruct = True)

create an empty list which can be appended to.

This constructor is used for constructing an annotation list on the fly, possibly to be written to a file when complete. Do not use this constructor if you want to determine the final composite region.

casa::RegionTextList::RegionTextList ( const CoordinateSystem csys,
const IPosition  shape,
const Bool  deletePointersOnDestruct = True 
)

create an empty list which can be appended to.

This constructor is used for constructing an annotation list on the fly, possibly to be written to a file when complete. It can be used to determine the composite region as well but it is the caller's responsibility to ensure the regions added to this object are constructed in a consistent manner (eg using the same coordinate system). shape is the image shape and is only used if the first region is a difference; in that case, the all pixels in entire shape are set to good initially.

casa::RegionTextList::RegionTextList ( const String filename,
const CoordinateSystem csys,
const IPosition  shape,
const Int  requireAtLeastThisVersion = RegionTextParser::CURRENT_VERSION,
const Bool  deletePointersOnDestruct = True 
)

create a list by reading it from a file.

An exception is thrown if the file is not in the correct format or does not exist. The coordinate system is used for setting defaults and reference frames to be used. shape is the image shape and is only used if the first region is a difference; in that case, the all pixels in entire shape are set to good initially.

casa::RegionTextList::RegionTextList ( const CoordinateSystem csys,
const String text,
const IPosition  shape,
const Bool  deletePointersOnDestruct = True 
)

create a list by reading it from a text string.

An exception is thrown if the text is not in the correct format. The coordinate system is used for setting defaults and reference frames to be used. shape is the image shape and is only used if the first region is a difference; in that case, the all pixels in entire shape are set to good initially.

         


Member Function Documentation

add a line to the end of the list

get all lines in the list

Definition at line 116 of file RegionTextList.h.

References _lines.

get the composite region.

get the line at the specified index

number of lines in the list

ostream& casa::RegionTextList::print ( ostream &  os) const

Referenced by casa::operator<<().

get the composite region as a region record.


Member Data Documentation

Definition at line 134 of file RegionTextList.h.

Definition at line 132 of file RegionTextList.h.

Definition at line 130 of file RegionTextList.h.

Definition at line 129 of file RegionTextList.h.

Referenced by getLines().

Definition at line 131 of file RegionTextList.h.

Definition at line 133 of file RegionTextList.h.


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