casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LatticePADMContour.h
Go to the documentation of this file.
1 //# LatticePADMContour.h: drawing axis bound lattice elements as contours
2 //# Copyright (C) 1996,1997,1998,1999,2000,2001
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_LATTICEPADMCONTOUR_H
29 #define TRIALDISPLAY_LATTICEPADMCONTOUR_H
30 
31 //# aips includes:
32 #include <casa/aips.h>
33 
34 //# display library includes:
36 
37 namespace casacore{
38 
39  class IPosition;
40  template <class T> class Vector;
41  template <class T> class Matrix;
42 }
43 
44 namespace casa { //# NAMESPACE CASA - BEGIN
45 
46 //# forwards:
47  template <class T> class LatticeAsContour;
48  class WorldCanvas;
49 
50 // <summary>
51 // Class to draw a single contour map of a slice from an AIPS++ Lattice.
52 // </summary>
53 //
54 // <use visibility=local>
55 //
56 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
57 // </reviewed>
58 //
59 // <prerequisite>
60 // <li> <linkto class="LatticeAsContour">LatticeAsContour</linkto>
61 // </prerequisite>
62 //
63 // <etymology>
64 // The purpose of this class is to draw "contour" maps of data that
65 // is "lattice"-based. The "PADM" refers to PrincipalAxesDisplayMethod,
66 // meaning that one or more instances of this class are used to actually
67 // draw slices of a casacore::Lattice along its main axes.
68 // </etymology>
69 //
70 // <synopsis>
71 // This is a helper class for the LatticeAsContour class. One or more
72 // instances of this class are created by a single LatticeAsContour
73 // object, each being responsible for drawing a different slice of the
74 // data.
75 // </synopsis>
76 //
77 // <example>
78 // This class should only be used by the LatticeAsContour class to
79 // setup a number of views of an AIPS++ Image or Array. As such, this
80 // example simply outlines how this class is used by LatticeAsContour,
81 // in, for example, a support function for a constructor:
82 // <srcblock>
83 // template <class T>
84 // void LatticeAsContour<T>::setupElements(casacore::IPosition fixedPos) {
85 // if (nPixelAxes > 2) {
86 // nImages = dataLattice()->shape()(zAxisNum);
87 // DDelement.resize(nImages);
88 // for (casacore::uInt index = 0; index < nImages; index++) {
89 // fixedPos(zAxisNum) = index;
90 // DDelement[index] = (LatticePADisplayMethod<T> *)new
91 // LatticePADMContour<T>(dataLattice(), xAxisNum, yAxisNum,
92 // zAxisNum, fixedPos, this);
93 // }
94 // } else {
95 // nImages = 1;
96 // DDelement.resize(nImages);
97 // DDelement[0] = (LatticePADisplayMethod<T> *)new
98 // LatticePADMContour<T>(dataLattice(), xAxisNum, yAxisNum, this);
99 // }
100 // }
101 // </srcblock>
102 // </example>
103 //
104 // <motivation>
105 // Displaying 2-dimensional slices of a lattice-based data volume is
106 // a standard display requirement for astronomical data visualization
107 // and presentation.
108 // </motivation>
109 //
110 // <templating arg=T>
111 // </templating>
112 //
113 // <thrown>
114 // </thrown>
115 //
116 // <todo asof="yyyy/mm/dd">
117 // </todo>
118 
119  template <class T> class LatticePADMContour : public LatticePADisplayMethod<T> {
120 
121  public:
122 
123  // Constructors: >2d and 2d. xAxis and yAxis specify which axis in
124  // the casacore::Lattice (0-based) should be mapped to X and Y on the display
125  // device: ie. 2-d slices of the data to be displayed have these as
126  // axes. mAxis specifies the "movie" axis, which is the axis along
127  // which different slices are taken. fixedPos is an IPosition
128  // having the same length as the number of dimensions in the array,
129  // and indicates the fixed axis values for axes in the data that are
130  // not specified as xAxis or yAxis: indeed, <src>fixedPos(mAxis)</src>
131  // indicates which pixel value along the movie axis that this
132  // particular object looks after.
133  // <group>
135  const casacore::uInt yAxis, const casacore::uInt mAxis,
136  const casacore::IPosition fixedPos,
137  LatticeAsContour<T> *arDat);
139  const casacore::uInt yAxis, LatticeAsContour<T> *arDat);
140  // </group>
141 
142  // Destructor
143  virtual ~LatticePADMContour();
144 
145  // Actually draw on the display device. The WorldCanvasHolder will
146  // tell the LatticeAsRaster that it should now draw, which will in
147  // turn determine which of its one or more LatticePADMRaster objects
148  // should draw by matching the movie value on the WorldCanvas. The
149  // contour is drawn from world coordinate blc to trc.
150  virtual casacore::uInt dataDrawSelf(WorldCanvas *wCanvas,
153  const casacore::IPosition &start,
154  const casacore::IPosition &shape,
156  const casacore::Bool usePixelEdges = false);
157 
158  //# Make parent members known.
159  protected:
161  };
162 
163 
164 } //# NAMESPACE CASA - END
165 
166 #ifndef AIPS_NO_TEMPLATE_SRC
167 #include <display/DisplayDatas/LatticePADMContour.tcc>
168 #endif //# AIPS_NO_TEMPLATE_SRC
169 #endif
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
std::vector< double > Vector
Definition: ds9context.h:24
Partial implementation of PrincipalAxesDM for casacore::Lattice-based data.
Definition: LatticePADM.h:58
casacore::IPosition start
Some data members which all display elements along principal axes will play around with: ...
virtual ~LatticePADMContour()
Destructor.
casacore::IPosition stride
virtual casacore::uInt dataDrawSelf(WorldCanvas *wCanvas, const casacore::Vector< casacore::Double > &blc, const casacore::Vector< casacore::Double > &trc, const casacore::IPosition &start, const casacore::IPosition &shape, const casacore::IPosition &stride, const casacore::Bool usePixelEdges=false)
Actually draw on the display device.
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
Definition: ExprNode.h:1944
Class to manage the drawing of contour maps of slices from AIPS++ Lattices.
Implementation of drawing in world coordinates on top of a PixelCanvas.
Definition: WorldCanvas.h:204
LatticePADMContour(const casacore::uInt xAxis, const casacore::uInt yAxis, const casacore::uInt mAxis, const casacore::IPosition fixedPos, LatticeAsContour< T > *arDat)
Constructors: &gt;2d and 2d.
Class to draw a single contour map of a slice from an AIPS++ Lattice.
unsigned int uInt
Definition: aipstype.h:51
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42