Debian Codegraph @

texmf-dist/doc/latex/metaplot/examples/metacontour.h

raw
1 /* MetaContour, version 0.1 -------------------------------------- */
2 /* Copyright(C) 2004, Brooks Moses */
3 /* */
4 /* This version of MetaContour is made available under the Gnu */
5 /* Public License; see metacontour_main.cc for details. */
6 /* */
7 /* This is a very pre-release version of MetaContour, distributed */
8 /* primarily as an example of a use of MetaPlot. It can be */
9 /* compiled with gcc using the line: */
10 /* */
11 /* g++ metacontour.cc cpoint.cc metacontour_main.cc */
12 /* */
13 /*-----------------------------------------------------------------*/
14
15 /* Class containing Metapost contour plot streams */
16
17 #include<string>
18 #include<sstream>
19 #include<vector>
20 #include"cpoint.h"
21
22 class MetapostContours {
23
24 ostringstream GridStream;
25 ostringstream FillPlotStream;
26 ostringstream LinePlotStream;
27
28 vector<double> ContourList;
29
30 void PlotSquare (cpoint, cpoint, cpoint, cpoint);
31 void PlotCorner (cpoint, cpoint, cpoint, cpoint, int);
32 void PlotRect (cpoint, cpoint, cpoint, cpoint, int);
33 void PlotPent (cpoint, cpoint, cpoint, cpoint, int);
34 void PlotHex (cpoint, cpoint, cpoint, cpoint, int, double);
35
36 void DrawFilled (int, cpoint, cpoint, cpoint);
37 void DrawFilled (int, cpoint, cpoint, cpoint, cpoint);
38 void DrawFilled (int, cpoint, cpoint, cpoint, cpoint, cpoint);
39 void DrawFilled (int, cpoint, cpoint, cpoint, cpoint, cpoint, cpoint);
40 void DrawLine (int, cpoint, cpoint);
41 void DrawGrid (cpoint, cpoint);
42
43 string PlotName;
44 string GridCommand;
45 string DrawCommand;
46 string FillCommand;
47
48 public:
49 MetapostContours(cparray&, vector<double>&, string&);
50
51 string Grid() const { return GridStream.str(); }
52 string FillPlot() const { return FillPlotStream.str(); }
53 string LinePlot() const { return LinePlotStream.str(); }
54
55 vector<double> ContourListOut() const { return ContourList; }
56
57 };