File: metacontour.h

package info (click to toggle)
texlive-base 2018.20190227-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 680,080 kB
  • sloc: perl: 39,836; sh: 6,386; makefile: 3,708; ruby: 2,412; ansic: 2,266; xml: 1,686; cpp: 695; awk: 606; python: 583; tcl: 541; lisp: 86; php: 65; sed: 8
file content (57 lines) | stat: -rw-r--r-- 2,193 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* MetaContour, version 0.1 -------------------------------------- */
/* Copyright(C) 2004, Brooks Moses                                 */
/*                                                                 */
/* This version of MetaContour is made available under the Gnu     */
/* Public License; see metacontour_main.cc for details.            */
/*                                                                 */
/* This is a very pre-release version of MetaContour, distributed  */
/* primarily as an example of a use of MetaPlot.  It can be        */
/* compiled with gcc using the line:                               */
/*                                                                 */
/*   g++ metacontour.cc cpoint.cc metacontour_main.cc              */
/*                                                                 */
/*-----------------------------------------------------------------*/

/* Class containing Metapost contour plot streams */

#include<string>
#include<sstream>
#include<vector>
#include"cpoint.h"

class MetapostContours {

  ostringstream GridStream;
  ostringstream FillPlotStream;
  ostringstream LinePlotStream;

  vector<double> ContourList;

  void PlotSquare (cpoint, cpoint, cpoint, cpoint);
  void PlotCorner (cpoint, cpoint, cpoint, cpoint, int);
  void PlotRect   (cpoint, cpoint, cpoint, cpoint, int);
  void PlotPent   (cpoint, cpoint, cpoint, cpoint, int);
  void PlotHex    (cpoint, cpoint, cpoint, cpoint, int, double);

  void DrawFilled (int, cpoint, cpoint, cpoint);
  void DrawFilled (int, cpoint, cpoint, cpoint, cpoint);
  void DrawFilled (int, cpoint, cpoint, cpoint, cpoint, cpoint);
  void DrawFilled (int, cpoint, cpoint, cpoint, cpoint, cpoint, cpoint);
  void DrawLine   (int, cpoint, cpoint);
  void DrawGrid   (cpoint, cpoint);
  
  string PlotName;
  string GridCommand;
  string DrawCommand;
  string FillCommand;
  
public:
  MetapostContours(cparray&, vector<double>&, string&);

  string Grid() const { return GridStream.str(); }
  string FillPlot() const { return FillPlotStream.str(); }
  string LinePlot() const { return LinePlotStream.str(); }

  vector<double> ContourListOut() const { return ContourList; }
  
};