casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PGPlotterLocal.h
Go to the documentation of this file.
1 //# PGPlotterLocal.h: Plot to a PGPLOT device "local" to this process.
2 //# Copyright (C) 1997,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 //#
27 //# $Id$
28 
29 #ifndef GRAPHICS_PGPLOTTERLOCAL_H
30 #define GRAPHICS_PGPLOTTERLOCAL_H
31 
32 #include <casa/aips.h>
33 #include <casa/System/PGPlotter.h>
34 
35 namespace casacore{
36 
37 class String;
38 template<class T> class Vector;
39 }
40 
41 namespace casa { //# NAMESPACE CASA - BEGIN
42 
43 
44 // <summary>
45 // Plot to a PGPLOT device "local" to this process.
46 // </summary>
47 
48 // <use visibility=export>
49 
50 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
51 // </reviewed>
52 
53 // <prerequisite>
54 // <li> <linkto class="casacore::PGPlotterInterface">casacore::PGPlotterInterface</linkto>
55 // </prerequisite>
56 //
57 // <etymology>
58 // "Local" is used to denote that the actuall plotting is done by PGPLOT calls
59 // linked into this executable, as opposed to the common case where the PGPLOT
60 // calls are sent over the Glish bus to a "remote" display.
61 // </etymology>
62 //
63 // <synopsis>
64 // Generally programmers should not use this class, instead they should use
65 // <linkto class="casacore::PGPlotter">casacore::PGPlotter</linkto> instead.
66 //
67 // This class make a concrete
68 // <linkto class="casacore::PGPlotterInterface">casacore::PGPlotterInterface</linkto> object which
69 // calls PGPLOT directly, i.e. PGPLOT is linked into the current executable.
70 // </synopsis>
71 //
72 // <example>
73 // <srcblock>
74 // // plot y = x*x
75 // casacore::Vector<casacore::Float> x(100), y(100);
76 // indgen(x);
77 // y = x*x;
78 
79 // PGPlotterLocal plotter("myplot.ps/ps");
80 // plotter.env(0, 100, 0, 100*100, 0, 0);
81 // plotter.line(x, y);
82 // </srcblock>
83 // </example>
84 //
85 // <motivation>
86 // It might be necessary to call PGPLOT directly in some circumstances. For
87 // example, it might be too inefficient to pass a lot of Image data over the
88 // glish bus.
89 // </motivation>
90 //
91 // <todo asof="1997/12/31">
92 // <li> Add more plot calls.
93 // </todo>
94 
96 {
97 public:
98  // Open "device", which must be a valid PGPLOT style device, for example
99  // <src>/cps</src> for colour postscript (or <src>myfile.ps/cps</src>
100  // if you want to name the file), or <src>/xs</src> or <src>/xw</src> for
101  // and X-windows display.
102  // <thrown>
103  // <li> An <linkto class="casacore::AipsError">casacore::AipsError</linkto> will be thrown
104  // if the underlying PGPLOT open fails for some reason.
105  // </thrown>
106  PGPlotterLocal(const casacore::String &device);
107  // The destructor closes the pgplot device.
108  virtual ~PGPlotterLocal();
109 
110  // The create function to create a casacore::PGPlotter object using a PGPlotterLocal.
111  // It only uses the device argument.
112  static casacore::PGPlotter createPlotter (const casacore::String &device,
114 
115  // This is an emulated standard PGPLOT command. It returns a record
116  // containing the fields:
117  // <srcblock>
118  // [ok=casacore::Bool, x=casacore::Float, y=casacore::Float, ch=casacore::String];
119  // If the remote device cannot do cursor feedback, ok==F.
120  // </srcblock>
122 
123 
124  // Standard PGPLOT commands. Documentation for the individual commands
125  // can be found in the Glish manual and in the standard PGPLOT documentation
126  // which may be found at <src>http://astro.caltech.edu/~tjp/pgplot/</src>.
127  // The Glish/PGPLOT documentation is preferred since this interface follows
128  // it exactly (e.g. the array sizes are inferred both here and in Glish,
129  // whereas they must be passed into standard PGPLOT).
130  // <group>
132  virtual void ask(casacore::Bool flag);
133  virtual void bbuf();
135  casacore::Bool center);
136  virtual void box(const casacore::String &xopt, casacore::Float xtick, casacore::Int nxsub,
137  const casacore::String &yopt, casacore::Float ytick, casacore::Int nysub);
138  virtual void circ(casacore::Float xcent, casacore::Float ycent, casacore::Float radius);
141  virtual void conl(const casacore::Matrix<casacore::Float> &a, casacore::Float c,
142  const casacore::Vector<casacore::Float> &tr, const casacore::String &label,
143  casacore::Int intval, casacore::Int minint);
150  casacore::Float contra, casacore::Float bright);
151  virtual void draw(casacore::Float x, casacore::Float y);
152  virtual void ebuf();
153  virtual void env(casacore::Float xmin, casacore::Float xmax, casacore::Float ymin, casacore::Float ymax, casacore::Int just,
154  casacore::Int axis);
155  virtual void eras();
165  casacore::Int ioff, casacore::Float bias, casacore::Bool center,
166  const casacore::Vector<casacore::Float> &ylims);
167  virtual void hist(const casacore::Vector<casacore::Float> &data, casacore::Float datmin, casacore::Float datmax,
168  casacore::Int nbin, casacore::Int pcflag);
169  virtual void iden();
172  virtual void lab(const casacore::String &xlbl, const casacore::String &ylbl,
173  const casacore::String &toplbl);
174  virtual void ldev();
176  virtual void line(const casacore::Vector<casacore::Float> &xpts, const casacore::Vector<casacore::Float> &ypts);
177  virtual void move(casacore::Float x, casacore::Float y);
178  virtual void mtxt(const casacore::String &side, casacore::Float disp, casacore::Float coord, casacore::Float fjust,
179  const casacore::String &text);
181  virtual void page();
182  virtual void panl(casacore::Int ix, casacore::Int iy);
183  virtual void pap(casacore::Float width, casacore::Float aspect);
187  const casacore::Vector<casacore::Int> symbol);
188  virtual void poly(const casacore::Vector<casacore::Float> &xpts, const casacore::Vector<casacore::Float> &ypts);
189  virtual void pt(const casacore::Vector<casacore::Float> &xpts, const casacore::Vector<casacore::Float> &ypts,
190  casacore::Int symbol);
191  virtual void ptxt(casacore::Float x, casacore::Float y, casacore::Float angle, casacore::Float fjust,
192  const casacore::String &text);
194  virtual casacore::Int qcf();
195  virtual casacore::Float qch();
196  virtual casacore::Int qci();
201  virtual casacore::Int qfs();
203  virtual casacore::Int qid();
204  virtual casacore::String qinf(const casacore::String &item);
205  virtual casacore::Int qitf();
206  virtual casacore::Int qls();
207  virtual casacore::Int qlw();
209  virtual casacore::Int qtbg();
211  const casacore::String &text);
218  virtual void sah(casacore::Int fs, casacore::Float angle, casacore::Float vent);
219  virtual void save();
220  virtual void scf(casacore::Int font);
221  virtual void sch(casacore::Float size);
222  virtual void sci(casacore::Int ci);
223  virtual void scir(casacore::Int icilo, casacore::Int icihi);
224  virtual void scr(casacore::Int ci, casacore::Float cr, casacore::Float cg, casacore::Float cb);
225  virtual void scrn(casacore::Int ci, const casacore::String &name);
226  virtual void sfs(casacore::Int fs);
228  virtual void shs(casacore::Float angle, casacore::Float sepn, casacore::Float phase);
229  virtual void sitf(casacore::Int itf);
230  virtual void sls(casacore::Int ls);
231  virtual void slw(casacore::Int lw);
232  virtual void stbg(casacore::Int tbci);
233  virtual void subp(casacore::Int nxsub, casacore::Int nysub);
234  virtual void svp(casacore::Float xleft, casacore::Float xright, casacore::Float ybot, casacore::Float ytop);
236  virtual void tbox(const casacore::String &xopt, casacore::Float xtick, casacore::Int nxsub,
237  const casacore::String &yopt, casacore::Float ytick, casacore::Int nysub);
238  virtual void text(casacore::Float x, casacore::Float y, const casacore::String &text);
239  virtual void unsa();
240  virtual void updt();
244  virtual void vsiz(casacore::Float xleft, casacore::Float xright, casacore::Float ybot,
245  casacore::Float ytop);
246  virtual void vstd();
247  virtual void wedg(const casacore::String &side, casacore::Float disp, casacore::Float width,
248  casacore::Float fg, casacore::Float bg, const casacore::String &label);
250  // </group>
251 
252  private:
253  // Undefined and inaccessible
256 
257  // PGPLOT id
258  int id_p;
259 };
260 
261 
262 
263 } //# NAMESPACE CASA - END
264 
265 #endif
virtual void stbg(casacore::Int tbci)
virtual void swin(casacore::Float x1, casacore::Float x2, casacore::Float y1, casacore::Float y2)
virtual void sch(casacore::Float size)
int Int
Definition: aipstype.h:50
Plot to a PGPLOT device &quot;local&quot; to this process.
virtual casacore::Vector< casacore::Float > len(casacore::Int units, const casacore::String &string)
std::vector< double > Vector
Definition: ds9context.h:24
virtual casacore::Record curs(casacore::Float x, casacore::Float y)
This is an emulated standard PGPLOT command.
virtual void conb(const casacore::Matrix< casacore::Float > &a, const casacore::Vector< casacore::Float > &c, const casacore::Vector< casacore::Float > &tr, casacore::Float blank)
virtual void vect(const casacore::Matrix< casacore::Float > &a, const casacore::Matrix< casacore::Float > &b, casacore::Float c, casacore::Int nc, const casacore::Vector< casacore::Float > &tr, casacore::Float blank)
virtual casacore::Vector< casacore::Float > qvp(casacore::Int units)
virtual void updt()
virtual casacore::Vector< casacore::Float > qwin()
virtual void text(casacore::Float x, casacore::Float y, const casacore::String &text)
virtual void erry(const casacore::Vector< casacore::Float > &x, const casacore::Vector< casacore::Float > &y1, const casacore::Vector< casacore::Float > &y2, casacore::Float t)
virtual void wnad(casacore::Float x1, casacore::Float x2, casacore::Float y1, casacore::Float y2)
virtual void lab(const casacore::String &xlbl, const casacore::String &ylbl, const casacore::String &toplbl)
virtual void hist(const casacore::Vector< casacore::Float > &data, casacore::Float datmin, casacore::Float datmax, casacore::Int nbin, casacore::Int pcflag)
virtual void pap(casacore::Float width, casacore::Float aspect)
TableExprNode phase(const TableExprNode &node)
The phase (i.e.
Definition: ExprNode.h:1405
virtual void move(casacore::Float x, casacore::Float y)
virtual void vstd()
virtual casacore::Vector< casacore::Float > qpos()
virtual casacore::Vector< casacore::Int > qcir()
virtual void unsa()
Abstract base class for PGPLOT style plotting.
virtual void rect(casacore::Float x1, casacore::Float x2, casacore::Float y1, casacore::Float y2)
PGPlotterLocal(const casacore::String &device)
Open &quot;device&quot;, which must be a valid PGPLOT style device, for example /cps for colour postscript (or ...
virtual casacore::Int qid()
virtual void pixl(const casacore::Matrix< casacore::Int > &ia, casacore::Float x1, casacore::Float x2, casacore::Float y1, casacore::Float y2)
virtual casacore::Int qcf()
virtual casacore::Int qls()
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the if a human readable name(i.e."black").In many places throughout the plotter
virtual void imag(const casacore::Matrix< casacore::Float > &a, casacore::Float a1, casacore::Float a2, const casacore::Vector< casacore::Float > &tr)
size_t size() const
virtual void mtxt(const casacore::String &side, casacore::Float disp, casacore::Float coord, casacore::Float fjust, const casacore::String &text)
virtual casacore::Int qitf()
virtual casacore::String qinf(const casacore::String &item)
virtual casacore::Int qfs()
virtual void subp(casacore::Int nxsub, casacore::Int nysub)
ABSTRACT CLASSES Deliberately vague to be general enough to allow for many different types of data
Definition: PlotData.h:48
virtual void svp(casacore::Float xleft, casacore::Float xright, casacore::Float ybot, casacore::Float ytop)
virtual ~PGPlotterLocal()
The destructor closes the pgplot device.
virtual casacore::Vector< casacore::Float > rnge(casacore::Float x1, casacore::Float x2)
virtual void gray(const casacore::Matrix< casacore::Float > &a, casacore::Float fg, casacore::Float bg, const casacore::Vector< casacore::Float > &tr)
virtual void iden()
virtual casacore::String numb(casacore::Int mm, casacore::Int pp, casacore::Int form)
virtual void cont(const casacore::Matrix< casacore::Float > &a, const casacore::Vector< casacore::Float > &c, casacore::Bool nc, const casacore::Vector< casacore::Float > &tr)
virtual void shls(casacore::Int ci, casacore::Float ch, casacore::Float cl, casacore::Float cs)
virtual void circ(casacore::Float xcent, casacore::Float ycent, casacore::Float radius)
virtual casacore::Vector< casacore::Float > qvsz(casacore::Int units)
virtual void ask(casacore::Bool flag)
virtual void line(const casacore::Vector< casacore::Float > &xpts, const casacore::Vector< casacore::Float > &ypts)
virtual void cons(const casacore::Matrix< casacore::Float > &a, const casacore::Vector< casacore::Float > &c, const casacore::Vector< casacore::Float > &tr)
virtual void ctab(const casacore::Vector< casacore::Float > &l, const casacore::Vector< casacore::Float > &r, const casacore::Vector< casacore::Float > &g, const casacore::Vector< casacore::Float > &b, casacore::Float contra, casacore::Float bright)
virtual void pnts(const casacore::Vector< casacore::Float > &x, const casacore::Vector< casacore::Float > &y, const casacore::Vector< casacore::Int > symbol)
virtual void arro(casacore::Float x1, casacore::Float y1, casacore::Float x2, casacore::Float y2)
Standard PGPLOT commands.
virtual void shs(casacore::Float angle, casacore::Float sepn, casacore::Float phase)
virtual void sitf(casacore::Int itf)
int id_p
PGPLOT id.
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
virtual casacore::Vector< casacore::Float > qcr(casacore::Int ci)
virtual void panl(casacore::Int ix, casacore::Int iy)
virtual void ptxt(casacore::Float x, casacore::Float y, casacore::Float angle, casacore::Float fjust, const casacore::String &text)
virtual void tbox(const casacore::String &xopt, casacore::Float xtick, casacore::Int nxsub, const casacore::String &yopt, casacore::Float ytick, casacore::Int nysub)
virtual casacore::Float rnd(casacore::Float x, casacore::Int nsub)
virtual void sls(casacore::Int ls)
float Float
Definition: aipstype.h:54
virtual void page()
virtual void vsiz(casacore::Float xleft, casacore::Float xright, casacore::Float ybot, casacore::Float ytop)
Standard plotting object for application programmers.
Definition: PGPlotter.h:95
virtual void ldev()
virtual void slw(casacore::Int lw)
virtual casacore::Float qch()
virtual void errx(const casacore::Vector< casacore::Float > &x1, const casacore::Vector< casacore::Float > &x2, const casacore::Vector< casacore::Float > &y, casacore::Float t)
virtual void poly(const casacore::Vector< casacore::Float > &xpts, const casacore::Vector< casacore::Float > &ypts)
virtual void errb(casacore::Int dir, const casacore::Vector< casacore::Float > &x, const casacore::Vector< casacore::Float > &y, const casacore::Vector< casacore::Float > &e, casacore::Float t)
virtual void box(const casacore::String &xopt, casacore::Float xtick, casacore::Int nxsub, const casacore::String &yopt, casacore::Float ytick, casacore::Int nysub)
virtual casacore::Int qlw()
static casacore::PGPlotter createPlotter(const casacore::String &device, casacore::uInt, casacore::uInt, casacore::uInt, casacore::uInt)
The create function to create a casacore::PGPlotter object using a PGPlotterLocal.
const Double e
e and functions thereof:
virtual void sci(casacore::Int ci)
virtual void wedg(const casacore::String &side, casacore::Float disp, casacore::Float width, casacore::Float fg, casacore::Float bg, const casacore::String &label)
PGPlotterLocal & operator=(const PGPlotterLocal &)
virtual void env(casacore::Float xmin, casacore::Float xmax, casacore::Float ymin, casacore::Float ymax, casacore::Int just, casacore::Int axis)
const Double c
Fundamental physical constants (SI units):
virtual casacore::Int qci()
virtual void ebuf()
virtual void scr(casacore::Int ci, casacore::Float cr, casacore::Float cg, casacore::Float cb)
virtual casacore::Vector< casacore::Float > qcs(casacore::Int units)
virtual void sfs(casacore::Int fs)
String: the storage and methods of handling collections of characters.
Definition: String.h:223
virtual casacore::Vector< casacore::Float > qah()
virtual casacore::Int qtbg()
virtual casacore::Vector< casacore::Int > qcol()
virtual casacore::Vector< casacore::Float > qhs()
virtual void pt(const casacore::Vector< casacore::Float > &xpts, const casacore::Vector< casacore::Float > &ypts, casacore::Int symbol)
virtual void eras()
virtual void sah(casacore::Int fs, casacore::Float angle, casacore::Float vent)
virtual void scir(casacore::Int icilo, casacore::Int icihi)
virtual void bbuf()
virtual void draw(casacore::Float x, casacore::Float y)
virtual void scf(casacore::Int font)
virtual void save()
virtual void conl(const casacore::Matrix< casacore::Float > &a, casacore::Float c, const casacore::Vector< casacore::Float > &tr, const casacore::String &label, casacore::Int intval, casacore::Int minint)
virtual casacore::Vector< casacore::Float > qtxt(casacore::Float x, casacore::Float y, casacore::Float angle, casacore::Float fjust, const casacore::String &text)
virtual void hi2d(const casacore::Matrix< casacore::Float > &data, const casacore::Vector< casacore::Float > &x, casacore::Int ioff, casacore::Float bias, casacore::Bool center, const casacore::Vector< casacore::Float > &ylims)
unsigned int uInt
Definition: aipstype.h:51
virtual void bin(const casacore::Vector< casacore::Float > &x, const casacore::Vector< casacore::Float > &data, casacore::Bool center)
virtual void scrn(casacore::Int ci, const casacore::String &name)
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42