casa
$Rev:20696$
|
An ordered list of annotations and comments representing an ascii region file. <author>Dave Mehringer</author> More...
#include <RegionTextList.h>
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 |
WCRegion * | getRegion () 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 |
An ordered list of annotations and comments representing an ascii region file. <author>Dave Mehringer</author>
Public interface
An order list of annotations and comments representing an ascii region file.
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.
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.
void casa::RegionTextList::addLine | ( | const AsciiAnnotationFileLine & | line | ) |
add a line to the end of the list
const Vector<AsciiAnnotationFileLine>& casa::RegionTextList::getLines | ( | ) | const [inline] |
WCRegion* casa::RegionTextList::getRegion | ( | ) | const |
get the composite region.
AsciiAnnotationFileLine casa::RegionTextList::lineAt | ( | const uInt | i | ) | const |
get the line at the specified index
uInt casa::RegionTextList::nLines | ( | ) | const |
number of lines in the list
ostream& casa::RegionTextList::print | ( | ostream & | os | ) | const |
Referenced by casa::operator<<().
Record casa::RegionTextList::regionAsRecord | ( | ) | const |
get the composite region as a region record.
Bool casa::RegionTextList::_canGetRegion [private] |
Definition at line 134 of file RegionTextList.h.
CoordinateSystem casa::RegionTextList::_csys [private] |
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().
PtrBlock<WCRegion *> casa::RegionTextList::_regions [private] |
Definition at line 131 of file RegionTextList.h.
IPosition casa::RegionTextList::_shape [private] |
Definition at line 133 of file RegionTextList.h.