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

Abstract class for drawing grids, axes, ticks and tick labels on a WorldCanvas. More...

#include <WCAxisLabeller.h>

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

Public Member Functions

 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 void setDefaultOptions ()
 install the default options for this DisplayData More...
 
virtual casacore::Bool setOptions (const casacore::Record &rec, casacore::Record &updatedOptions)
 apply options stored in rec to the DisplayData; 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::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::String xAxisText () const
 
virtual casacore::String yAxisText () const
 
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...
 

Static Public Attributes

static const casacore::String LABEL_CHAR_SIZE
 
static const casacore::String PLOT_TITLE
 

Protected Attributes

casacore::Bool titleChanged
 

Private Attributes

casacore::Bool itsOptionsAxisLabelSwitch
 global switch on or off More...
 
casacore::String itsOptionsTitleText
 display title text More...
 
casacore::String itsOptionsTitleTextColor
 title color More...
 
casacore::String itsOptionsXAxisText
 display axes label text More...
 
casacore::String itsOptionsYAxisText
 
casacore::Bool itsOptionsXAxisTextUnset
 are the above unset More...
 
casacore::Bool itsOptionsYAxisTextUnset
 
casacore::String itsOptionsXAxisTextColor
 label text color More...
 
casacore::String itsOptionsYAxisTextColor
 
casacore::String itsOptionsXGridType
 coordinate grid? More...
 
casacore::String itsOptionsYGridType
 
casacore::String itsOptionsXGridColor
 coordinate grid colors More...
 
casacore::String itsOptionsYGridColor
 
casacore::Float itsOptionsTickLength
 tick mark length in mm More...
 
casacore::String itsOptionsLabelPos
 Label position. More...
 
casacore::Bool itsOptionsPlotOutline
 plot outline? More...
 
casacore::String itsOptionsPlotOutlineColor
 plot outline color More...
 
casacore::Float itsOptionsCharSize
 plot character size More...
 
casacore::String itsOptionsCharFont
 plot character font More...
 
casacore::Float itsOptionsLineWidth
 
plot line width

casacore::Int itsOptionsLineWidth; More...

 
casacore::Bool itsDefaultSwitch
 defaults for on/off switch and character size (from.aipsrc, if they exist there). More...
 
casacore::Float itsDefaultCharSize
 
casacore::String substituteTitleText
 

Additional Inherited Members

- Protected Member Functions inherited from casa::DisplayOptions
 DisplayOptions (const DisplayOptions &other)
 (Required) copy constructor. More...
 
void operator= (const DisplayOptions &other)
 (Required) copy assignment. More...
 

Detailed Description

Abstract class for drawing grids, axes, ticks and tick labels on a WorldCanvas.

Intended use:

Internal

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

WCAxisLabeller stands for WorldCanvas Axis Labeller

Synopsis

This class forms the base for classes which draw axis grids, axes, ticks and tick labels on WorldCanvases. In its present form, it is really a heavily pruned form of the DisplayData.

Example

Motivation

Axis labels are a necessary annotation for meaningful displays of data. This class is motivated by the desire to provide (eventually) many different types of axis labelling.

To Do

Definition at line 84 of file WCAxisLabeller.h.

Constructor & Destructor Documentation

casa::WCAxisLabeller::WCAxisLabeller ( )

Constructor.

virtual casa::WCAxisLabeller::~WCAxisLabeller ( )
virtual

Destructor.

Member Function Documentation

virtual casacore::Bool casa::WCAxisLabeller::axisLabelSwitch ( ) const
inlinevirtual

Definition at line 118 of file WCAxisLabeller.h.

References itsOptionsAxisLabelSwitch.

virtual casacore::String casa::WCAxisLabeller::charFont ( ) const
inlinevirtual

Definition at line 253 of file WCAxisLabeller.h.

References itsOptionsCharFont.

virtual casacore::Float casa::WCAxisLabeller::charSize ( ) const
inlinevirtual

Definition at line 245 of file WCAxisLabeller.h.

References itsOptionsCharSize.

virtual casacore::String casa::WCAxisLabeller::displayedTitleText ( ) const
inlinevirtual
virtual casacore::Bool casa::WCAxisLabeller::draw ( const WCRefreshEvent ev)
pure virtual

