NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
PlotAsset Struct Reference

A single plot data asset to be plotted. Contains the data, its axes and its type. More...

#include <plotasset.hpp>

Collaboration diagram for PlotAsset:

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
 

Detailed Description

A single plot data asset to be plotted. Contains the data, its axes and its type.

Definition at line 36 of file plotasset.hpp.

Constructor & Destructor Documentation

◆ PlotAsset()

PlotAsset::PlotAsset ( )
inline

PlotAsset constructor. Creates an empty and invalid asset.

Definition at line 48 of file plotasset.hpp.

Member Function Documentation

◆ applyModulus()

void PlotAsset::applyModulus ( PlotCoords  c,
double  mod 
)

Apply a modulus to a selected axis (e.g. for curvilinear coordinates).

Parameters
cPlotCoords
moddouble
Returns
void

Definition at line 300 of file plotasset.cpp.

References axes, and data.

◆ arg()

mglData PlotAsset::arg ( size_t  layer) const

Get the phase angle of the complex value contained within this asset.

Parameters
layersize_t
Returns
mglData

Definition at line 260 of file plotasset.cpp.

References data.

◆ create()

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.

Parameters
_tPlotType
nDimsize_t
nAxessize_t
samplesconst std::vector<size_t>&
nLayerssize_t
Returns
void

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().

◆ create1DPlot()

void PlotAsset::create1DPlot ( PlotType  _t,
size_t  nSamples,
size_t  datarows = 1 
)
inline

Convenience member function for 1D plots.

Parameters
_tPlotType
nSamplessize_t
datarowssize_t
Returns
void

Definition at line 76 of file plotasset.hpp.

References create().

Here is the call graph for this function:

◆ create2DMesh()

void PlotAsset::create2DMesh ( PlotType  _t,
const std::vector< size_t > &  samples,
size_t  nLayers = 1 
)
inline

Convenience member function for 2D meshgrid-like plots.

Parameters
_tPlotType
samplesconst std::vector<size_t>&
nLayerssize_t
Returns
void

Definition at line 106 of file plotasset.hpp.

References create().

Here is the call graph for this function:

◆ create2DVect()

void PlotAsset::create2DVect ( PlotType  _t,
const std::vector< size_t > &  samples 
)
inline

Convenience member function for 2D vectorfield plots.

Parameters
_tPlotType
samplesconst std::vector<size_t>&
Returns
void

Definition at line 135 of file plotasset.hpp.

References create().

Here is the call graph for this function:

◆ create3DMesh()

void PlotAsset::create3DMesh ( PlotType  _t,
const std::vector< size_t > &  samples,
size_t  nLayers = 1 
)
inline

Convenience member function for 3D meshgrid-like plots.

Parameters
_tPlotType
samplesconst std::vector<size_t>&
nLayerssize_t
Returns
void

Definition at line 121 of file plotasset.hpp.

References create().

Here is the call graph for this function:

◆ create3DPlot()

void PlotAsset::create3DPlot ( PlotType  _t,
size_t  nSamples,
size_t  datarows = 1 
)
inline

Convenience member function for 3D plots.

Parameters
_tPlotType
nSamplessize_t
datarowssize_t
Returns
void

Definition at line 91 of file plotasset.hpp.

References create().

Here is the call graph for this function:

◆ create3DVect()

void PlotAsset::create3DVect ( PlotType  _t,
const std::vector< size_t > &  samples 
)
inline

Convenience member function for 3D vectorfield plots.

Parameters
_tPlotType
samplesconst std::vector<size_t>&
Returns
void

Definition at line 149 of file plotasset.hpp.

References create().

Here is the call graph for this function:

◆ duplicatePoints()

void PlotAsset::duplicatePoints ( )

This function is a fix for the MathGL bug, which connects points outside of the data range.

Returns
void

Definition at line 135 of file plotasset.cpp.

References axes, data, and duplicatePoints().

Referenced by duplicatePoints().

Here is the call graph for this function:

◆ getAxisInterval()

Interval PlotAsset::getAxisInterval ( PlotCoords  c = XCOORD) const

Return the interval, which is governed by the corresponding axis.

Parameters
cPlotCoords
Returns
Interval

Definition at line 191 of file plotasset.cpp.

References axes.

◆ getDataIntervals()

IntervalSet PlotAsset::getDataIntervals ( size_t  layer = 0) const

Return the internal data arrays for real and imaginary values.

Parameters
layersize_t
Returns
IntervalSet

Definition at line 208 of file plotasset.cpp.

References data, IntervalSet::intervals, norm(), and IntervalSet::setNames().

Here is the call graph for this function:

◆ getDim()

size_t PlotAsset::getDim ( ) const
inline

Return the internal data dimensions.

Returns
size_t

Definition at line 160 of file plotasset.hpp.

References axes.

◆ getLayers()

size_t PlotAsset::getLayers ( ) const
inline

Return the internal data layers.

Returns
size_t

Definition at line 171 of file plotasset.hpp.

References data.

◆ getWeightedRanges()

IntervalSet PlotAsset::getWeightedRanges ( size_t  layer = 0,
double  dLowerPercentage = 1.0,
double  dUpperPercentage = 1.0 
) const

Get the centralized data quantiles.

Parameters
layersize_t
dLowerPercentagedouble
dUpperPercentagedouble
Returns
IntervalSet

Definition at line 371 of file plotasset.cpp.

References data, IntervalSet::intervals, qSortDouble(), and mu::rint().

Here is the call graph for this function:

◆ isComplex()

bool PlotAsset::isComplex ( size_t  layer = 0) const

Return true, if the internal data is complex valued.

Parameters
layersize_t
Returns
bool

Definition at line 282 of file plotasset.cpp.

References data.

◆ norm()

mglData PlotAsset::norm ( size_t  layer) const

Get the absolute value of the complex value contained within this asset.

Parameters
layersize_t
Returns
mglData

Definition at line 238 of file plotasset.cpp.

References data.

Referenced by getDataIntervals().

◆ removeNegativeValues()

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.

Parameters
cPlotCoords
Returns
void

Definition at line 161 of file plotasset.cpp.

References axes, and data.

◆ vectorsToMatrix()

mglData PlotAsset::vectorsToMatrix ( ) const

Converts the vectors in multiple layers into a single matrix.

Returns
mglData

Definition at line 336 of file plotasset.cpp.

References data.

◆ writeAxis()

void PlotAsset::writeAxis ( double  val,
size_t  pos,
PlotCoords  c = XCOORD 
)

Convenience function to write the axis values.

Parameters
valdouble
possize_t
cPlotCoords c
Returns
void

Definition at line 115 of file plotasset.cpp.

References axes, mu::isinf(), and SyntaxError::PLOT_ERROR.

Here is the call graph for this function:

◆ writeData()

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.

Parameters
valconst mu::value_type&
layersize_t
xsize_t
ysize_t
zsize_t
Returns
void

Definition at line 92 of file plotasset.cpp.

References data, mu::isinf(), and SyntaxError::PLOT_ERROR.

Here is the call graph for this function:

Member Data Documentation

◆ axes

std::vector<mglData> PlotAsset::axes

◆ boundAxes

std::string PlotAsset::boundAxes

Definition at line 42 of file plotasset.hpp.

◆ data

std::vector<std::pair<mglData, mglData> > PlotAsset::data

◆ legend

std::string PlotAsset::legend

Definition at line 41 of file plotasset.hpp.

◆ type

PlotType PlotAsset::type

Definition at line 40 of file plotasset.hpp.

Referenced by create().


The documentation for this struct was generated from the following files: