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

Base class for WorldCanvas axis labelling using a DisplayCoordinateSystem. More...

#include <WCCSAxisLabeller.h>

Inheritance diagram for casa::WCCSAxisLabeller:
casa::WCAxisLabeller casa::DisplayOptions casa::WCCSNLAxisLabeller

Public Types

enum  SpecAxisType {
  FREQ,
  VELO,
  WAVE,
  AWAV
}
 

Public Member Functions

 WCCSAxisLabeller ()
 Constructor. More...
 
virtual ~WCCSAxisLabeller ()
 Destructor. More...
 
virtual void setCoordinateSystem (const DisplayCoordinateSystem &coordsys)
 Install a DisplayCoordinateSystem. More...
 
virtual DisplayCoordinateSystem coordinateSystem () const
 Get the DisplayCoordinateSystem. More...
 
casacore::Bool hasCoordinateSystem () const
 Has a CS been set? More...
 
virtual void setDefaultOptions ()
 install the default options for this labeller. More...
 
virtual casacore::Bool setOptions (const casacore::Record &rec, casacore::Record &updatedOptions)
 apply options stored in rec to the labeller; return value true means a refresh is needed. More...
 
virtual casacore::Record getOptions () const
 retrieve the current and default options and parameter types. More...
 
virtual casacore::String xAxisText (WorldCanvas *wc) const
 return the X and Y label text - over-ridden from base class More...
 
virtual casacore::String yAxisText (WorldCanvas *wc) const
 
virtual casacore::String xAxisText () const
 
virtual casacore::String yAxisText () const
 
virtual casacore::String zLabelType () const
 
virtual casacore::String zLabelPos () const
 
virtual void setZIndex (casacore::Int zindex)
 
virtual casacore::Int uiBase () const
 DD 'Absolute Pixel Coordinates', e.g. More...
 
virtual void setUIBase (casacore::Int uibase)
 
const casacore::StringspectralunitStr () const
 
casacore::Int spectralprec () const
 
- Public Member Functions inherited from casa::WCAxisLabeller
 WCAxisLabeller ()
 Constructor. More...
 
virtual ~WCAxisLabeller ()
 Destructor. More...
 
virtual casacore::Bool draw (const WCRefreshEvent &ev)=0
 Draw axis labels for the provided WorldCanvas refresh event. More...
 
virtual void invalidate ()
 Invalidate any cached drawings. More...
 
virtual casacore::Bool setAxisLabelSwitch (const casacore::Bool labelswitch=false)
 set/return whether labelling is on or off. More...
 
virtual casacore::Bool axisLabelSwitch () const
 
virtual void setSubstituteTitleText (const casacore::String substituteImageName)
 set/return the title text. More...
 
virtual casacore::String titleText () const
 
virtual casacore::String displayedTitleText () const
 
virtual casacore::Bool setTitleTextColor (const casacore::String color=casacore::String("foreground"))
 set/return the color of the title text. More...
 
virtual casacore::String titleTextColor () const
 
virtual casacore::Bool setXAxisText (const casacore::String text=casacore::String(""))
 set/return the X and Y label text. More...
 
virtual casacore::Bool setYAxisText (const casacore::String text=casacore::String(""))
 
virtual casacore::Bool unsetXAxisText ()
 
virtual casacore::Bool unsetYAxisText ()
 
virtual casacore::Bool isXAxisTextUnset () const
 
virtual casacore::Bool isYAxisTextUnset () const
 
virtual casacore::Bool setXAxisTextColor (const casacore::String color=casacore::String("foreground"))
 set/return the color of the label text. More...
 
virtual casacore::Bool setYAxisTextColor (const casacore::String color=casacore::String("foreground"))
 
virtual casacore::String xAxisTextColor () const
 
virtual casacore::String yAxisTextColor () const
 
virtual casacore::Bool setXGridType (const casacore::String type=casacore::String("None"))
 set/return what type of grid is marked in each direction. More...
 