Draw axis labels for the provided WorldCanvas refresh event.

Implemented in casa::WCCSNLAxisLabeller.

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

retrieve the current and default options and parameter types.

Reimplemented in casa::WCCSAxisLabeller, and casa::WCCSNLAxisLabeller.

virtual void casa::WCAxisLabeller::invalidate ( )
inlinevirtual

Invalidate any cached drawings.

Reimplemented in casa::WCCSNLAxisLabeller.

Definition at line 98 of file WCAxisLabeller.h.

virtual casacore::Bool casa::WCAxisLabeller::isXAxisTextUnset ( ) const
inlinevirtual

Definition at line 158 of file WCAxisLabeller.h.

References itsOptionsXAxisTextUnset.

virtual casacore::Bool casa::WCAxisLabeller::isYAxisTextUnset ( ) const
inlinevirtual

Definition at line 161 of file WCAxisLabeller.h.

References itsOptionsYAxisTextUnset.

virtual casacore::String casa::WCAxisLabeller::labelPosition ( ) const
inlinevirtual

Definition at line 217 of file WCAxisLabeller.h.

References itsOptionsLabelPos.

virtual casacore::Float casa::WCAxisLabeller::lineWidth ( ) const
inlinevirtual

Definition at line 266 of file WCAxisLabeller.h.

References itsOptionsLineWidth.

virtual casacore::Bool casa::WCAxisLabeller::plotOutline ( ) const
inlinevirtual

Definition at line 227 of file WCAxisLabeller.h.

References itsOptionsPlotOutline.

virtual casacore::String casa::WCAxisLabeller::plotOutlineColor ( ) const
inlinevirtual

Definition at line 237 of file WCAxisLabeller.h.

References itsOptionsPlotOutlineColor.

virtual casacore::Bool casa::WCAxisLabeller::setAxisLabelSwitch ( const casacore::Bool  labelswitch = false)
virtual

set/return whether labelling is on or off.

This is a global switch. If true is returned from the set function, then a refresh is required.

virtual casacore::Bool casa::WCAxisLabeller::setCharFont ( const casacore::String  font = "normal")
virtual

set/return the char font for the plot graphics

virtual casacore::Bool casa::WCAxisLabeller::setCharSize ( const casacore::Float  size = 1.2)
virtual

set/return the char size for the plot graphics

virtual void casa::WCAxisLabeller::setDefaultOptions ( )
virtual

install the default options for this DisplayData

Reimplemented in casa::WCCSAxisLabeller, and casa::WCCSNLAxisLabeller.

virtual casacore::Bool casa::WCAxisLabeller::setLabelPosition ( const casacore::String  position = casacore::String("Auto"))
virtual

set/return the position of World label strings

virtual casacore::Bool casa::WCAxisLabeller::setLineWidth ( const casacore::Float  width = 0.0)
virtual

set/return the line width for the plot graphics.

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

apply options stored in rec to the DisplayData; 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 in casa::WCCSAxisLabeller, and casa::WCCSNLAxisLabeller.

virtual casacore::Bool casa::WCAxisLabeller::setPlotOutline ( const casacore::Bool  outline = true)
virtual

set/return whether there is a plot outline or not.

If true is returned from the set function, then a refresh is probably needed.

virtual casacore::Bool casa::WCAxisLabeller::setPlotOutlineColor ( const casacore::String  color = casacore::String("foreground"))
virtual

set/return the color used for the plot outline.

If true is returned from the set function, then a refresh should be enacted.

virtual void casa::WCAxisLabeller::setSubstituteTitleText ( const casacore::String  substituteImageName)
virtual

set/return the title text.

If true is returned from the set function then a refresh is required.

virtual casacore::Bool setTitleText(const casacore::String text = casacore::String(""));

virtual casacore::Bool casa::WCAxisLabeller::setTickLength ( const casacore::Float  length = 4.0)
virtual

set/return the tick length in millimetres.

If true is returned from the set function, then a refresh is probably needed.

virtual casacore::Bool casa::WCAxisLabeller::setTitleTextColor ( const casacore::String  color = casacore::String("foreground"))
virtual

set/return the color of the title text.

If true is returned from the set function, then a refresh should be called.

