casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
WedgeDD.h
Go to the documentation of this file.
1 //# WedgeDD.h: Color Wedge DisplayData
2 //# Copyright (C) 2001,2002
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 
27 #ifndef TRIALDISPLAY_WEDGEDD_H
28 #define TRIALDISPLAY_WEDGEDD_H
29 
30 #include <casa/aips.h>
34 
35 namespace casacore{
36 
37  template <class T> class Matrix;
38 }
39 
40 namespace casa { //# NAMESPACE CASA - BEGIN
41 
42  class WCPowerScaleHandler;
43 
44  class WedgeDM;
45 
46 // <summary>
47 // A DisplayData to draw color wedges
48 // </summary>
49 //
50 // <use visibility=export>
51 //
52 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
53 // </reviewed>
54 //
55 // <prerequisite>
56 // <li> DisplayData
57 // </li> CachingDisplayData
58 // </prerequisite>
59 //
60 // <etymology>
61 // </etymology>
62 //
63 // <synopsis> This DisplayData can be created by itself. It's main
64 // task though is to set up a coordinate system form the data range
65 // and units of another DisplayData. The user can control this through
66 // options in this DisplayData: "datamin", "datamax, "dataunit" and
67 // "powercycles".
68 
69 // </synopsis>
70 //
71 // <example>
72 // <srcBlock>
73 // </srcBlock>
74 // </example>
75 //
76 // <motivation>
77 // Users want wedges
78 //</motivation>
79 //
80 // <todo>
81 // Transposed wedges
82 // </todo>
83 //
84 
85  class WedgeDD : public ActiveCaching2dDD {
86 
87  public:
88 
89  WedgeDD( DisplayData *image );
90 
91  // Destructor.
92  virtual ~WedgeDD();
93 
94  // Constructor help function, creates coordinatesystem and fills data Matrix
95  virtual void setup();
96 
97  // The coordinate sydtem needs to be update when the data range changes
98  virtual void updateCsys();
99 
100  // Axis labeller, 5th step in the WCHolder refresh cycle
101  virtual casacore::Bool labelAxes(const WCRefreshEvent &ev);
102  virtual casacore::Bool canLabelAxes() const;
103  bool isDisplayable( ) const;
104 
105  // Return the data unit.
106  virtual const casacore::Unit dataUnit() const;
108  return casacore::IPosition( );
109  }
111  return 0;
112  }
113  std::vector<int> displayAxes( ) const {
114  return std::vector<int>( );
115  }
116 
117  // casacore::Format the wedge value at the given world position.
119 
120  // Install the default options for this DisplayData.
121  virtual void setDefaultOptions();
122 
123  // Apply options stored in <src>rec</src> to the DisplayData. A
124  // return value of <src>true</src> means a refresh is needed.
125  // <src>recOut</src> contains any fields which were implicitly
126  // changed as a result of the call to this function.
128 
129  // Retrieve the current and default options and parameter types.
130  virtual casacore::Record getOptions( bool scrub=false ) const;
131 
132  // Return the type of this DisplayData.
134  return Display::Raster;
135  }
136  // Pure virtual function from DisplayData...
138  return "wedge";
139  }
140 
141  // Create a new AxesDisplayMethod for drawing on the given
142  // WorldCanvas when the AttributeBuffers are suitably matched to the
143  // current state of this DisplayData and of the WorldCanvas/Holder.
144  // The tag is a unique number used to identify the age of the newly
145  // constructed CachingDisplayMethod.
146  virtual CachingDisplayMethod *newDisplayMethod(WorldCanvas *worldCanvas,
147  AttributeBuffer *wchAttributes,
148  AttributeBuffer *ddAttributes,
149  CachingDisplayData *dd);
150 
151  // Return the current options of this DisplayData as an
152  // AttributeBuffer.
154 
155  // Take actions on removal from WC[H] (notably, deletion of drawlists).
156  virtual void notifyUnregister(WorldCanvasHolder& wcHolder,
157  casacore::Bool ignoreRefresh = false);
158 
160 
161  std::string errorMessage( ) const { return ""; }
162 
163  protected:
164 
165 
166 
167  private:
168  // (Required) copy constructor.
169  WedgeDD(const WedgeDD &other);
170 
171  // (Required) copy assignment.
172  void operator=(const WedgeDD &other);
173  friend class WedgeDM;
174  // casacore::Data minimum and maximum to set up the coordinate system
176  // the length of the Vector
178  // the unit of the input data
180  //<group>
181  // the power law adjustment for for the scle handler
184 
186  //</group>
187  // the axis labeller
189  // The actual colorbar data
191  // the local coordinate system - gets exported to the parent DD
193 
195  };
196 
197 
198 } //# NAMESPACE CASA - END
199 
200 #endif
virtual casacore::Record getOptions(bool scrub=false) const
Retrieve the current and default options and parameter types.
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
Class providing active behaviour for 2d CachingDisplayDatas.
virtual Display::DisplayDataType classType()
Return the type of this DisplayData.
Definition: WedgeDD.h:133
Assistance class for auto-caching of DisplayData objects.
Class which stores WorldCanvas refresh event information.
virtual casacore::String showValue(const casacore::Vector< casacore::Double > &world)
casacore::Format the wedge value at the given world position.
virtual casacore::Bool labelAxes(const WCRefreshEvent &ev)
Axis labeller, 5th step in the WCHolder refresh cycle.
WCCSNLAxisLabeller itsAxisLabeller
the axis labeller
Definition: WedgeDD.h:188
DisplayDataType
WorldCanvasHolder - what type of DisplayData is this, need to know for drawing order.
Definition: DisplayEnums.h:355
Buffer for storing Attributes.
std::string errorMessage() const
Definition: WedgeDD.h:161
virtual casacore::Bool setOptions(casacore::Record &rec, casacore::Record &recOut)
Apply options stored in rec to the DisplayData.
virtual void notifyUnregister(WorldCanvasHolder &wcHolder, casacore::Bool ignoreRefresh=false)
Take actions on removal from WC[H] (notably, deletion of drawlists).
casacore::Float itsPowerCycles
the power law adjustment for for the scle handler
Definition: WedgeDD.h:182
virtual AttributeBuffer optionsAsAttributes()
Return the current options of this DisplayData as an AttributeBuffer.
WCPowerScaleHandler * itsPowerScaleHandler
Definition: WedgeDD.h:183
static const casacore::String WEDGE_PREFIX
Definition: WedgeDD.h:159
casacore::String itsOptionsMode
Definition: WedgeDD.h:185
void operator=(const WedgeDD &other)
(Required) copy assignment.
bool isDisplayable() const
defines physical units
Definition: Unit.h:189
virtual void setup()
Constructor help function, creates coordinatesystem and fills data Matrix.
virtual void updateCsys()
The coordinate sydtem needs to be update when the data range changes.
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...
virtual const casacore::Unit dataUnit() const
Return the data unit.
Base class for auto-caching DisplayData objects.
WedgeDD(DisplayData *image)
Class which provides non-linear axis labelling using a DisplayCoordinateSystem.
virtual ~WedgeDD()
Destructor.
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
Rastered data - should go first.
Definition: DisplayEnums.h:357
float Float
Definition: aipstype.h:54
DisplayCoordinateSystem itsCoordinateSystem
the local coordinate system - gets exported to the parent DD
Definition: WedgeDD.h:192
The DisplayMethod to draw Wedges.
Definition: WedgeDM.h:68
A holder to interface between DisplayDatas and a WorldCanvas.
Implementation of drawing in world coordinates on top of a PixelCanvas.
Definition: WorldCanvas.h:204
A DisplayData to draw color wedges.
Definition: WedgeDD.h:85
casacore::Matrix< casacore::Float > itsColorbar
The actual colorbar data.
Definition: WedgeDD.h:190
casacore::uInt itsLength
the length of the Vector
Definition: WedgeDD.h:177
String: the storage and methods of handling collections of characters.
Definition: String.h:223
casacore::String itsDataUnit
the unit of the input data
Definition: WedgeDD.h:179
virtual void setDefaultOptions()
Install the default options for this DisplayData.
virtual casacore::Bool canLabelAxes() const
Base class for display objects.
Definition: DisplayData.h:317
std::vector< int > displayAxes() const
Definition: WedgeDD.h:113
DlHandle< DisplayData > ihandle_
Definition: WedgeDD.h:194
Linear, logarithmic and exponential scaling of data for the WorldCanvas.
casacore::String dataType() const
Pure virtual function from DisplayData...
Definition: WedgeDD.h:137
casacore::Float itsMax
Definition: WedgeDD.h:175
casacore::Float itsMin
casacore::Data minimum and maximum to set up the coordinate system
Definition: WedgeDD.h:175
unsigned int uInt
Definition: aipstype.h:51
casacore::uInt dataDim() const
Definition: WedgeDD.h:110
const casacore::IPosition dataShape() const
Definition: WedgeDD.h:107
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42