virtual casacore::Bool setYGridType (const casacore::String type=casacore::String("None"))
 
virtual casacore::String xGridType () const
 
virtual casacore::String yGridType () const
 
virtual casacore::Bool setXGridColor (const casacore::String color=casacore::String("foreground"))
 set/return the color of the grid lines per direction. More...
 
virtual casacore::Bool setYGridColor (const casacore::String color=casacore::String("foreground"))
 
virtual casacore::String xGridColor () const
 
virtual casacore::String yGridColor () const
 
virtual casacore::Bool setTickLength (const casacore::Float length=4.0)
 set/return the tick length in millimetres. More...
 
virtual casacore::Float tickLength () const
 
virtual casacore::Bool setLabelPosition (const casacore::String position=casacore::String("Auto"))
 set/return the position of World label strings More...
 
virtual casacore::String labelPosition () const
 
virtual casacore::Bool setPlotOutline (const casacore::Bool outline=true)
 set/return whether there is a plot outline or not. More...
 
virtual casacore::Bool plotOutline () const
 
virtual casacore::Bool setPlotOutlineColor (const casacore::String color=casacore::String("foreground"))
 set/return the color used for the plot outline. More...
 
virtual casacore::String plotOutlineColor () const
 
virtual casacore::Bool setCharSize (const casacore::Float size=1.2)
 set/return the char size for the plot graphics More...
 
virtual casacore::Float charSize () const
 
virtual casacore::Bool setCharFont (const casacore::String font="normal")
 set/return the char font for the plot graphics More...
 
virtual casacore::String charFont () const
 
virtual casacore::Bool setLineWidth (const casacore::Float width=0.0)
 set/return the line width for the plot graphics. More...
 
virtual casacore::Float lineWidth () const
 
- Public Member Functions inherited from casa::DisplayOptions
 DisplayOptions ()
 Constructor. More...
 
virtual ~DisplayOptions ()
 Destructor. More...
 
template<class T >
casacore::Bool readOptionRecord (casacore::Vector< T > &target, casacore::Bool &error, const casacore::Record &rec, const casacore::String &fieldname) const
 Find the field fieldname in casacore::Record rec, containing the requested type (casacore::Bool, casacore::String, casacore::Float, casacore::Int) in itself or its "value" sub-field, and return the value in target. More...
 
template<class T >
casacore::Bool readOptionRecord (T &target, casacore::Bool &error, const casacore::Record &rec, const casacore::String &fieldname) const
 
virtual casacore::Bool readOptionRecord (casacore::String &target, casacore::Bool &unsetTarget, casacore::Bool &error, const casacore::Record &rec, const casacore::String &fieldname) const
 Find the field fieldname in casacore::Record rec, containing the requested type (casacore::String) in itself or its "value" sub-field, and return the value in target. More...
 
casacore::Record unset () const
 Return a casacore::Record which is an "unset" casacore::Record, ie. More...
 
casacore::Bool isUnset (const casacore::Record &rec) const
 Return true or false indicating if the provided casacore::Record is equal to an "unset" Record. More...
 

Public Attributes

casacore::Bool useWCCS
 Setting this true allows the labeller to use the WorldCanvas's own CS to draw labels (although itsCoordinateSystem is still needed for certain things at present). More...
 

Protected Member Functions

void setSpectralState (DisplayCoordinateSystem &cs) const
 Set spectral state onto given CS. More...
 
void setDirectionState (DisplayCoordinateSystem &cs) const
 Set direction state onto given CS. More...
 
- Protected Member Functions inherited from casa::DisplayOptions
 DisplayOptions (const DisplayOptions &other)
 (Required) copy constructor. More...
 
void operator= (const DisplayOptions &other)
 (Required) copy assignment. More...
 

Protected Attributes

casacore::Bool itsAbsolute
 
casacore::Bool itsWorldAxisLabels
 