virtual casacore::Bool casa::WCAxisLabeller::setXAxisText ( const casacore::String  text = casacore::String(""))
virtual

set/return the X and Y label text.

If true is returned from the set functions, then a refresh is needed.

virtual casacore::Bool casa::WCAxisLabeller::setXAxisTextColor ( const casacore::String  color = casacore::String("foreground"))
virtual

set/return the color of the label text.

If true is returned from the set function, then a refresh is needed.

virtual casacore::Bool casa::WCAxisLabeller::setXGridColor ( const casacore::String  color = casacore::String("foreground"))
virtual

set/return the color of the grid lines per direction.

If true is returned from the set functions, a refresh is needed.

virtual casacore::Bool casa::WCAxisLabeller::setXGridType ( const casacore::String  type = casacore::String("None"))
virtual

set/return what type of grid is marked in each direction.

If true is returned from the set functions, a refresh is needed.

virtual casacore::Bool casa::WCAxisLabeller::setYAxisText ( const casacore::String  text = casacore::String(""))
virtual
virtual casacore::Bool casa::WCAxisLabeller::setYAxisTextColor ( const casacore::String  color = casacore::String("foreground"))
virtual
virtual casacore::Bool casa::WCAxisLabeller::setYGridColor ( const casacore::String  color = casacore::String("foreground"))
virtual
virtual casacore::Bool casa::WCAxisLabeller::setYGridType ( const casacore::String  type = casacore::String("None"))
virtual
virtual casacore::Float casa::WCAxisLabeller::tickLength ( ) const
inlinevirtual

Definition at line 209 of file WCAxisLabeller.h.

References itsOptionsTickLength.

virtual casacore::String casa::WCAxisLabeller::titleText ( ) const
inlinevirtual

Definition at line 128 of file WCAxisLabeller.h.

References itsOptionsTitleText.

virtual casacore::String casa::WCAxisLabeller::titleTextColor ( ) const
inlinevirtual

Definition at line 144 of file WCAxisLabeller.h.

References itsOptionsTitleTextColor.

virtual casacore::Bool casa::WCAxisLabeller::unsetXAxisText ( )
virtual
virtual casacore::Bool casa::WCAxisLabeller::unsetYAxisText ( )
virtual
virtual casacore::String casa::WCAxisLabeller::xAxisText ( ) const
virtual

Reimplemented in casa::WCCSAxisLabeller.

virtual casacore::String casa::WCAxisLabeller::xAxisTextColor ( ) const
inlinevirtual

Definition at line 171 of file WCAxisLabeller.h.

References itsOptionsXAxisTextColor.

virtual casacore::String casa::WCAxisLabeller::xGridColor ( ) const
inlinevirtual

Definition at line 197 of file WCAxisLabeller.h.

References itsOptionsXGridColor.

virtual casacore::String casa::WCAxisLabeller::xGridType ( ) const
inlinevirtual

Definition at line 184 of file WCAxisLabeller.h.

References itsOptionsXGridType.

virtual casacore::String casa::WCAxisLabeller::yAxisText ( ) const
virtual

Reimplemented in casa::WCCSAxisLabeller.

virtual casacore::String casa::WCAxisLabeller::yAxisTextColor ( ) const
inlinevirtual

Definition at line 174 of file WCAxisLabeller.h.

References itsOptionsYAxisTextColor.

virtual casacore::String casa::WCAxisLabeller::yGridColor ( ) const
inlinevirtual

Definition at line 200 of file WCAxisLabeller.h.

References itsOptionsYGridColor.

virtual casacore::String casa::WCAxisLabeller::yGridType ( ) const
inlinevirtual

Definition at line 187 of file WCAxisLabeller.h.

References itsOptionsYGridType.

Member Data Documentation

casacore::Float casa::WCAxisLabeller::itsDefaultCharSize
private

Definition at line 328 of file WCAxisLabeller.h.

casacore::Bool casa::WCAxisLabeller::itsDefaultSwitch
private

defaults for on/off switch and character size (from.aipsrc, if they exist there).

Definition at line 327 of file WCAxisLabeller.h.

casacore::Bool casa::WCAxisLabeller::itsOptionsAxisLabelSwitch
private

