casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
WorldAxesDD.h
Go to the documentation of this file.
1 //# WorldAxesDD.h: world axis labelling DisplayData
2 //# Copyright (C) 2000,2001,2003,2004
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 
28 #ifndef TRIALDISPLAY_WORLDAXESDD_H
29 #define TRIALDISPLAY_WORLDAXESDD_H
30 
31 #include <casa/aips.h>
33 
34 namespace casa { //# NAMESPACE CASA - BEGIN
35 
36  class DParameterChoice;
37 
38 // <summary>
39 // A DisplayData to setup a World coordinate plot
40 // </summary>
41 //
42 // <use visibility=export>
43 //
44 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
45 // </reviewed>
46 //
47 // <prerequisite>
48 // <li> DisplayData
49 // <li> AxesDisplayData
50 // </prerequisite>
51 //
52 // <etymology>
53 // </etymology>
54 // <synopsis>
55 //
56 // </synopsis>
57 
58  class WorldAxesDD : public AxesDisplayData {
59 
60  public:
61 
62  // Constructor.
63  WorldAxesDD();
64 
65  // Destructor.
66  virtual ~WorldAxesDD();
67 
68  // Install the default options for this DisplayData.
69  virtual void setDefaultOptions();
70 
71  // Apply options stored in <src>rec</src> to the DisplayData. A
72  // return value of <src>true</src> means a refresh is needed.
73  // <src>recOut</src> contains any fields which were implicitly
74  // changed as a result of the call to this function.
76 
77  // Retrieve the current and default options and parameter types.
78  virtual casacore::Record getOptions( bool scrub=false ) const;
79 
80  // Create a new AxesDisplayMethod for drawing on the given
81  // WorldCanvas when the AttributeBuffers are suitably matched to the
82  // current state of this DisplayData and of the WorldCanvas/Holder.
83  // The tag is a unique number used to identify the age of the newly
84  // constructed CachingDisplayMethod.
86  AttributeBuffer* wchAttributes,
87  AttributeBuffer* ddAttributes,
88  CachingDisplayData* dd);
89 
90  // Return the current options of this DisplayData as an
91  // AttributeBuffer.
93 
94  virtual casacore::String spectralUnit() const {
95  return itsParamSpectralUnit->value();
96  }
97 
98  virtual casacore::String velocityType() const {
99  return itsParamVelocityType->value();
100  }
101 
102  virtual casacore::String axisText(const WorldCanvas* wc, const casacore::uInt axisNo) const;
103  virtual casacore::String xAxisText(const WorldCanvas* wc=0) const;
104  virtual casacore::String yAxisText(const WorldCanvas* wc=0) const;
105 
106  // Pure virtual function from DisplayData...
108  return "label";
109  }
110 
111  std::string errorMessage( ) const { return ""; }
112 
113  protected:
114 
115  // (Required) copy constructor.
116  WorldAxesDD(const WorldAxesDD& other);
117 
118  // (Required) copy assignment.
119  void operator=(const WorldAxesDD& other);
120 
121  private:
122 
123  // Install the default options for this DisplayData.
124  void installDefaultOptions();
125 
126  // Set Spectral preference (options)
129 
130  };
131 
132 
133 } //# NAMESPACE CASA - END
134 
135 #endif
virtual casacore::Record getOptions(bool scrub=false) const
Retrieve the current and default options and parameter types.
Assistance class for auto-caching of DisplayData objects.
casacore::String dataType() const
Pure virtual function from DisplayData...
Definition: WorldAxesDD.h:107
virtual void setDefaultOptions()
Install the default options for this DisplayData.
Buffer for storing Attributes.
virtual casacore::String axisText(const WorldCanvas *wc, const casacore::uInt axisNo) const
virtual casacore::String xAxisText(const WorldCanvas *wc=0) const
Get the X and Y axis text Strings for labelling.
DParameterChoice * itsParamVelocityType
Definition: WorldAxesDD.h:128
void operator=(const WorldAxesDD &other)
(Required) copy assignment.
virtual casacore::String velocityType() const
Definition: WorldAxesDD.h:98
Interface and simple implementation of axis labelling.
A DisplayData to setup a World coordinate plot.
Definition: WorldAxesDD.h:58
Base class for auto-caching DisplayData objects.
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
DParameterChoice * itsParamSpectralUnit
Set Spectral preference (options)
Definition: WorldAxesDD.h:127
virtual AttributeBuffer optionsAsAttributes()
Return the current options of this DisplayData as an AttributeBuffer.
virtual CachingDisplayMethod * newDisplayMethod(WorldCanvas *worldCanvas, AttributeBuffer *wchAttributes, AttributeBuffer *ddAttributes, CachingDisplayData *dd)
Create a new AxesDisplayMethod for drawing on the given WorldCanvas when the AttributeBuffers are sui...
Implementation of DisplayParameter to store choice parameters.
std::string errorMessage() const
Definition: WorldAxesDD.h:111
WorldAxesDD()
Constructor.
Implementation of drawing in world coordinates on top of a PixelCanvas.
Definition: WorldCanvas.h:204
casacore::String value()
Return the current value of this parameter.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
virtual ~WorldAxesDD()
Destructor.
virtual casacore::Bool setOptions(casacore::Record &rec, casacore::Record &recOut)
Apply options stored in rec to the DisplayData.
virtual casacore::String spectralUnit() const
Definition: WorldAxesDD.h:94
void installDefaultOptions()
Install the default options for this DisplayData.
unsigned int uInt
Definition: aipstype.h:51
virtual casacore::String yAxisText(const WorldCanvas *wc=0) const