casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casa::DS9FileReader Class Reference

Implementation of RSFileReader for DS9 regions. More...

#include <DS9FileReader.h>

Inheritance diagram for casa::DS9FileReader:
casa::RSFileReader casa::RSFileReaderWriter

Public Member Functions

 DS9FileReader ()
 Constructor. More...
 
 ~DS9FileReader ()
 Destructor. More...
 
bool read (std::vector< RegionShape * > &shapes)
 RSFileReader methods //. More...
 
- Public Member Functions inherited from casa::RSFileReader
 RSFileReader ()
 Constructor. More...
 
virtual ~RSFileReader ()
 Destructor. More...
 
virtual bool readFile (const casacore::String &file, std::vector< RegionShape * > &shapes)
 Calls setFile() then read(). More...
 
- Public Member Functions inherited from casa::RSFileReaderWriter
 RSFileReaderWriter ()
 Non-Static Members //. More...
 
virtual ~RSFileReaderWriter ()
 Destructor. More...
 
virtual void setFile (const casacore::String &filename)
 Sets the file to be read/written to the given. More...
 
virtual const RFErrorlastError () const
 Returns the last error set during read/write. More...
 

Private Member Functions

bool processLine (const QString &line, stringstream &invalid)
 Processes the given line and returns whether an error occurred or not. More...
 
bool processRegion (QStringList &line, QString &comment, stringstream &invalid, bool include=true)
 Processes the given region and returns whether an error occurred or not. More...
 
bool processCoordSys (QString &line, stringstream &invalid)
 Processes the given coordinate system and returns whether an error occurred or not. More...
 
bool processGlobal (QString &line, stringstream &invalid)
 Processes the given global line and returns whether an error occurred or not. More...
 
bool processComment (DS9Region &region, QString &comment, stringstream &invalid)
 Processes the given comment into properties for the given region, and returns whether an error occurred or not. More...
 
bool readPointType (QString &comment, DS9::RegionType &type)
 For "point" regions. More...
 
bool readProperties (casacore::Record &record, QString &line)
 Reads properties in the given line into the given record. More...
 

Private Attributes

pair< DS9::CoordinateSystem, bool > m_nextSystem
 Whether a coordinate system has been set in the file, and what it is. More...
 
std::vector< DS9Regionm_regions
 Read regions. More...
 
casacore::Record m_globals
 Current read global properties. More...
 

Additional Inherited Members

- Public Types inherited from casa::RSFileReaderWriter
enum  SupportedType {
  DS9,
  CASA_XML
}
 Public Static Methods //. More...
 
- Static Public Member Functions inherited from casa::RSFileReaderWriter
static SupportedType supportedType (casacore::String type)
 Converts between enum and casacore::String for SupportedType. More...
 
static casacore::String supportedType (SupportedType type)
 
static casacore::String extensionForType (SupportedType type)
 Returns the file extension for the given SupportedType. More...
 
static std::vector< SupportedTypesupportedTypes ()
 Returns all known SupportedTypes. More...
 
static std::vector
< casacore::String
supportedTypesStrings ()
 
static RSFileReaderreaderForType (SupportedType type)
 Returns an appropriate child RegionFileReader class for the given SupportedType, or NULL for an error (shouldn't happen). More...
 
static RSFileWriterwriterForType (SupportedType type)
 Returns an new appropriate child RegionFileWriter class for the given SupportedType, or NULL for an error (shouldn't happen). More...
 
static QWidget * optionsWidgetForType (SupportedType type)
 Returns an new appropriate options widget for the given SupportedType, or NULL for an error (shouldn't happen). More...
 
- Protected Member Functions inherited from casa::RSFileReaderWriter
virtual void setError (const casacore::String &error, bool isFatal=false) const
 Convenience method for setting last error during read/write. More...
 
- Protected Attributes inherited from casa::RSFileReaderWriter
casacore::String m_filename
 Filename to be read/written. More...
 
RFError m_lastError
 Last error seen during read/write. More...
 

Detailed Description

Implementation of RSFileReader for DS9 regions.

Definition at line 649 of file DS9FileReader.h.

Constructor & Destructor Documentation

casa::DS9FileReader::DS9FileReader ( )

Constructor.

casa::DS9FileReader::~DS9FileReader ( )

Destructor.

Member Function Documentation

bool casa::DS9FileReader::processComment ( DS9Region region,
QString &  comment,
stringstream &  invalid 
)
private

Processes the given comment into properties for the given region, and returns whether an error occurred or not.

If an error occurred, the details are appended to invalid.

bool casa::DS9FileReader::processCoordSys ( QString &  line,
stringstream &  invalid 
)
private

Processes the given coordinate system and returns whether an error occurred or not.

If an error occurred, the details are appended to invalid.

bool casa::DS9FileReader::processGlobal ( QString &  line,
stringstream &  invalid 
)
private

Processes the given global line and returns whether an error occurred or not.

If an error occurred, the details are appended to invalid.

bool casa::DS9FileReader::processLine ( const QString &  line,
stringstream &  invalid 
)
private

Processes the given line and returns whether an error occurred or not.

If an error occurred, the details are appended to invalid.

bool casa::DS9FileReader::processRegion ( QStringList &  line,
QString &  comment,
stringstream &  invalid,
bool  include = true 
)
private

Processes the given region and returns whether an error occurred or not.

If an error occurred, the details are appended to invalid. line should contain the comma-, parentheses-, or whitespace-separated text before the comment symbol, while "comment" should contain all text after the comment symbol. The include flag is used to set the include property.

bool casa::DS9FileReader::read ( std::vector< RegionShape * > &  shapes)
virtual

RSFileReader methods //.

Implements RSFileReader::read.

Implements casa::RSFileReader.

bool casa::DS9FileReader::readPointType ( QString &  comment,
DS9::RegionType type 
)
private

For "point" regions.

Parses the given comment for a point=type property and places the correct type into "type". Returns whether the operation succeeded or not.

bool casa::DS9FileReader::readProperties ( casacore::Record record,
QString &  line 
)
private

Reads properties in the given line into the given record.

Member Data Documentation

casacore::Record casa::DS9FileReader::m_globals
private

Current read global properties.

Definition at line 671 of file DS9FileReader.h.

pair<DS9::CoordinateSystem, bool> casa::DS9FileReader::m_nextSystem
private

Whether a coordinate system has been set in the file, and what it is.

Definition at line 665 of file DS9FileReader.h.

std::vector<DS9Region> casa::DS9FileReader::m_regions
private

Read regions.

Definition at line 668 of file DS9FileReader.h.


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