global switch on or off

Definition at line 280 of file WCAxisLabeller.h.

Referenced by axisLabelSwitch().

casacore::String casa::WCAxisLabeller::itsOptionsCharFont
private

plot character font

Definition at line 319 of file WCAxisLabeller.h.

Referenced by charFont().

casacore::Float casa::WCAxisLabeller::itsOptionsCharSize
private

plot character size

Definition at line 316 of file WCAxisLabeller.h.

Referenced by charSize().

casacore::String casa::WCAxisLabeller::itsOptionsLabelPos
private

Label position.

Definition at line 307 of file WCAxisLabeller.h.

Referenced by labelPosition().

casacore::Float casa::WCAxisLabeller::itsOptionsLineWidth
private

plot line width

casacore::Int itsOptionsLineWidth;

Definition at line 323 of file WCAxisLabeller.h.

Referenced by lineWidth().

casacore::Bool casa::WCAxisLabeller::itsOptionsPlotOutline
private

plot outline?

Definition at line 310 of file WCAxisLabeller.h.

Referenced by plotOutline().

casacore::String casa::WCAxisLabeller::itsOptionsPlotOutlineColor
private

plot outline color

Definition at line 313 of file WCAxisLabeller.h.

Referenced by plotOutlineColor().

casacore::Float casa::WCAxisLabeller::itsOptionsTickLength
private

tick mark length in mm

Definition at line 304 of file WCAxisLabeller.h.

Referenced by tickLength().

casacore::String casa::WCAxisLabeller::itsOptionsTitleText
private

display title text

Definition at line 283 of file WCAxisLabeller.h.

Referenced by displayedTitleText(), and titleText().

casacore::String casa::WCAxisLabeller::itsOptionsTitleTextColor
private

title color

Definition at line 286 of file WCAxisLabeller.h.

Referenced by titleTextColor().

casacore::String casa::WCAxisLabeller::itsOptionsXAxisText
private

display axes label text

Definition at line 289 of file WCAxisLabeller.h.

casacore::String casa::WCAxisLabeller::itsOptionsXAxisTextColor
private

label text color

Definition at line 295 of file WCAxisLabeller.h.

Referenced by xAxisTextColor().

casacore::Bool casa::WCAxisLabeller::itsOptionsXAxisTextUnset
private

are the above unset

Definition at line 292 of file WCAxisLabeller.h.

Referenced by isXAxisTextUnset().

casacore::String casa::WCAxisLabeller::itsOptionsXGridColor
private

coordinate grid colors

Definition at line 301 of file WCAxisLabeller.h.

Referenced by xGridColor().

casacore::String casa::WCAxisLabeller::itsOptionsXGridType
private

coordinate grid?

Definition at line 298 of file WCAxisLabeller.h.

Referenced by xGridType().

casacore::String casa::WCAxisLabeller::itsOptionsYAxisText
private

Definition at line 289 of file WCAxisLabeller.h.

casacore::String casa::WCAxisLabeller::itsOptionsYAxisTextColor
private

Definition at line 295 of file WCAxisLabeller.h.

Referenced by yAxisTextColor().

casacore::Bool casa::WCAxisLabeller::itsOptionsYAxisTextUnset
private

Definition at line 292 of file WCAxisLabeller.h.

Referenced by isYAxisTextUnset().

casacore::String casa::WCAxisLabeller::itsOptionsYGridColor
private

Definition at line 301 of file WCAxisLabeller.h.

Referenced by yGridColor().

casacore::String casa::WCAxisLabeller::itsOptionsYGridType
private

Definition at line 298 of file WCAxisLabeller.h.

Referenced by yGridType().

const casacore::String casa::WCAxisLabeller::LABEL_CHAR_SIZE
static

Definition at line 271 of file WCAxisLabeller.h.

const casacore::String casa::WCAxisLabeller::PLOT_TITLE
static

Definition at line 272 of file WCAxisLabeller.h.

casacore::String casa::WCAxisLabeller::substituteTitleText
private

Definition at line 329 of file WCAxisLabeller.h.

Referenced by displayedTitleText().

casacore::Bool casa::WCAxisLabeller::titleChanged
protected

Definition at line 275 of file WCAxisLabeller.h.


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