|
NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
A single plot data asset to be plotted. Contains the data, its axes and its type. More...
#include <plotasset.hpp>
Public Member Functions | |
| PlotAsset () | |
| PlotAsset constructor. Creates an empty and invalid asset. More... | |
| void | create (PlotType _t, size_t nDim, size_t nAxes, const std::vector< size_t > &samples, size_t nLayers=1) |
| Prepares the internal memory to fit the desired elements. More... | |
| void | writeData (const mu::value_type &val, size_t layer, size_t x, size_t y=0, size_t z=0) |
| Convenience function to write multi- dimensional data to the internal data object. More... | |
| void | writeAxis (double val, size_t pos, PlotCoords c=XCOORD) |
| Convenience function to write the axis values. More... | |
| void | duplicatePoints () |
| This function is a fix for the MathGL bug, which connects points outside of the data range. More... | |
| void | removeNegativeValues (PlotCoords c) |
| This function is a fix for the MathGL bug to connect points, which are out of data range. This fix is used in curved coordinates case, where the calculated coordinate is r or rho. More... | |
| Interval | getAxisInterval (PlotCoords c=XCOORD) const |
| Return the interval, which is governed by the corresponding axis. More... | |
| IntervalSet | getDataIntervals (size_t layer=0) const |
| Return the internal data arrays for real and imaginary values. More... | |
| mglData | norm (size_t layer) const |
| Get the absolute value of the complex value contained within this asset. More... | |
| mglData | arg (size_t layer) const |
| Get the phase angle of the complex value contained within this asset. More... | |
| bool | isComplex (size_t layer=0) const |
| Return true, if the internal data is complex valued. More... | |
| void | applyModulus (PlotCoords c, double mod) |
| Apply a modulus to a selected axis (e.g. for curvilinear coordinates). More... | |
| mglData | vectorsToMatrix () const |
| Converts the vectors in multiple layers into a single matrix. More... | |
| IntervalSet | getWeightedRanges (size_t layer=0, double dLowerPercentage=1.0, double dUpperPercentage=1.0) const |
| Get the centralized data quantiles. More... | |
| void | create1DPlot (PlotType _t, size_t nSamples, size_t datarows=1) |
| Convenience member function for 1D plots. More... | |
| void | create3DPlot (PlotType _t, size_t nSamples, size_t datarows=1) |
| Convenience member function for 3D plots. More... | |
| void | create2DMesh (PlotType _t, const std::vector< size_t > &samples, size_t nLayers=1) |
| Convenience member function for 2D meshgrid-like plots. More... | |
| void | create3DMesh (PlotType _t, const std::vector< size_t > &samples, size_t nLayers=1) |
| Convenience member function for 3D meshgrid-like plots. More... | |
| void | create2DVect (PlotType _t, const std::vector< size_t > &samples) |
| Convenience member function for 2D vectorfield plots. More... | |
| void | create3DVect (PlotType _t, const std::vector< size_t > &samples) |
| Convenience member function for 3D vectorfield plots. More... | |
| size_t | getDim () const |
| Return the internal data dimensions. More... | |
| size_t | getLayers () const |
| Return the internal data layers. More... | |
Public Attributes | |
| std::vector< std::pair< mglData, mglData > > | data |
| std::vector< mglData > | axes |
| PlotType | type |
| std::string | legend |
| std::string | boundAxes |
A single plot data asset to be plotted. Contains the data, its axes and its type.
Definition at line 36 of file plotasset.hpp.
|
inline |
PlotAsset constructor. Creates an empty and invalid asset.
Definition at line 48 of file plotasset.hpp.
| void PlotAsset::applyModulus | ( | PlotCoords | c, |
| double | mod | ||
| ) |
Apply a modulus to a selected axis (e.g. for curvilinear coordinates).
| c | PlotCoords |
| mod | double |
Definition at line 300 of file plotasset.cpp.
| mglData PlotAsset::arg | ( | size_t | layer | ) | const |
Get the phase angle of the complex value contained within this asset.
| layer | size_t |
Definition at line 260 of file plotasset.cpp.
References data.
| void PlotAsset::create | ( | PlotType | _t, |
| size_t | nDim, | ||
| size_t | nAxes, | ||
| const std::vector< size_t > & | samples, | ||
| size_t | nLayers = 1 |
||
| ) |
Prepares the internal memory to fit the desired elements.
| _t | PlotType |
| nDim | size_t |
| nAxes | size_t |
| samples | const std::vector<size_t>& |
| nLayers | size_t |
Definition at line 36 of file plotasset.cpp.
References axes, data, PT_NONE, type, XCOORD, YCOORD, and ZCOORD.
Referenced by create1DPlot(), create2DMesh(), create2DVect(), create3DMesh(), create3DPlot(), and create3DVect().
|
inline |
Convenience member function for 1D plots.
| _t | PlotType |
| nSamples | size_t |
| datarows | size_t |
Definition at line 76 of file plotasset.hpp.
References create().
|
inline |
Convenience member function for 2D meshgrid-like plots.
| _t | PlotType |
| samples | const std::vector<size_t>& |
| nLayers | size_t |
Definition at line 106 of file plotasset.hpp.
References create().
|
inline |
Convenience member function for 2D vectorfield plots.
| _t | PlotType |
| samples | const std::vector<size_t>& |
Definition at line 135 of file plotasset.hpp.
References create().
|
inline |
Convenience member function for 3D meshgrid-like plots.
| _t | PlotType |
| samples | const std::vector<size_t>& |
| nLayers | size_t |
Definition at line 121 of file plotasset.hpp.
References create().
|
inline |
Convenience member function for 3D plots.
| _t | PlotType |
| nSamples | size_t |
| datarows | size_t |
Definition at line 91 of file plotasset.hpp.
References create().
|
inline |
Convenience member function for 3D vectorfield plots.
| _t | PlotType |
| samples | const std::vector<size_t>& |
Definition at line 149 of file plotasset.hpp.
References create().
| void PlotAsset::duplicatePoints | ( | ) |
This function is a fix for the MathGL bug, which connects points outside of the data range.
Definition at line 135 of file plotasset.cpp.
References axes, data, and duplicatePoints().
Referenced by duplicatePoints().
| Interval PlotAsset::getAxisInterval | ( | PlotCoords | c = XCOORD | ) | const |
Return the interval, which is governed by the corresponding axis.
| c | PlotCoords |
Definition at line 191 of file plotasset.cpp.
References axes.
| IntervalSet PlotAsset::getDataIntervals | ( | size_t | layer = 0 | ) | const |
Return the internal data arrays for real and imaginary values.
| layer | size_t |
Definition at line 208 of file plotasset.cpp.
References data, IntervalSet::intervals, norm(), and IntervalSet::setNames().
|
inline |
Return the internal data dimensions.
Definition at line 160 of file plotasset.hpp.
References axes.
|
inline |
Return the internal data layers.
Definition at line 171 of file plotasset.hpp.
References data.
| IntervalSet PlotAsset::getWeightedRanges | ( | size_t | layer = 0, |
| double | dLowerPercentage = 1.0, |
||
| double | dUpperPercentage = 1.0 |
||
| ) | const |
Get the centralized data quantiles.
| layer | size_t |
| dLowerPercentage | double |
| dUpperPercentage | double |
Definition at line 371 of file plotasset.cpp.
References data, IntervalSet::intervals, qSortDouble(), and mu::rint().
| bool PlotAsset::isComplex | ( | size_t | layer = 0 | ) | const |
Return true, if the internal data is complex valued.
| layer | size_t |
Definition at line 282 of file plotasset.cpp.
References data.
| mglData PlotAsset::norm | ( | size_t | layer | ) | const |
Get the absolute value of the complex value contained within this asset.
| layer | size_t |
Definition at line 238 of file plotasset.cpp.
References data.
Referenced by getDataIntervals().
| void PlotAsset::removeNegativeValues | ( | PlotCoords | c | ) |
This function is a fix for the MathGL bug to connect points, which are out of data range. This fix is used in curved coordinates case, where the calculated coordinate is r or rho.
| c | PlotCoords |
Definition at line 161 of file plotasset.cpp.
| mglData PlotAsset::vectorsToMatrix | ( | ) | const |
Converts the vectors in multiple layers into a single matrix.
Definition at line 336 of file plotasset.cpp.
References data.
| void PlotAsset::writeAxis | ( | double | val, |
| size_t | pos, | ||
| PlotCoords | c = XCOORD |
||
| ) |
Convenience function to write the axis values.
| val | double |
| pos | size_t |
| c | PlotCoords c |
Definition at line 115 of file plotasset.cpp.
References axes, mu::isinf(), and SyntaxError::PLOT_ERROR.
| void PlotAsset::writeData | ( | const mu::value_type & | val, |
| size_t | layer, | ||
| size_t | x, | ||
| size_t | y = 0, |
||
| size_t | z = 0 |
||
| ) |
Convenience function to write multi- dimensional data to the internal data object.
| val | const mu::value_type& |
| layer | size_t |
| x | size_t |
| y | size_t |
| z | size_t |
Definition at line 92 of file plotasset.cpp.
References data, mu::isinf(), and SyntaxError::PLOT_ERROR.
| std::vector<mglData> PlotAsset::axes |
Definition at line 39 of file plotasset.hpp.
Referenced by applyModulus(), create(), duplicatePoints(), getAxisInterval(), getDim(), removeNegativeValues(), and writeAxis().
| std::string PlotAsset::boundAxes |
Definition at line 42 of file plotasset.hpp.
| std::vector<std::pair<mglData, mglData> > PlotAsset::data |
Definition at line 38 of file plotasset.hpp.
Referenced by applyModulus(), arg(), create(), duplicatePoints(), getDataIntervals(), getLayers(), getWeightedRanges(), isComplex(), norm(), removeNegativeValues(), vectorsToMatrix(), and writeData().
| std::string PlotAsset::legend |
Definition at line 41 of file plotasset.hpp.
| PlotType PlotAsset::type |
Definition at line 40 of file plotasset.hpp.
Referenced by create().