casa
5.7.0-16
|
#include <QTextStream>
#include <display/RegionShapes/QtDS9WriteOptions.ui.h>
#include <display/RegionShapes/RSFileReaderWriter.h>
#include <display/RegionShapes/DS9FileReader.h>
#include <casa/namespace.h>
Go to the source code of this file.
Classes | |
class | casa::DS9FileWriter |
Implementation of RegionFileWriter for writing to DS9 files. More... | |
class | QtDS9RFWOptions |
Widget used for entering options specific to the DS9 format. More... | |
Namespaces | |
casa | |
-*- mode: c++ -*- | |
Functions | |
static DS9::CoordinateSystem | coordinateSystem (const casacore::String &system) |
Converts a coordinate system constant (as used in DS9RFWOptions) into its DS9::CoordinateSystem equivalent. More... | |
static bool | isValidDS9System (casacore::MDirection::Types worldSys) |
Returns true if the given CASA world system is supported by DS9. More... | |
DS9FileWriter () | |
Constructor. More... | |
~DS9FileWriter () | |
Destructor. More... | |
QWidget * | optionsWidget () const |
Implements RegionFileWriter::optionsWidget. More... | |
void | setOptions (const QWidget *widget) |
Implements RegionFileWriter::setOptions. More... | |
bool | write (const std::vector< RegionShape * > &shapes) const |
Implements RegionFileWriter::write. More... | |
bool | writeHeader (QTextStream &) const |
bool | writeFooter (QTextStream &) const |
bool | write (QTextStream &, AnnRegion *) const |
void | resetOptions () const |
Rests custom options to defaults. More... | |
bool | writeHeader (QTextStream &file, stringstream &errors) const |
Writes header comments to the file. More... | |
bool | writeGlobals (QTextStream &file, stringstream &errors) const |
Writes globals (default DS9Region properties) and, if applicable, the overriding coordinate system. More... | |
bool | writeShape (QTextStream &file, stringstream &errors, const RegionShape *shape, bool isComposite=false) const |
Writes a single shape to the file. More... | |
static std::vector < casacore::String > | globalProperties () |
Returns list of all properties to be used in the globals. More... | |
static bool | regionType (const RegionShape *shape, DS9::RegionType &type, stringstream &errors) |
Finds the DS9 region type for the given shape. More... | |
static bool | regionType (const AnnRegion *shape, DS9::RegionType &type, stringstream &errors) |
static std::vector< RSMarker * > | convertMarker (const RSMarker *marker, bool &conversionWasNeeded) |
Converts the given RSMarker into one or more DS9-friendly RSMarkers. More... | |
static QString | convertValue (double value, const casacore::String &toUnits, int precision) |
Converts the given value to a QString version using the given units. More... | |
static casacore::String | sgUnit (const casacore::String &posUnit, int index, const casacore::String &coordSys) |
Converts the given position unit, if applicable, from sexagesimal to either HMS or DMS. More... | |
Variables | |
static const casacore::String | casa::CSYS_INDIVIDUAL |
static const casacore::String | casa::CSYS_IMAGE |
static const casacore::String | casa::CSYS_B1950 |
static const casacore::String | casa::CSYS_J2000 |
static const casacore::String | casa::CSYS_GALACTIC |
static const casacore::String | casa::CSYS_ECLIPTIC |
static const casacore::String | casa::UNIT_IPIXELS |
static const casacore::String | casa::UNIT_DEGREES |
static const casacore::String | casa::UNIT_RADIANS |
static const casacore::String | casa::PUNIT_SEXAGESIMAL |
static const casacore::String | casa::PUNIT_HMS |
static const casacore::String | casa::PUNIT_DMS |
static const casacore::String | casa::SUNIT_ARCSEC |
static const casacore::String | casa::SUNIT_ARCMIN |
static const casacore::String | casa::DEFAULT_COMMENTS |
bool | m_custCoordSys |
Custom options. More... | |
bool | m_pixelCoordSys |
casacore::String | m_coordSys |
casacore::String | m_posUnits |
casacore::String | m_sizeUnits |
int | m_precision |
casacore::String | m_comments |
~DS9FileWriter | ( | ) |
Destructor.
|
staticprivate |
Converts the given RSMarker into one or more DS9-friendly RSMarkers.
If marker is NULL or the markers is empty then an empty vector is returned. Note that the caller is responsible for deleting the new markers.
|
staticprivate |
Converts the given value to a QString version using the given units.
The value is assumed to be in units RegionShape::UNIT. toUnits should be one of: UNIT_IPIXELS, UNIT_DEGREES, UNIT_RADIANS, PUNIT_HMS, PUNIT_DMS, SUNIT_ARCSEC, SUNIT_ARCMIN, or "". If toUnits is blank, no converting or adding a unit is done.
|
static |
Converts a coordinate system constant (as used in DS9RFWOptions) into its DS9::CoordinateSystem equivalent.
Definition at line 67 of file DS9FileWriter.qo.h.
References casa::CSYS_B1950, casa::CSYS_ECLIPTIC, casa::CSYS_GALACTIC, casa::CSYS_IMAGE, casa::CSYS_J2000, casa::DS9::defaultCoordinateSystem(), casa::DS9::Ecliptic, casa::DS9::FK4, casa::DS9::FK5, casa::DS9::Galactic, and casa::DS9::Image.
DS9FileWriter | ( | ) |
Constructor.
|
staticprivate |
Returns list of all properties to be used in the globals.
Definition at line 134 of file DS9FileWriter.qo.h.
References casa::DS9Region::PROP_COLOR, casa::DS9Region::PROP_DASH, casa::DS9Region::PROP_DASHLIST, casa::DS9Region::PROP_DELETE, casa::DS9Region::PROP_EDIT, casa::DS9Region::PROP_FIXED, casa::DS9Region::PROP_FONT, casa::DS9Region::PROP_HIGHLITE, casa::DS9Region::PROP_INCLUDE, casa::DS9Region::PROP_MOVE, casa::DS9Region::PROP_ROTATE, casa::DS9Region::PROP_SELECT, casa::DS9Region::PROP_SOURCE, and casa::DS9Region::PROP_WIDTH.
|
static |
Returns true if the given CASA world system is supported by DS9.
Definition at line 78 of file DS9FileWriter.qo.h.
References casacore::MDirection::B1950, casacore::MDirection::ECLIPTIC, casacore::MDirection::GALACTIC, and casacore::MDirection::J2000.
QWidget* optionsWidget | ( | ) | const |
Implements RegionFileWriter::optionsWidget.
|
staticprivate |
Finds the DS9 region type for the given shape.
Returns true if no errors were reported, false otherwise. If errors occurred they are logged on the given stringstream. Note that RSMarkers are expected to already be converted to a DS9-friendly format. If this method returns false, the given shape should NOT be written.
|
staticprivate |
|
private |
Rests custom options to defaults.
void setOptions | ( | const QWidget * | widget | ) |
Implements RegionFileWriter::setOptions.
|
staticprivate |
Converts the given position unit, if applicable, from sexagesimal to either HMS or DMS.
Does nothing if the position unit is not sexagesimal.
Definition at line 183 of file DS9FileWriter.qo.h.
References casa::CSYS_GALACTIC, casa::PUNIT_DMS, casa::PUNIT_HMS, and casa::PUNIT_SEXAGESIMAL.
bool write | ( | const std::vector< RegionShape * > & | shapes | ) | const |
Implements RegionFileWriter::write.
Referenced by option::PrintUsageImplementation::LineWrapper::flush(), option::PrintUsageImplementation::indent(), option::PrintUsageImplementation::printUsage(), option::printUsage(), option::PrintUsageImplementation::LineWrapper::write_one_line(), and casa::RSFileWriter::writeFile().
bool write | ( | QTextStream & | , |
AnnRegion * | |||
) | const |
bool writeFooter | ( | QTextStream & | ) | const |
|
private |
Writes globals (default DS9Region properties) and, if applicable, the overriding coordinate system.
bool writeHeader | ( | QTextStream & | ) | const |
|
private |
Writes header comments to the file.
|
private |
Writes a single shape to the file.
casacore::String m_comments |
Definition at line 114 of file DS9FileWriter.qo.h.
casacore::String m_coordSys |
Definition at line 111 of file DS9FileWriter.qo.h.
bool m_custCoordSys |
Custom options.
Definition at line 109 of file DS9FileWriter.qo.h.
bool m_pixelCoordSys |
Definition at line 110 of file DS9FileWriter.qo.h.
casacore::String m_posUnits |
Definition at line 112 of file DS9FileWriter.qo.h.
int m_precision |
Definition at line 113 of file DS9FileWriter.qo.h.
casacore::String m_sizeUnits |
Definition at line 112 of file DS9FileWriter.qo.h.