26 #ifndef ANNOTATIONS_ANNOTATIONBASE_H
27 #define ANNOTATIONS_ANNOTATIONBASE_H
59 using RGB = std::vector<float>;
256 virtual std::ostream&
print(std::ostream &os)
const = 0;
265 static std::ostream&
print(
266 std::ostream& os,
const std::map<Keyword, casacore::String>& params
270 static std::ostream&
print(
275 static std::ostream&
print(
279 static std::ostream&
print(
451 return annotation.
print(os);
462 inline std::ostream &operator<<(std::ostream& os, const std::map<AnnotationBase::Keyword, casacore::String>& x) {
static const casacore::String DEFAULT_LABEL
A Vector of integers, for indexing into Array<T> objects.
A Measure: astronomical direction.
Base class for annotations.
static void _checkMixed(const casacore::String &origin, const Direction &dirs)
static casacore::String _toArcsec(const casacore::Quantity &angle)
convert angle to arcsec, precision 0.1 mas
casacore::uInt _symbolsize
static const LineStyle DEFAULT_LINESTYLE
casacore::Vector< casacore::Stokes::StokesTypes > getStokes() const
Get the stokes for which the selection applies.
static casacore::Bool _doneUnitInit
casacore::String getFont() const
virtual ~AnnotationBase()
static Type typeFromString(const casacore::String &type)
Given a string, return the corresponding annotation type or throw an error if the string does not cor...
casacore::uInt getLineWidth() const
ostream & operator<<(ostream &os, const PageHeaderCache &cache)
static casacore::String _toDeg(const casacore::Quantity &angle)
convert angle to degrees, precision 0.1 mas
void setFontStyle(const FontStyle &fontstyle)
static const std::vector< casacore::Int > DEFAULT_LABELOFF
void setLabel(const casacore::String &label)
void setSymbolSize(const casacore::uInt symbolsize)
static const casacore::Bool DEFAULT_USETEX
virtual Type type()
Return the type enum.
static casacore::String _printFreq(const casacore::Quantity &freq)
casacore::String getLabelColorString() const
returns the color name if it is recognized or its rgb hex string
void _testConvertToPixel() const
static const RGB DEFAULT_LABELCOLOR
casacore::Quantity _restFreq
casacore::MDoppler::Types _dopplerType
static const RGB DEFAULT_COLOR
RGB getColor() const
get the color associated with this object
casacore::MDirection::Types _directionRefFrame
static const casacore::uInt DEFAULT_SYMBOLSIZE
casacore::String _printFreqRange() const
casacore::Bool _printGlobals
static const casacore::uInt DEFAULT_SYMBOLTHICKNESS
void setFontSize(const casacore::uInt fontsize)
virtual casacore::Bool isRegion() const
is the object a region?
RGB getLabelColor() const
get the color associated with this object's label
void setLabelPosition(const casacore::String &position)
position must have a value in top, bottom, left, or right.
static std::map< casacore::String, Type > _typeMap
static std::map< string, RGB > _colors
casacore::Bool isUseTex() const
casacore::CoordinateSystem _csys
static const casacore::String DEFAULT_FONT
virtual casacore::Bool setFrequencyLimits(const casacore::Quantity &beginFreq, const casacore::Quantity &endFreq, const casacore::String &freqRefFrame, const casacore::String &dopplerString, const casacore::Quantity &restfreq)
if freqRefFrame=="" -> use the reference frame of the coordinate system if dopplerString=="" -> use t...
Types
Types of known MDirections Warning: The order defines the order in the translation matrix FromTo in ...
static RGB _colorStringToRGB(const casacore::String &s)
Fast Vector classes with fixed (templated) length.
static std::list< std::string > _colorNames
std::vector< casacore::Int > getLabelOffset() const
static const casacore::String _class
std::vector< casacore::Int > _labelOff
casacore::uInt getSymbolThickness() const
static std::list< std::string > colorChoices()
Get a list of the user-friendly color names supported.
virtual std::ostream & print(std::ostream &os) const =0
std::map< Keyword, casacore::String > _params
static const casacore::uInt DEFAULT_LINEWIDTH
casacore::Vector< casacore::Stokes::StokesTypes > _stokes
void _setParam(const Keyword k, const casacore::String &s)
casacore::uInt getSymbolSize() const
Regular expression class.
static void _initColors()
static void _initTypeMap()
void setGlobals(const casacore::Vector< Keyword > &globalKeys)
These parameters are included at the global scope.
void setLineWidth(const casacore::uInt linewidth)
static std::map< casacore::String, LineStyle > _lineStyleMap
void _checkAndConvertFrequencies()
casacore::uInt _linewidth
casacore::String _labelPos
casacore::uInt _symbolthickness
casacore::String getColorString() const
returns the color name if it is recognized or its rgb hex string
bool Bool
Define the standard types used by Casacore.
void setLabelOffset(const std::vector< casacore::Int > &offset)
offset must have two elements
static const casacore::Regex rgbHexRegex
static const casacore::uInt DEFAULT_FONTSIZE
AnnotationBase & operator=(const AnnotationBase &other)
assignment operator
LineStyle getLineStyle() const
Types
Types of known MDopplers Warning: The order defines the order in the translation matrix FromTo in th...
void setUseTex(const casacore::Bool usetex)
static casacore::Bool _doneColorInit
casacore::IPosition _directionAxes
static casacore::String typeToString(const Type type)
void _checkAndConvertDirections(const casacore::String &origin, const Direction &dirs)
virtual Origin origin() const =0
ABSTRACT METHODS //.
static FontStyle fontStyleFromString(const casacore::String &fs)
casacore::uInt getFontSize() const
casacore::String getLabel() const
void setSymbolThickness(const casacore::uInt symbolthickness)
casacore::Quantity _beginFreq
casacore::Vector< casacore::MDirection > _convertedDirections
void setLabelColor(const casacore::String &color)
color must either be a recognized color name or a valid rgb hex string, else an expection is thrown ...
void setColor(const casacore::String &color)
color must either be a recognized color name or a valid rgb hex string, else an expection is thrown ...
static casacore::String fontStyleToString(const FontStyle fs)
casacore::MFrequency::Types _freqRefFrame
virtual void _printPairs(std::ostream &os) const
static casacore::String colorToString(const RGB &color)
const casacore::IPosition & _getDirectionAxes() const
Base class for all Casacore library errors.
const casacore::Vector< casacore::MDirection > & getConvertedDirections() const
same as getDirections, only returns proper MDirections
casacore::String getLabelPosition() const
returns one of top, bottom, left, or right.
void setLineStyle(const LineStyle lineStyle)
static const FontStyle DEFAULT_FONTSTYLE
casacore::Quantity _endFreq
virtual casacore::Bool isAnnotationOnly() const
is the object only an annotation? Can only be false if the object is a region
std::map< Keyword, casacore::Bool > _globals
static casacore::Bool _isRGB(const RGB &rgb)
static std::map< RGB, string > _rgbNameMap
Just need a identifiable exception class for exception handling.
casacore::String _printDirection(const casacore::Quantity &longitude, const casacore::Quantity &latitude) const
direction to string, precision of 0.1 mas ra and dec in sexigesimal format, non-equatorial coords in ...
FontStyle getFontStyle() const
AnnotationBase(const Type type, const casacore::String &dirRefFrameString, const casacore::CoordinateSystem &csys, const casacore::Quantity &beginFreq, const casacore::Quantity &endFreq, const casacore::String &freqRefFrame, const casacore::String &dopplerString, const casacore::Quantity &restfreq, const casacore::Vector< casacore::Stokes::StokesTypes > &stokes)
if freqRefFrame or dopplerString are empty, the values from the spectral coordinate of csys will be u...
static casacore::String _printPixel(const casacore::Double &d)
return a string representing a pixel value, precision 1.
String: the storage and methods of handling collections of characters.
static casacore::String lineStyleToString(const LineStyle linestyle)
void setFont(const casacore::String &font)
Direction getDirections() const
DEPRECATED Please use getConvertedDirections() the pair elements have longitude as the first member a...
casacore::MDirection::Types _getDirectionRefFrame() const
Types
Types of known MFrequencies Warning: The order defines the order in the translation matrix FromTo in...
static void unitInit()
set "pix" as valid unit.
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the color(i.e.,"000000"for black) and
casacore::Vector< casacore::MFrequency > getFrequencyLimits() const
get the frequency limits converted to the spectral frame of the coordinate system of this object...
casacore::Vector< casacore::MFrequency > _convertedFreqLimits
static LineStyle lineStyleFromString(const casacore::String &ls)
casacore::MDirection _directionFromQuantities(const casacore::Quantity &q0, const casacore::Quantity &q1)
Interconvert pixel and world coordinates.
static casacore::String keywordToString(const Keyword key)
const casacore::CoordinateSystem & getCsys() const
get the coordinate system associated with this object.
static const casacore::String DEFAULT_LABELPOS
WorldToPixelConversionError(casacore::String msg)
#define casacore
<X11/Intrinsic.h> #defines true, false, casacore::Bool, and String.