casa
5.7.0-16
|
This class represents an annotation for rectangular (in position coordinates) region specified in an ascii region file as proposed in CAS-2285 <author>Dave Mehringer</author> More...
#include <AnnRectBox.h>
Public Member Functions | |
AnnRectBox (const casacore::Quantity &blcx, const casacore::Quantity &blcy, const casacore::Quantity &trcx, const casacore::Quantity &trcy, const casacore::String &dirRefFrameString, const casacore::CoordinateSystem &csys, const casacore::IPosition &imShape, const casacore::Quantity &beginFreq, const casacore::Quantity &endFreq, const casacore::String &freqRefFrameString, const casacore::String &dopplerString, const casacore::Quantity &restfreq, const casacore::Vector< casacore::Stokes::StokesTypes > stokes, const casacore::Bool annotationOnly, const casacore::Bool requireImageRegion=true) | |
AnnRectBox (const casacore::Quantity &blcx, const casacore::Quantity &blcy, const casacore::Quantity &trcx, const casacore::Quantity &trcy, const casacore::CoordinateSystem &csys, const casacore::IPosition &imShape, const casacore::Vector< casacore::Stokes::StokesTypes > &stokes, const casacore::Bool requireImageRegion=true) | |
Simplified constructor. More... | |
AnnRectBox & | operator= (const AnnRectBox &other) |
implicit copy constructor and destructor are fine More... | |
std::ostream & | print (std::ostream &os) const |
get the blc and trc direction coords for the box. More... | |
Public Member Functions inherited from casa::AnnPolygon | |
AnnPolygon (const casacore::Vector< casacore::Quantity > &xPositions, const casacore::Vector< casacore::Quantity > &yPositions, const casacore::String &dirRefFrameString, const casacore::CoordinateSystem &csys, const casacore::IPosition &imShape, const casacore::Quantity &beginFreq, const casacore::Quantity &endFreq, const casacore::String &freqRefFrameString, const casacore::String &dopplerString, const casacore::Quantity &restfreq, const casacore::Vector< casacore::Stokes::StokesTypes > stokes, const casacore::Bool annotationOnly, const casacore::Bool requireImageRegion=true) | |
AnnPolygon (const casacore::Vector< casacore::Quantity > &xPositions, const casacore::Vector< casacore::Quantity > &yPositions, const casacore::CoordinateSystem &csys, const casacore::IPosition &imShape, const casacore::Vector< casacore::Stokes::StokesTypes > &stokes, const casacore::Bool requireImageRegion=true) | |
Simplified constructor. More... | |
AnnPolygon & | operator= (const AnnPolygon &other) |
implicit copy constructor and destructor are fine More... | |
casacore::Vector < casacore::MDirection > | getCorners () const |
get the vertices converted to the coordinate system used at construction. More... | |
void | worldVertices (std::vector< casacore::Quantity > &x, std::vector< casacore::Quantity > &y) const |
get the world coordinates of the polygon vertices More... | |
void | pixelVertices (std::vector< casacore::Double > &x, std::vector< casacore::Double > &y) const |
get the pixel coordinates of the polygon vertices More... | |
Public Member Functions inherited from casa::AnnRegion | |
virtual | ~AnnRegion () |
void | setAnnotationOnly (const casacore::Bool isAnnotationOnly) |
casacore::Bool | isAnnotationOnly () const |
is this region an annotation only? ie just for graphical rendering? More... | |
virtual casacore::TableRecord | asRecord () const |
virtual casacore::ImageRegion | asImageRegion () const |
virtual casacore::CountedPtr < const casacore::WCRegion > | getRegion () const |
this version is deprecated, use the version that returns std::shared_ptr instead More... | |
virtual std::shared_ptr< const casacore::WCRegion > | getRegion2 () const |
virtual casacore::Bool | isRegion () const |
returns true unless overridden. More... | |
void | setDifference (const casacore::Bool difference) |
casacore::Bool | isDifference () const |
std::vector< casacore::Double > | getSpectralPixelRange () const |
get the pixel range included in the spectral selection. More... | |
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 the doppler system associated with the coordinate system if restfreq=casacore::Quantity(0, "Hz") -> use the rest frequency associated with the coordinate system Tacitly does nothing if the coordinate system has no spectral axis. More... | |
Public Member Functions inherited from casa::AnnotationBase | |
virtual | ~AnnotationBase () |
Type | getType () const |
void | setLabel (const casacore::String &label) |
casacore::String | getLabel () const |
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 More... | |
void | setColor (const RGB &color) |
color must have three elements all with values between 0 and 255 inclusive or an exception is thrown. More... | |
casacore::String | getColorString () const |
returns the color name if it is recognized or its rgb hex string More... | |
RGB | getColor () const |
get the color associated with this object More... | |
void | setLineStyle (const LineStyle lineStyle) |
LineStyle | getLineStyle () const |
void | setLineWidth (const casacore::uInt linewidth) |
casacore::uInt | getLineWidth () const |
void | setSymbolSize (const casacore::uInt symbolsize) |
casacore::uInt | getSymbolSize () const |
void | setSymbolThickness (const casacore::uInt symbolthickness) |
casacore::uInt | getSymbolThickness () const |
void | setFont (const casacore::String &font) |
casacore::String | getFont () const |
void | setFontSize (const casacore::uInt fontsize) |
casacore::uInt | getFontSize () const |
void | setFontStyle (const FontStyle &fontstyle) |
FontStyle | getFontStyle () const |
void | setUseTex (const casacore::Bool usetex) |
casacore::Bool | isUseTex () const |
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 More... | |
void | setLabelColor (const RGB &color) |
color must have three elements all with values between 0 and 255 inclusive or an exception is thrown. More... | |
casacore::String | getLabelColorString () const |
returns the color name if it is recognized or its rgb hex string More... | |
RGB | getLabelColor () const |
get the color associated with this object's label More... | |
casacore::String | getLabelPosition () const |
returns one of top, bottom, left, or right. More... | |
void | setLabelPosition (const casacore::String &position) |
position must have a value in top, bottom, left, or right. More... | |
void | setLabelOffset (const std::vector< casacore::Int > &offset) |
offset must have two elements More... | |
std::vector< casacore::Int > | getLabelOffset () const |
void | setGlobals (const casacore::Vector< Keyword > &globalKeys) |
These parameters are included at the global scope. More... | |
const casacore::CoordinateSystem & | getCsys () const |
get the coordinate system associated with this object. More... | |
Direction | getDirections () const |
DEPRECATED Please use getConvertedDirections() the pair elements have longitude as the first member and latitude as the second. More... | |
casacore::Vector < casacore::MFrequency > | getFrequencyLimits () const |
get the frequency limits converted to the spectral frame of the coordinate system of this object. More... | |
casacore::Vector < casacore::Stokes::StokesTypes > | getStokes () const |
Get the stokes for which the selection applies. More... | |
const casacore::Vector < casacore::MDirection > & | getConvertedDirections () const |
same as getDirections, only returns proper MDirections More... | |
Private Attributes | |
AnnotationBase::Direction | _inputCorners |
Additional Inherited Members | |
Public Types inherited from casa::AnnotationBase | |
enum | Type { LINE, VECTOR, TEXT, SYMBOL, RECT_BOX, CENTER_BOX, ROTATED_BOX, POLYGON, POLYLINE, CIRCLE, ANNULUS, ELLIPSE } |
enum | Keyword { COORD, RANGE, FRAME, CORR, VELTYPE, RESTFREQ, LINEWIDTH, LINESTYLE, SYMSIZE, SYMTHICK, COLOR, FONT, FONTSIZE, FONTSTYLE, USETEX, LABEL, LABELCOLOR, LABELPOS, LABELOFF, UNKNOWN_KEYWORD, N_KEYS } |
enum | LineStyle { SOLID, DASHED, DOT_DASHED, DOTTED } |
enum | FontStyle { NORMAL, BOLD, ITALIC, ITALIC_BOLD } |
using | RGB = std::vector< float > |
using | Direction = casacore::Vector< std::pair< casacore::Quantity, casacore::Quantity > > |
The pairs have longitude as the first member and latitude as the second. More... | |
Static Public Member Functions inherited from casa::AnnotationBase | |
static LineStyle | lineStyleFromString (const casacore::String &ls) |
static Type | typeFromString (const casacore::String &type) |
Given a string, return the corresponding annotation type or throw an error if the string does not correspond to an allowed type. More... | |
static casacore::String | typeToString (const Type type) |
static casacore::String | keywordToString (const Keyword key) |
static casacore::String | lineStyleToString (const LineStyle linestyle) |
static FontStyle | fontStyleFromString (const casacore::String &fs) |
static casacore::String | fontStyleToString (const FontStyle fs) |
static casacore::String | colorToString (const RGB &color) |
static void | unitInit () |
set "pix" as valid unit. More... | |
static std::ostream & | print (std::ostream &os, const std::map< Keyword, casacore::String > ¶ms) |
print a set of keyword value pairs More... | |
static std::ostream & | print (std::ostream &os, const LineStyle ls) |
print a line style representation More... | |
static std::ostream & | print (std::ostream &os, const FontStyle fs) |
print a font style representation More... | |
static std::ostream & | print (std::ostream &os, const Direction d) |
static std::list< std::string > | colorChoices () |
Get a list of the user-friendly color names supported. More... | |
Static Public Attributes inherited from casa::AnnotationBase | |
static const RGB | BLACK |
static const RGB | BLUE |
static const RGB | CYAN |
static const RGB | GRAY |
static const RGB | GREEN |
static const RGB | MAGENTA |
static const RGB | ORANGE |
static const RGB | RED |
static const RGB | WHITE |
static const RGB | YELLOW |
static const casacore::String | DEFAULT_LABEL |
static const RGB | DEFAULT_COLOR |
static const LineStyle | DEFAULT_LINESTYLE |
static const casacore::uInt | DEFAULT_LINEWIDTH |
static const casacore::uInt | DEFAULT_SYMBOLSIZE |
static const casacore::uInt | DEFAULT_SYMBOLTHICKNESS |
static const casacore::String | DEFAULT_FONT |
static const casacore::uInt | DEFAULT_FONTSIZE |
static const FontStyle | DEFAULT_FONTSTYLE |
static const casacore::Bool | DEFAULT_USETEX |
static const RGB | DEFAULT_LABELCOLOR |
static const casacore::String | DEFAULT_LABELPOS |
static const std::vector < casacore::Int > | DEFAULT_LABELOFF |
static const casacore::Regex | rgbHexRegex |
Protected Member Functions inherited from casa::AnnPolygon | |
AnnPolygon (AnnotationBase::Type shape, const casacore::Quantity &blcx, const casacore::Quantity &blcy, const casacore::Quantity &trcx, const casacore::Quantity &trcy, const casacore::String &dirRefFrameString, const casacore::CoordinateSystem &csys, const casacore::IPosition &imShape, const casacore::Quantity &beginFreq, const casacore::Quantity &endFreq, const casacore::String &freqRefFrameString, const casacore::String &dopplerString, const casacore::Quantity &restfreq, const casacore::Vector< casacore::Stokes::StokesTypes > stokes, const casacore::Bool annotationOnly, const casacore::Bool requireImageRegion=true) | |
for rectangle subclasses More... | |
AnnPolygon (AnnotationBase::Type shape, const casacore::Quantity &blcx, const casacore::Quantity &blcy, const casacore::Quantity &trcx, const casacore::Quantity &trcy, const casacore::CoordinateSystem &csys, const casacore::IPosition &imShape, const casacore::Vector< casacore::Stokes::StokesTypes > &stokes, const casacore::Bool requireImageRegion=true) | |
Simplified constructor. More... | |
AnnPolygon (AnnotationBase::Type shape, const casacore::Quantity ¢erx, const casacore::Quantity ¢ery, const casacore::Quantity &widthx, const casacore::Quantity &widthy, const casacore::Quantity &positionAngle, const casacore::String &dirRefFrameString, const casacore::CoordinateSystem &csys, const casacore::IPosition &imShape, const casacore::Quantity &beginFreq, const casacore::Quantity &endFreq, const casacore::String &freqRefFrameString, const casacore::String &dopplerString, const casacore::Quantity &restfreq, const casacore::Vector< casacore::Stokes::StokesTypes > stokes, const casacore::Bool annotationOnly, const casacore::Bool requireImageRegion=true) | |
For centered rectangles. More... | |
AnnPolygon (AnnotationBase::Type shape, const casacore::Quantity ¢erx, const casacore::Quantity ¢ery, const casacore::Quantity &widthx, const casacore::Quantity &widthy, const casacore::Quantity &positionAngle, const casacore::CoordinateSystem &csys, const casacore::IPosition &imShape, const casacore::Vector< casacore::Stokes::StokesTypes > &stokes, const casacore::Bool requireImageRegion=true) | |
Simplified constructor. More... | |
Protected Member Functions inherited from casa::AnnRegion | |
AnnRegion (const Type shape, const casacore::String &dirRefFrameString, const casacore::CoordinateSystem &csys, const casacore::IPosition &imShape, 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, const casacore::Bool annotationOnly, casacore::Bool requireImageRegion=true) | |
only to be called by subclasses More... | |
AnnRegion (const Type shape, const casacore::CoordinateSystem &csys, const casacore::IPosition &imShape, const casacore::Vector< casacore::Stokes::StokesTypes > &stokes, casacore::Bool requireImageRegion=true) | |
use if all coordinate values will be specified in the same frames as the input coordinate system. More... | |
AnnRegion (const AnnRegion &other) | |
copy constructor More... | |
AnnRegion & | operator= (const AnnRegion &rhs) |
assignment operator More... | |
casacore::Bool | operator== (const AnnRegion &other) const |
casacore::Bool | hasImageRegion () const |
check if image region has a region More... | |
void | _extend () |
extend the direction plane region over spectral and/or polarization coordinates More... | |
void | _toRecord (const casacore::ImageRegion ®ion) |
casacore::Quantity | _lengthToAngle (const casacore::Quantity &quantity, const casacore::uInt pixelAxis) const |
convert a length in pixels to an angle. More... | |
virtual void | _printPrefix (std::ostream &os) const |
void | _setDirectionRegion (const casacore::ImageRegion ®ion) |
subclasses must call this at construction to set their base region defined in the direction plane More... | |
Protected Member Functions inherited from casa::AnnotationBase | |
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 used, if one exists. More... | |
AnnotationBase (const Type type, const casacore::CoordinateSystem &csys, const casacore::Vector< casacore::Stokes::StokesTypes > &stokes) | |
use only if the frame of the input directions is the same as the frame of the coordinate system. More... | |
AnnotationBase & | operator= (const AnnotationBase &other) |
assignment operator More... | |
casacore::MDirection | _directionFromQuantities (const casacore::Quantity &q0, const casacore::Quantity &q1) |
void | _checkAndConvertDirections (const casacore::String &origin, const Direction &dirs) |
virtual void | _printPairs (std::ostream &os) const |
const casacore::IPosition & | _getDirectionAxes () const |
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 degrees More... | |
void | _setParam (const Keyword k, const casacore::String &s) |
casacore::MDirection::Types | _getDirectionRefFrame () const |
Static Protected Member Functions inherited from casa::AnnotationBase | |
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 More... | |
static casacore::String | _toDeg (const casacore::Quantity &angle) |
convert angle to degrees, precision 0.1 mas More... | |
static casacore::String | _printPixel (const casacore::Double &d) |
return a string representing a pixel value, precision 1. More... | |
Protected Attributes inherited from casa::AnnRegion | |
casacore::Bool | _requireImageRegion |
casacore::ImageRegion | _imageRegion |
casacore::ImageRegion | _directionRegion |
This class represents an annotation for rectangular (in position coordinates) region specified in an ascii region file as proposed in CAS-2285 <author>Dave Mehringer</author>
Public interface
Holds the specification of an annotation for a rectangular region as specified in ASCII format.
This class represents an annotation for a rectangular region in coordinate space. In general, in order to preserve the region through a rotation (eg from one coordinate frame to another), all four corners must be tracked through the rotation. Hence, this region is effectively a four corner polygon.
Definition at line 48 of file AnnRectBox.h.
casa::AnnRectBox::AnnRectBox | ( | const casacore::Quantity & | blcx, |
const casacore::Quantity & | blcy, | ||
const casacore::Quantity & | trcx, | ||
const casacore::Quantity & | trcy, | ||
const casacore::String & | dirRefFrameString, | ||
const casacore::CoordinateSystem & | csys, | ||
const casacore::IPosition & | imShape, | ||
const casacore::Quantity & | beginFreq, | ||
const casacore::Quantity & | endFreq, | ||
const casacore::String & | freqRefFrameString, | ||
const casacore::String & | dopplerString, | ||
const casacore::Quantity & | restfreq, | ||
const casacore::Vector< casacore::Stokes::StokesTypes > | stokes, | ||
const casacore::Bool | annotationOnly, | ||
const casacore::Bool | requireImageRegion = true |
||
) |
casa::AnnRectBox::AnnRectBox | ( | const casacore::Quantity & | blcx, |
const casacore::Quantity & | blcy, | ||
const casacore::Quantity & | trcx, | ||
const casacore::Quantity & | trcy, | ||
const casacore::CoordinateSystem & | csys, | ||
const casacore::IPosition & | imShape, | ||
const casacore::Vector< casacore::Stokes::StokesTypes > & | stokes, | ||
const casacore::Bool | requireImageRegion = true |
||
) |
Simplified constructor.
all frequencies are used (these can be set after construction). blcx, blcy, trcx, and trcy must be in the same frame as the csys direction coordinate. is a region (not just an annotation), although this value can be changed after construction.
AnnRectBox& casa::AnnRectBox::operator= | ( | const AnnRectBox & | other | ) |
implicit copy constructor and destructor are fine
|
virtual |
get the blc and trc direction coords for the box.
The output directions will be converted from the input reference frame to the reference frame of the input coordinate system if necessary. blc is the 0th component, trc the 1st in the returned vector.
casacore::Vector<casacore::MDirection> getCorners() const;
Reimplemented from casa::AnnPolygon.
|
private |
Definition at line 102 of file AnnRectBox.h.