|
27 |
|
27 |
|
28 |
// --- GnuplotDataset::Data ------------------------------------------------ // |
28 |
// --- GnuplotDataset::Data ------------------------------------------------ // |
29 |
|
29 |
|
|
|
30 |
/** |
31 |
* \ingroup gnuplot |
32 |
* |
33 |
* Structure storing the data to plot. |
34 |
* Derived classes subclass this struct and add their own data fields. |
35 |
*/ |
30 |
struct GnuplotDataset::Data |
36 |
struct GnuplotDataset::Data |
31 |
{ |
37 |
{ |
32 |
// *** Data Variables *** |
38 |
// *** Data Variables *** |
33 |
|
39 |
|
34 |
unsigned int m_references; |
40 |
unsigned int m_references; //!< ref/unref counter for garbage collection |
35 |
|
41 |
|
36 |
std::string m_title; |
42 |
std::string m_title; //!< Dataset title |
37 |
std::string m_extra; |
43 |
std::string m_extra; //!< Extra parameters for the plot |
38 |
|
44 |
|
39 |
/** |
45 |
/** |
40 |
* Initializes the reference counter to 1 and sets m_title and m_extra. |
46 |
* Initializes the reference counter to 1 and sets m_title and m_extra. |
|
|
47 |
* \param title Dataset title |
41 |
*/ |
48 |
*/ |
42 |
Data(const std::string& title); |
49 |
Data(const std::string& title); |
43 |
|
50 |
|
|
45 |
virtual ~Data(); |
52 |
virtual ~Data(); |
46 |
|
53 |
|
47 |
/** |
54 |
/** |
48 |
* Returns "plot" or "splot". |
55 |
* \brief Returns the plot type ("plot" or "splot"). |
|
|
56 |
* \returns the plot type ("plot" or "splot"). |
49 |
*/ |
57 |
*/ |
50 |
virtual std::string GetCommand () const = 0; |
58 |
virtual std::string GetCommand () const = 0; |
51 |
|
59 |
|
|
57 |
* If more than one output file is being generated, i.e. separate |
65 |
* If more than one output file is being generated, i.e. separate |
58 |
* data and control files, then the index for the current dataset |
66 |
* data and control files, then the index for the current dataset |
59 |
* and the name for the data file are also included. |
67 |
* and the name for the data file are also included. |
|
|
68 |
* |
69 |
* \param os Output stream |
70 |
* \param generateOneOutputFile If true, generate only one output file. |
71 |
* \param dataFileDatasetIndex Dataset Index |
72 |
* \param dataFileName Dataset file name |
60 |
*/ |
73 |
*/ |
61 |
virtual void PrintExpression (std::ostream &os, |
74 |
virtual void PrintExpression (std::ostream &os, |
62 |
bool generateOneOutputFile, |
75 |
bool generateOneOutputFile, |
|
66 |
/** |
79 |
/** |
67 |
* Print the inline data file contents trailing the plot command. Empty for |
80 |
* Print the inline data file contents trailing the plot command. Empty for |
68 |
* functions. |
81 |
* functions. |
|
|
82 |
* |
83 |
* \param os Output stream |
84 |
* \param generateOneOutputFile If true, generate only one output file. |
69 |
*/ |
85 |
*/ |
70 |
virtual void PrintDataFile (std::ostream &os, bool generateOneOutputFile) const = 0; |
86 |
virtual void PrintDataFile (std::ostream &os, bool generateOneOutputFile) const = 0; |
71 |
|
87 |
|
|
140 |
|
156 |
|
141 |
// --- Gnuplot2dDataset::Data2d -------------------------------------------- // |
157 |
// --- Gnuplot2dDataset::Data2d -------------------------------------------- // |
142 |
|
158 |
|
|
|
159 |
/** |
160 |
* \ingroup gnuplot |
161 |
* |
162 |
* Structure storing the data to for a 2D plot. |
163 |
*/ |
143 |
struct Gnuplot2dDataset::Data2d : public GnuplotDataset::Data |
164 |
struct Gnuplot2dDataset::Data2d : public GnuplotDataset::Data |
144 |
{ |
165 |
{ |
145 |
// *** Data Variables *** |
166 |
// *** Data Variables *** |
146 |
|
167 |
|
147 |
enum Style m_style; |
168 |
enum Style m_style; //!< The plotting style to use for this dataset. |
148 |
enum ErrorBars m_errorBars; |
169 |
enum ErrorBars m_errorBars; //!< Whether errorbars should be used for this dataset. |
149 |
|
170 |
|
150 |
PointSet m_pointset; |
171 |
PointSet m_pointset; //!< The set of points in this data set |
151 |
|
172 |
|
152 |
/** |
173 |
/** |
153 |
* Initializes with the values from m_defaultStyle and m_defaultErrorBars. |
174 |
* Initializes with the values from m_defaultStyle and m_defaultErrorBars. |
|
|
175 |
* \param title Dataset title |
154 |
*/ |
176 |
*/ |
155 |
Data2d(const std::string& title); |
177 |
Data2d(const std::string& title); |
156 |
|
178 |
|
|
386 |
|
408 |
|
387 |
// --- Gnuplot2dFunction::Function2d --------------------------------------- // |
409 |
// --- Gnuplot2dFunction::Function2d --------------------------------------- // |
388 |
|
410 |
|
|
|
411 |
/** |
412 |
* \ingroup gnuplot |
413 |
* |
414 |
* Structure storing the function to be used for a 2D plot. |
415 |
*/ |
389 |
struct Gnuplot2dFunction::Function2d : public GnuplotDataset::Data |
416 |
struct Gnuplot2dFunction::Function2d : public GnuplotDataset::Data |
390 |
{ |
417 |
{ |
391 |
// *** Data Variables *** |
418 |
// *** Data Variables *** |
392 |
|
419 |
|
393 |
std::string m_function; |
420 |
std::string m_function; //!< Function to use |
394 |
|
421 |
|
395 |
/** |
422 |
/** |
396 |
* Initializes with the function and title. |
423 |
* Initializes with the function and title. |
|
|
424 |
* |
425 |
* \param title Title of the plot |
426 |
* \param function Function to plot |
397 |
*/ |
427 |
*/ |
398 |
Function2d(const std::string& title, const std::string& function); |
428 |
Function2d(const std::string& title, const std::string& function); |
399 |
|
429 |
|
|
459 |
|
489 |
|
460 |
// --- Gnuplot3dDataset::Data3d -------------------------------------------- // |
490 |
// --- Gnuplot3dDataset::Data3d -------------------------------------------- // |
461 |
|
491 |
|
|
|
492 |
/** |
493 |
* \ingroup gnuplot |
494 |
* |
495 |
* Structure storing the data for a 3D plot. |
496 |
*/ |
462 |
struct Gnuplot3dDataset::Data3d : public GnuplotDataset::Data |
497 |
struct Gnuplot3dDataset::Data3d : public GnuplotDataset::Data |
463 |
{ |
498 |
{ |
464 |
// *** Data Variables *** |
499 |
// *** Data Variables *** |
465 |
|
500 |
|
466 |
std::string m_style; |
501 |
std::string m_style; //!< The plotting style to use for this dataset. |
467 |
|
502 |
|
468 |
PointSet m_pointset; |
503 |
PointSet m_pointset; //!< The set of points in this data set |
469 |
|
504 |
|
470 |
/** |
505 |
/** |
471 |
* Initializes with value from m_defaultStyle. |
506 |
* Initializes with value from m_defaultStyle. |
|
|
507 |
* \param title Dataset title |
472 |
*/ |
508 |
*/ |
473 |
Data3d(const std::string& title); |
509 |
Data3d(const std::string& title); |
474 |
|
510 |
|
|
574 |
|
610 |
|
575 |
// --- Gnuplot3dFunction::Function3d --------------------------------------- // |
611 |
// --- Gnuplot3dFunction::Function3d --------------------------------------- // |
576 |
|
612 |
|
|
|
613 |
/** |
614 |
* \ingroup gnuplot |
615 |
* |
616 |
* Structure storing the function to be used for a 3D plot. |
617 |
*/ |
577 |
struct Gnuplot3dFunction::Function3d : public GnuplotDataset::Data |
618 |
struct Gnuplot3dFunction::Function3d : public GnuplotDataset::Data |
578 |
{ |
619 |
{ |
579 |
// *** Data Variables *** |
620 |
// *** Data Variables *** |
580 |
|
621 |
|
581 |
std::string m_function; |
622 |
std::string m_function; //!< Function to use |
582 |
|
623 |
|
583 |
/** |
624 |
/** |
584 |
* Initializes with the function and title. |
625 |
* Initializes with the function and title. |
|
|
626 |
* |
627 |
* \param title Title of the plot |
628 |
* \param function Function to plot |
585 |
*/ |
629 |
*/ |
586 |
Function3d(const std::string& title, const std::string& function); |
630 |
Function3d(const std::string& title, const std::string& function); |
587 |
|
631 |
|