casacore
Public Member Functions | List of all members
casacore::RFWriter Class Referenceabstract

Abstract superclass for any class that writes Regions to a region file format. More...

#include <RFReaderWriter.h>

Public Member Functions

 RFWriter ()
 Constructor. More...
 
virtual ~RFWriter ()
 Destructor. More...
 
virtual void setOptions (const Record *options)
 Sets the optional to the values. More...
 
virtual bool write (const Record &region) const =0
 Write the given regions to the filename set with setFile and returns true if no errors were reported, false otherwise. More...
 
virtual bool writeFile (const String &filename, const Record &regions)
 Calls setFile then write. More...
 
- Public Member Functions inherited from casacore::RFReaderWriter
 RFReaderWriter ()
 Constructor. More...
 
virtual ~RFReaderWriter ()
 Destructor. More...
 
virtual void setFile (const String &filename)
 Sets the file to be read/written to the given. More...
 
virtual void setName (const String &regionName)
 Sets the region name associated withe the file to be read or written. More...
 
virtual const RFErrorlastError () const
 Returns the last error set during read/write. More...
 

Additional Inherited Members

- Public Types inherited from casacore::RFReaderWriter
enum  SupportedType {
  AIPS_BOX ,
  DS9 ,
  CASA_XML ,
  AIPS_IO
}
 An enum of all known subclasses/formats supported. More...
 
- Static Public Member Functions inherited from casacore::RFReaderWriter
static SupportedType supportedTypes (String type)
 Converts between enum and String for SupportedType. More...
 
static String supportedTypes (SupportedType type)
 
static String extensionForType (SupportedType type)
 Returns the file extension for the given SupportedType. More...
 
static Vector< SupportedTypesupportedTypes ()
 Returns all known SupportedTypes. More...
 
static Vector< StringsupportedTypeStrings ()
 
static RFReaderreaderForType (SupportedType type)
 Returns an appropriate child RFReader class for the given SupportedType, or NULL for an error (shouldn't happen). More...
 
static RFWriterwriterForType (SupportedType type)
 Returns an new appropriate child RfWriter class for the given SupportedType, or NULL for an error (shouldn't happen). More...
 
static RecordoptionsWidgetForType (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 casacore::RFReaderWriter
virtual void setError (const String &error, bool fatal=false) const
 Convenience method for setting last error during read/write. More...
 
- Protected Attributes inherited from casacore::RFReaderWriter
StringpFilename_p
 Filename to be read/written. More...
 
StringpRegionName_p
 Name to be assigned to the region. More...
 
RFError lastError_p
 Last error seen during read/write. More...
 
Record options_p
 Record containg plotting options for the regions. More...
 

Detailed Description

Abstract superclass for any class that writes Regions to a region file format.

Intended use:

Public interface

Synopsis

Provide a well defined set of operations that all region file writers must contain regardless of the file format of the file being saved..

Note that some file formats allow for plotting options to be stored with the region information. The setOptions method allows the user to supply this information.

Example

Definition at line 283 of file RFReaderWriter.h.

Constructor & Destructor Documentation

◆ RFWriter()

casacore::RFWriter::RFWriter ( )
inline

Constructor.

Definition at line 287 of file RFReaderWriter.h.

◆ ~RFWriter()

virtual casacore::RFWriter::~RFWriter ( )
inlinevirtual

Destructor.

Definition at line 290 of file RFReaderWriter.h.

Member Function Documentation

◆ setOptions()

virtual void casacore::RFWriter::setOptions ( const Record options)
inlinevirtual

Sets the optional to the values.

These values are related to the drawing of regions and not defining the regions themselves. For example, the colour to draw the region as.

Reimplemented in casacore::AipsIOReaderWriter.

Definition at line 295 of file RFReaderWriter.h.

References casacore::Record::defineRecord(), and casacore::RFReaderWriter::options_p.

◆ write()

virtual bool casacore::RFWriter::write ( const Record region) const
pure virtual

Write the given regions to the filename set with setFile and returns true if no errors were reported, false otherwise.

If false is returned, the details can be found using lastError().

Implemented in casacore::AipsIOReaderWriter.

Referenced by writeFile().

◆ writeFile()

virtual bool casacore::RFWriter::writeFile ( const String filename,
const Record regions 
)
inlinevirtual

Calls setFile then write.

Definition at line 306 of file RFReaderWriter.h.

References casacore::RFReaderWriter::setFile(), and write().


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