WCCSAxisLabeller::SpecAxisType itsSpecAxisType
 
casacore::Int itsZIndex
 
- Protected Attributes inherited from casa::WCAxisLabeller
casacore::Bool titleChanged
 

Private Member Functions

casacore::String axisText (casacore::Int worldAxis, WorldCanvas *wc) const
 Generate axis text for specified axis. More...
 
casacore::String axisText (casacore::Int worldAxis) const
 
void setSpectralState ()
 Set new spectral state in itsCoordinateSystem. More...
 
void setDirectionState ()
 Set new direction state in itsCoordinateSystem. More...
 
void setAbsRelState ()
 Set absolute/relative state in itsCoordinateSystem. More...
 
void distributeTypeUnit ()
 "optical velocity [m/s]" –> "optical velocity" and "m/s" More...
 

Private Attributes

DisplayCoordinateSystem itsCoordinateSystem
 
casacore::Bool itsHasCoordinateSystem
 
casacore::Int itsSpectralPrecision
 
casacore::String itsSpectralUnit
 
casacore::String itsSpectralQuantity
 
casacore::String itsSpectralTypeUnit
 
casacore::String itsDirectionUnit
 
casacore::String itsDirectionSystem
 
casacore::String itsFrequencySystem
 
casacore::String itsZLabelType
 
casacore::String itsZLabelPos
 
casacore::String itsRestValue
 
casacore::String itsRestUnit
 
casacore::Int uiBase_
 

Static Private Attributes

static const casacore::String FRAME_REST
 

Additional Inherited Members

- Static Public Attributes inherited from casa::WCAxisLabeller
static const casacore::String LABEL_CHAR_SIZE
 
static const casacore::String PLOT_TITLE
 

Detailed Description

Base class for WorldCanvas axis labelling using a DisplayCoordinateSystem.

Synopsis

This (base) class adds to the interface of WCAxisLabeller functions which support the use/provision of a DisplayCoordinateSystem to assist with axis labelling.

Definition at line 47 of file WCCSAxisLabeller.h.

Member Enumeration Documentation

Enumerator
FREQ 
VELO 
WAVE 
AWAV 

Definition at line 50 of file WCCSAxisLabeller.h.

Constructor & Destructor Documentation

casa::WCCSAxisLabeller::WCCSAxisLabeller ( )

Constructor.

virtual casa::WCCSAxisLabeller::~WCCSAxisLabeller ( )
virtual

Destructor.

Member Function Documentation

casacore::String casa::WCCSAxisLabeller::axisText ( casacore::Int  worldAxis,
WorldCanvas wc 
) const
private

Generate axis text for specified axis.

Referenced by axisText().

casacore::String casa::WCCSAxisLabeller::axisText ( casacore::Int  worldAxis) const
inlineprivate

Definition at line 193 of file WCCSAxisLabeller.h.

References axisText().

virtual DisplayCoordinateSystem casa::WCCSAxisLabeller::coordinateSystem ( ) const
inlinevirtual

Get the DisplayCoordinateSystem.

Definition at line 71 of file WCCSAxisLabeller.h.

References itsCoordinateSystem.

void casa::WCCSAxisLabeller::distributeTypeUnit ( )
private

"optical velocity [m/s]" –> "optical velocity" and "m/s"

virtual casacore::Record casa::WCCSAxisLabeller::getOptions ( ) const
virtual

retrieve the current and default options and parameter types.

Reimplemented from casa::WCAxisLabeller.

Reimplemented in casa::WCCSNLAxisLabeller.

casacore::Bool casa::WCCSAxisLabeller::hasCoordinateSystem ( ) const
inline

Has a CS been set?

Definition at line 76 of file WCCSAxisLabeller.h.

References itsHasCoordinateSystem.

void casa::WCCSAxisLabeller::setAbsRelState ( )
private

Set absolute/relative state in itsCoordinateSystem.

