author | Gustavo J. A. M. Carneiro <gjc@inescporto.pt> |
Fri, 11 Jul 2008 18:39:19 +0100 | |
changeset 3416 | 926ccb845111 |
parent 3386 | 215b923b5b2e |
child 4061 | 359e0a1b5cf8 |
permissions | -rw-r--r-- |
1879
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
2 |
/* |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
3 |
* Copyright (c) 2007 INRIA |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
4 |
* |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
8 |
* |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
13 |
* |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
17 |
* |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
18 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
19 |
*/ |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
20 |
#ifndef GNUPLOT_H |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
21 |
#define GNUPLOT_H |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
22 |
|
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
23 |
#include <string> |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
24 |
#include <vector> |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
25 |
#include <utility> |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
26 |
|
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
27 |
namespace ns3 { |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
28 |
|
2694
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
29 |
/** |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
30 |
* \brief store a dataset to be used by ns3::Gnuplot |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
31 |
*/ |
1879
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
32 |
class GnuplotDataset |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
33 |
{ |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
34 |
public: |
2694
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
35 |
/** |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
36 |
* The plotting style to use for this dataset. |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
37 |
*/ |
1879
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
38 |
enum Style { |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
39 |
LINES, |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
40 |
POINTS, |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
41 |
LINES_POINTS, |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
42 |
DOTS, |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
43 |
IMPULSES, |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
44 |
STEPS, |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
45 |
FSTEPS, |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
46 |
HISTEPS, |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
47 |
}; |
2694
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
48 |
/** |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
49 |
* Whether errorbars should be used for this dataset. |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
50 |
*/ |
2180
8cbdda2a5c2d
add support for gnuplot error bars
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1879
diff
changeset
|
51 |
enum ErrorBars { |
8cbdda2a5c2d
add support for gnuplot error bars
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1879
diff
changeset
|
52 |
NONE, |
8cbdda2a5c2d
add support for gnuplot error bars
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1879
diff
changeset
|
53 |
X, |
8cbdda2a5c2d
add support for gnuplot error bars
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1879
diff
changeset
|
54 |
Y, |
8cbdda2a5c2d
add support for gnuplot error bars
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1879
diff
changeset
|
55 |
XY |
8cbdda2a5c2d
add support for gnuplot error bars
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1879
diff
changeset
|
56 |
}; |
1879
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
57 |
|
2694
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
58 |
/** |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
59 |
* Create an empty dataset without any title. |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
60 |
*/ |
2519
55057c67d4f6
add default constructor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2184
diff
changeset
|
61 |
GnuplotDataset (); |
2694
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
62 |
/** |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
63 |
* \param title the title to be associated to this dataset. |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
64 |
* |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
65 |
* Create an empty dataset. Usually, the dataset's title is |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
66 |
* displayed in the legend box. |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
67 |
*/ |
1879
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
68 |
GnuplotDataset (std::string title); |
2694
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
69 |
/** |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
70 |
* \param style the style of plotting to use for this dataset. |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
71 |
*/ |
1879
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
72 |
void SetStyle (enum Style style); |
2694
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
73 |
/** |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
74 |
* \param errorBars the style of errorbars to display. |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
75 |
* |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
76 |
* If you use any style other than none, you need |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
77 |
* to make sure you store the delta information in |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
78 |
* this dataset with the right GnuplotDataset::Add |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
79 |
* method. |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
80 |
*/ |
2180
8cbdda2a5c2d
add support for gnuplot error bars
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1879
diff
changeset
|
81 |
void SetErrorBars (enum ErrorBars errorBars); |
2694
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
82 |
/** |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
83 |
* \param x x coord to new data point |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
84 |
* \param y y coord to new data point |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
85 |
* |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
86 |
* Use this method with error bar style NONE. |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
87 |
*/ |
1879
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
88 |
void Add (double x, double y); |
2694
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
89 |
/** |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
90 |
* \param x x coord to new data point |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
91 |
* \param y y coord to new data point |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
92 |
* \param errorDelta |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
93 |
* |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
94 |
* Use this method with error bar style X or Y. |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
95 |
*/ |
2180
8cbdda2a5c2d
add support for gnuplot error bars
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1879
diff
changeset
|
96 |
void Add (double x, double y, double errorDelta); |
1879
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
97 |
private: |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
98 |
friend class Gnuplot; |
2180
8cbdda2a5c2d
add support for gnuplot error bars
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1879
diff
changeset
|
99 |
struct Data { |
8cbdda2a5c2d
add support for gnuplot error bars
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1879
diff
changeset
|
100 |
double x; |
8cbdda2a5c2d
add support for gnuplot error bars
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1879
diff
changeset
|
101 |
double y; |
8cbdda2a5c2d
add support for gnuplot error bars
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1879
diff
changeset
|
102 |
double dx; |
8cbdda2a5c2d
add support for gnuplot error bars
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1879
diff
changeset
|
103 |
double dy; |
8cbdda2a5c2d
add support for gnuplot error bars
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1879
diff
changeset
|
104 |
}; |
8cbdda2a5c2d
add support for gnuplot error bars
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1879
diff
changeset
|
105 |
typedef std::vector<struct Data> Dataset; |
1879
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
106 |
Dataset m_dataset; |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
107 |
std::string m_title; |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
108 |
enum Style m_style; |
2180
8cbdda2a5c2d
add support for gnuplot error bars
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1879
diff
changeset
|
109 |
enum ErrorBars m_errorBars; |
1879
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
110 |
}; |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
111 |
|
2694
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
112 |
/** |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
113 |
* \brief a simple class to generate gnuplot-ready plotting commands |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
114 |
* from a set of datasets. |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
115 |
* |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
116 |
* This class really represents a single graph on which multiple datasets |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
117 |
* can be plotted. |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
118 |
*/ |
1879
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
119 |
class Gnuplot |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
120 |
{ |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
121 |
public: |
2694
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
122 |
/** |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
123 |
* \param pngFilename the name of the file where the png rendering of the |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
124 |
* graph will be generated if you feed the command stream output by |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
125 |
* Gnuplot::GenerateOutput to the gnuplot program. |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
126 |
*/ |
1879
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
127 |
Gnuplot (std::string pngFilename); |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
128 |
~Gnuplot (); |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
129 |
|
2694
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
130 |
/** |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
131 |
* \param xLegend the legend for the x horizontal axis |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
132 |
* \param yLegend the legend for the y vertical axis |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
133 |
*/ |
2184
db9f25b01d5c
add legend support to gnuplot output
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2180
diff
changeset
|
134 |
void SetLegend (std::string xLegend, std::string yLegend); |
db9f25b01d5c
add legend support to gnuplot output
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2180
diff
changeset
|
135 |
|
2694
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
136 |
/** |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
137 |
* \param dataset add a dataset to the graph to be plotted. |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
138 |
*/ |
1879
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
139 |
void AddDataset (const GnuplotDataset &dataset); |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
140 |
|
2694
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
141 |
/** |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
142 |
* \param os the output stream on which the relevant gnuplot |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
143 |
* commands should be generated. |
9440242e1c76
some more doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2519
diff
changeset
|
144 |
*/ |
1879
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
145 |
void GenerateOutput (std::ostream &os); |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
146 |
private: |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
147 |
typedef std::vector<GnuplotDataset *> Datasets; |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
148 |
Datasets m_datasets; |
2184
db9f25b01d5c
add legend support to gnuplot output
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2180
diff
changeset
|
149 |
std::string m_xLegend; |
db9f25b01d5c
add legend support to gnuplot output
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2180
diff
changeset
|
150 |
std::string m_yLegend; |
1879
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
151 |
std::string m_pngFilename; |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
152 |
}; |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
153 |
|
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
154 |
} // namespace ns3 |
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
155 |
|
876026968947
Gnuplot output class for contrib module
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
156 |
#endif /* GNUPLOT_H */ |