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