virtual void casa::WCCSAxisLabeller::setCoordinateSystem ( const DisplayCoordinateSystem coordsys)
virtual

Install a DisplayCoordinateSystem.

Reimplemented in casa::WCCSNLAxisLabeller.

virtual void casa::WCCSAxisLabeller::setDefaultOptions ( )
virtual

install the default options for this labeller.

Reimplemented from casa::WCAxisLabeller.

Reimplemented in casa::WCCSNLAxisLabeller.

void casa::WCCSAxisLabeller::setDirectionState ( DisplayCoordinateSystem cs) const
protected

Set direction state onto given CS.

void casa::WCCSAxisLabeller::setDirectionState ( )
inlineprivate

Set new direction state in itsCoordinateSystem.

Definition at line 203 of file WCCSAxisLabeller.h.

References itsCoordinateSystem.

virtual casacore::Bool casa::WCCSAxisLabeller::setOptions ( const casacore::Record rec,
casacore::Record updatedOptions 
)
virtual

apply options stored in rec to the labeller; return value true means a refresh is needed.

Any fields added to the updatedOptions argument are options which have changed in some way due to the setting of other options - ie. they are context sensitive.

Reimplemented from casa::WCAxisLabeller.

Reimplemented in casa::WCCSNLAxisLabeller.

void casa::WCCSAxisLabeller::setSpectralState ( DisplayCoordinateSystem cs) const
protected

Set spectral state onto given CS.

void casa::WCCSAxisLabeller::setSpectralState ( )
inlineprivate

Set new spectral state in itsCoordinateSystem.

Definition at line 198 of file WCCSAxisLabeller.h.

References itsCoordinateSystem.

virtual void casa::WCCSAxisLabeller::setUIBase ( casacore::Int  uibase)
inlinevirtual

Definition at line 145 of file WCCSAxisLabeller.h.

References uiBase_.

virtual void casa::WCCSAxisLabeller::setZIndex ( casacore::Int  zindex)
inlinevirtual

Definition at line 126 of file WCCSAxisLabeller.h.

References itsZIndex.

casacore::Int casa::WCCSAxisLabeller::spectralprec ( ) const
inline

Definition at line 155 of file WCCSAxisLabeller.h.

References itsSpectralPrecision.

const casacore::String& casa::WCCSAxisLabeller::spectralunitStr ( ) const
inline

Definition at line 151 of file WCCSAxisLabeller.h.

References itsSpectralUnit.

virtual casacore::Int casa::WCCSAxisLabeller::uiBase ( ) const
inlinevirtual

DD 'Absolute Pixel Coordinates', e.g.

channel numbers, are internally 0-based (they begin numbering at 0), but 'Absolute Pixel coordinates' have traditionally been displayed as 1-based in the glish viewer. uiBase_, and related methods uiBase() and setUIBase(), allow newer (python/Qt-based) code to cause such labelling to be produced with 0-based values instead. Unless setUIBase(0) is called, the traditional 1-based labelling behavior is retained by default.

If you are using 0-basing for 'Absolute Pixel casacore::Coordinate' labelling, you should call setUIBase(0), before using draw().

Definition at line 141 of file WCCSAxisLabeller.h.

References uiBase_.

virtual casacore::String casa::WCCSAxisLabeller::xAxisText ( WorldCanvas wc) const
virtual

return the X and Y label text - over-ridden from base class

virtual casacore::String casa::WCCSAxisLabeller::xAxisText ( ) const
inlinevirtual

Reimplemented from casa::WCAxisLabeller.

Definition at line 110 of file WCCSAxisLabeller.h.

virtual casacore::String casa::WCCSAxisLabeller::yAxisText ( WorldCanvas wc) const
virtual
virtual casacore::String casa::WCCSAxisLabeller::yAxisText ( ) const
inlinevirtual

Reimplemented from casa::WCAxisLabeller.

