casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LatticePADMMarker.h
Go to the documentation of this file.
1 //# LatticePADMMarker.h: drawing axis bound lattice elements as Marker fields
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_LATTICEPADMMARKER_H
29 #define TRIALDISPLAY_LATTICEPADMMARKER_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  class WorldCanvas;
48  template <class T> class LatticePADisplayData;
49 
50 // <summary>
51 // Class to draw a single vector 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="LatticeAsMarker">LatticeAsMarker</linkto>
61 // </prerequisite>
62 //
63 // <etymology>
64 // The purpose of this class is to draw "vector" maps of data that
65 // are "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 LatticeAsMarker class. One or more
72 // instances of this class are created by a single LatticeAsMarker
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 LatticeAsMarker 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 LatticeAsMarker,
81 // in, for example, a support function for a constructor:
82 // <srcblock>
83 // void LatticeAsMarker::setupElements(casacore::IPosition fixedPos) {
84 // if (nPixelAxes > 2) {
85 // nImages = dataLattice()->shape()(zAxisNum);
86 // DDelement.resize(nImages);
87 // for (casacore::uInt index = 0; index < nImages; index++) {
88 // fixedPos(zAxisNum) = index;
89 // DDelement[index] = (LatticePADisplayMethod<casacore::Complex> *)new
90 // LatticePADMVector(dataLattice(), xAxisNum, yAxisNum,
91 // zAxisNum, fixedPos, this);
92 // }
93 // } else {
94 // nImages = 1;
95 // DDelement.resize(nImages);
96 // DDelement[0] = (LatticePADisplayMethod<casacore::Complex> *)new
97 // LatticePADMVector(dataLattice(), xAxisNum, yAxisNum, this);
98 // }
99 // }
100 // </srcblock>
101 // </example>
102 //
103 // <motivation>
104 // Displaying 2-dimensional slices of a lattice-based data volume is
105 // a standard display requirement for astronomical data visualization
106 // and presentation.
107 // </motivation>
108 //
109 // <thrown>
110 // </thrown>
111 //
112 // <todo asof="yyyy/mm/dd">
113 // </todo>
114 
115  template <class T> class LatticePADMMarker : public LatticePADisplayMethod<T> {
116 
117  public:
118 
119  // Constructors: >2d and 2d. xAxis and yAxis specify which axis in
120  // the casacore::Lattice (0-based) should be mapped to X and Y on the display
121  // device: ie. 2-d slices of the data to be displayed have these as
122  // axes. mAxis specifies the "movie" axis, which is the axis along
123  // which different slices are taken. fixedPos is an IPosition
124  // having the same length as the number of dimensions in the array,
125  // and indicates the fixed axis values for axes in the data that are
126  // not specified as xAxis or yAxis: indeed, <src>fixedPos(mAxis)</src>
127  // indicates which pixel value along the movie axis that this
128  // particular object looks after.
129  // <group>
130  LatticePADMMarker(const casacore::uInt xAxis,
131  const casacore::uInt yAxis, const casacore::uInt mAxis,
132  const casacore::IPosition fixedPos,
133  LatticePADisplayData<T>* arDat);
134  LatticePADMMarker(const casacore::uInt xAxis,
135  const casacore::uInt yAxis, LatticePADisplayData<T>* arDat);
136  // </group>
137 
138  // Destructor
139  virtual ~LatticePADMMarker();
140 
141  // Actually draw on the display device. The WorldCanvasHolder will
142  // tell the LatticeAsMarker that it should now draw, which will in
143  // turn determine which of its one or more LatticePADMVector objects
144  // should draw by matching the movie value on the WorldCanvas. The
145  // vector is drawn in the world coordinate range blc to trc.
146  virtual casacore::uInt dataDrawSelf(WorldCanvas *wCanvas,
149  const casacore::IPosition &start,
150  const casacore::IPosition &shape,
152  const casacore::Bool usePixelEdges = false);
153 
154  private:
155 //
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/LatticePADMMarker.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
Class to draw a single vector map of a slice from an AIPS++ Lattice.
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: ...
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.
ABSTRACT CLASSES Deliberately vague to be general enough to allow for many different types of data
Definition: PlotData.h:48
virtual ~LatticePADMMarker()
Destructor.
casacore::Matrix< casacore::Float > getAmplitude(const casacore::Matrix< T > &data) const
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
Partial implementation of PrincipalAxesDD for casacore::Lattice-based data.
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
Definition: ExprNode.h:1944
Implementation of drawing in world coordinates on top of a PixelCanvas.
Definition: WorldCanvas.h:204
unsigned int uInt
Definition: aipstype.h:51
LatticePADMMarker(const casacore::uInt xAxis, const casacore::uInt yAxis, const casacore::uInt mAxis, const casacore::IPosition fixedPos, LatticePADisplayData< T > *arDat)
Constructors: &gt;2d and 2d.
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42