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{
88public:
89 // Open "device", which must be a valid PGPLOT style device, for example
90 // <src>/cps</src> for colour postscript (or <src>myfile.ps/cps</src>
91 // if you want to name the file), or <src>/xs</src> or <src>/xw</src> for
92 // and X-windows display.
93 // <thrown>
94 // <li> An <linkto class="AipsError">AipsError</linkto> will be thrown
95 // if the underlying PGPLOT open fails for some reason.
96 // </thrown>
97 PGPlotterNull(const String &device);
98 // The destructor closes the pgplot device.
99 virtual ~PGPlotterNull();
100
101 // The create function to create a PGPlotter object using a PGPlotterNull.
102 // It only uses the device argument.
103 static PGPlotter createPlotter (const String &device,
104 uInt, uInt, uInt, uInt);
105
106 // This is an emulated standard PGPLOT command. It returns a record
107 // containing the fields:
108 // <srcblock>
109 // [ok=Bool, x=Float, y=Float, ch=String];
110 // If the remote device cannot do cursor feedback, ok==F.
111 // </srcblock>
112 virtual Record curs(Float x, Float y);
113
114
115 // Standard PGPLOT commands. Documentation for the individual commands
116 // can be found in the Glish manual and in the standard PGPLOT documentation
117 // which may be found at <src>http://astro.caltech.edu/~tjp/pgplot/</src>.
118 // The Glish/PGPLOT documentation is preferred since this interface follows
119 // it exactly (e.g. the array sizes are inferred both here and in Glish,
120 // whereas they must be passed into standard PGPLOT).
121 // <group>
122 virtual void arro(Float x1, Float y1, Float x2, Float y2);
123 virtual void ask(Bool flag);
124 virtual void bbuf();
125 virtual void bin(const Vector<Float> &x, const Vector<Float> &data,
126 Bool center);
127 virtual void box(const String &xopt, Float xtick, Int nxsub,
128 const String &yopt, Float ytick, Int nysub);
129 virtual void circ(Float xcent, Float ycent, Float radius);
130 virtual void conb(const Matrix<Float> &a, const Vector<Float> &c,
131 const Vector<Float> &tr, Float blank);
132 virtual void conl(const Matrix<Float> &a, Float c,
133 const Vector<Float> &tr, const String &label,
134 Int intval, Int minint);
135 virtual void cons(const Matrix<Float> &a, const Vector<Float> &c,
136 const Vector<Float> &tr);
137 virtual void cont(const Matrix<Float> &a, const Vector<Float> &c,
138 Bool nc, const Vector<Float> &tr);
139 virtual void ctab(const Vector<Float> &l, const Vector<Float> &r,
140 const Vector<Float> &g, const Vector<Float> &b,
141 Float contra, Float bright);
142 virtual void draw(Float x, Float y);
143 virtual void ebuf();
144 virtual void env(Float xmin, Float xmax, Float ymin, Float ymax, Int just,
145 Int axis);
146 virtual void eras();
147 virtual void errb(Int dir, const Vector<Float> &x, const Vector<Float> &y,
148 const Vector<Float> &e, Float t);
149 virtual void errx(const Vector<Float> &x1, const Vector<Float> &x2,
150 const Vector<Float> &y, Float t);
151 virtual void erry(const Vector<Float> &x, const Vector<Float> &y1,
152 const Vector<Float> &y2, Float t);
153 virtual void gray(const Matrix<Float> &a, Float fg, Float bg,
154 const Vector<Float> &tr);
155 virtual void hi2d(const Matrix<Float> &data, const Vector<Float> &x,
156 Int ioff, Float bias, Bool center,
157 const Vector<Float> &ylims);
158 virtual void hist(const Vector<Float> &data, Float datmin, Float datmax,
159 Int nbin, Int pcflag);
160 virtual void iden();
161 virtual void imag(const Matrix<Float> &a, Float a1, Float a2,
162 const Vector<Float> &tr);
163 virtual void lab(const String &xlbl, const String &ylbl,
164 const String &toplbl);
165 virtual void ldev();
166 virtual Vector<Float> len(Int units, const String &string);
167 virtual void line(const Vector<Float> &xpts, const Vector<Float> &ypts);
168 virtual void move(Float x, Float y);
169 virtual void mtxt(const String &side, Float disp, Float coord, Float fjust,
170 const String &text);
171 virtual String numb(Int mm, Int pp, Int form);
172 virtual void page();
173 virtual void panl(Int ix, Int iy);
174 virtual void pap(Float width, Float aspect);
175 virtual void pixl(const Matrix<Int> &ia, Float x1, Float x2,
176 Float y1, Float y2);
177 virtual void pnts(const Vector<Float> &x, const Vector<Float> &y,
178 const Vector<Int> symbol);
179 virtual void poly(const Vector<Float> &xpts, const Vector<Float> &ypts);
180 virtual void pt(const Vector<Float> &xpts, const Vector<Float> &ypts,
181 Int symbol);
182 virtual void ptxt(Float x, Float y, Float angle, Float fjust,
183 const String &text);
185 virtual Int qcf();
186 virtual Float qch();
187 virtual Int qci();
188 virtual Vector<Int> qcir();
189 virtual Vector<Int> qcol();
190 virtual Vector<Float> qcr(Int ci);
191 virtual Vector<Float> qcs(Int units);
192 virtual Int qfs();
194 virtual Int qid();
195 virtual String qinf(const String &item);
196 virtual Int qitf();
197 virtual Int qls();
198 virtual Int qlw();
200 virtual Int qtbg();
201 virtual Vector<Float> qtxt(Float x, Float y, Float angle, Float fjust,
202 const String &text);
203 virtual Vector<Float> qvp(Int units);
204 virtual Vector<Float> qvsz(Int units);
206 virtual void rect(Float x1, Float x2, Float y1, Float y2);
207 virtual Float rnd(Float x, Int nsub);
208 virtual Vector<Float> rnge(Float x1, Float x2);
209 virtual void sah(Int fs, Float angle, Float vent);
210 virtual void save();
211 virtual void scf(Int font);
212 virtual void sch(Float size);
213 virtual void sci(Int ci);
214 virtual void scir(Int icilo, Int icihi);
215 virtual void scr(Int ci, Float cr, Float cg, Float cb);
216 virtual void scrn(Int ci, const String &name);
217 virtual void sfs(Int fs);
218 virtual void shls(Int ci, Float ch, Float cl, Float cs);
219 virtual void shs(Float angle, Float sepn, Float phase);
220 virtual void sitf(Int itf);
221 virtual void sls(Int ls);
222 virtual void slw(Int lw);
223 virtual void stbg(Int tbci);
224 virtual void subp(Int nxsub, Int nysub);
225 virtual void svp(Float xleft, Float xright, Float ybot, Float ytop);
226 virtual void swin(Float x1, Float x2, Float y1, Float y2);
227 virtual void tbox(const String &xopt, Float xtick, Int nxsub,
228 const String &yopt, Float ytick, Int nysub);
229 virtual void text(Float x, Float y, const String &text);
230 virtual void unsa();
231 virtual void updt();
232 virtual void vect(const Matrix<Float> &a, const Matrix<Float> &b,
233 Float c, Int nc,
234 const Vector<Float> &tr, Float blank);
235 virtual void vsiz(Float xleft, Float xright, Float ybot,
236 Float ytop);
237 virtual void vstd();
238 virtual void wedg(const String &side, Float disp, Float width,
239 Float fg, Float bg, const String &label);
240 virtual void wnad(Float x1, Float x2, Float y1, Float y2);
241 // </group>
242
243 private:
244 // Undefined and inaccessible
247
248 // PGPLOT id
249 int id_p;
251 void noplotter();
252};
253
254
255
256} //# NAMESPACE CASACORE - END
257
258#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:223
this file contains all the compiler specific defines
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49
TableExprNode phase(const TableExprNode &node)
The phase (i.e.
Definition ExprNode.h:1452
float Float
Definition aipstype.h:52
int Int
Definition aipstype.h:48
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40