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