Definition at line 113 of file WCCSAxisLabeller.h.

virtual casacore::String casa::WCCSAxisLabeller::zLabelPos ( ) const
inlinevirtual

Definition at line 122 of file WCCSAxisLabeller.h.

References itsZLabelPos.

virtual casacore::String casa::WCCSAxisLabeller::zLabelType ( ) const
inlinevirtual

Definition at line 118 of file WCCSAxisLabeller.h.

References itsZLabelType.

Member Data Documentation

const casacore::String casa::WCCSAxisLabeller::FRAME_REST
staticprivate

Definition at line 213 of file WCCSAxisLabeller.h.

casacore::Bool casa::WCCSAxisLabeller::itsAbsolute
protected

Definition at line 160 of file WCCSAxisLabeller.h.

DisplayCoordinateSystem casa::WCCSAxisLabeller::itsCoordinateSystem
private

Definition at line 173 of file WCCSAxisLabeller.h.

Referenced by coordinateSystem(), setDirectionState(), and setSpectralState().

casacore::String casa::WCCSAxisLabeller::itsDirectionSystem
private

Definition at line 180 of file WCCSAxisLabeller.h.

casacore::String casa::WCCSAxisLabeller::itsDirectionUnit
private

Definition at line 179 of file WCCSAxisLabeller.h.

casacore::String casa::WCCSAxisLabeller::itsFrequencySystem
private

Definition at line 181 of file WCCSAxisLabeller.h.

casacore::Bool casa::WCCSAxisLabeller::itsHasCoordinateSystem
private

Definition at line 174 of file WCCSAxisLabeller.h.

Referenced by hasCoordinateSystem().

casacore::String casa::WCCSAxisLabeller::itsRestUnit
private

Definition at line 185 of file WCCSAxisLabeller.h.

casacore::String casa::WCCSAxisLabeller::itsRestValue
private

Definition at line 184 of file WCCSAxisLabeller.h.

WCCSAxisLabeller::SpecAxisType casa::WCCSAxisLabeller::itsSpecAxisType
mutableprotected

Definition at line 162 of file WCCSAxisLabeller.h.

casacore::Int casa::WCCSAxisLabeller::itsSpectralPrecision
private

Definition at line 175 of file WCCSAxisLabeller.h.

Referenced by spectralprec().

casacore::String casa::WCCSAxisLabeller::itsSpectralQuantity
private

Definition at line 177 of file WCCSAxisLabeller.h.

casacore::String casa::WCCSAxisLabeller::itsSpectralTypeUnit
private

Definition at line 178 of file WCCSAxisLabeller.h.

casacore::String casa::WCCSAxisLabeller::itsSpectralUnit
private

Definition at line 176 of file WCCSAxisLabeller.h.

Referenced by spectralunitStr().

casacore::Bool casa::WCCSAxisLabeller::itsWorldAxisLabels
protected

Definition at line 161 of file WCCSAxisLabeller.h.

casacore::Int casa::WCCSAxisLabeller::itsZIndex
protected

Definition at line 163 of file WCCSAxisLabeller.h.

Referenced by setZIndex().

casacore::String casa::WCCSAxisLabeller::itsZLabelPos
private

Definition at line 183 of file WCCSAxisLabeller.h.

Referenced by zLabelPos().

casacore::String casa::WCCSAxisLabeller::itsZLabelType
private

Definition at line 182 of file WCCSAxisLabeller.h.

Referenced by zLabelType().

casacore::Int casa::WCCSAxisLabeller::uiBase_
private

Definition at line 187 of file WCCSAxisLabeller.h.

Referenced by setUIBase(), and uiBase().

casacore::Bool casa::WCCSAxisLabeller::useWCCS

Setting this true allows the labeller to use the WorldCanvas's own CS to draw labels (although itsCoordinateSystem is still needed for certain things at present).

Default: false.

Definition at line 78 of file WCCSAxisLabeller.h.


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