NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
Plot Class Reference

This class handles the complete plotting process. More...

#include <plotting.hpp>

Collaboration diagram for Plot:

Public Member Functions

 Plot (std::string &sCmd, MemoryManager &__data, mu::Parser &__parser, Settings &__option, FunctionDefinitionManager &__functions, PlotData &__pData)
 Plotting object constructor. This class uses "calculate-upon-construction", which means that the constructor has to do all the hard work. More...
 
 ~Plot ()
 Plot class destructor. More...
 
GraphHelpercreateGraphHelper ()
 

Protected Member Functions

void determinePlottingDimensions (const std::string &sPlotCommand)
 This member function determines the maximal plotting dimension of the passed command. More...
 
size_t createSubPlotSet (bool &bAnimateVar, std::vector< std::string > &vPlotCompose, size_t nSubPlotStart, size_t nMultiplots[2], size_t &nSubPlots, size_t &nSubPlotMap)
 This member function handles the creation of a single subplot, which may be a single plot or part of a plot composition. More...
 
void applyPlotSizeAndQualitySettings ()
 This member function determines output size and quality on the plotting target and the plotting parameters. More...
 
bool createPlotOrAnimation (size_t nPlotCompose, size_t nPlotComposeSize, bool bNewSubPlot, bool bAnimateVar, std::vector< std::string > &vDrawVector, const std::vector< std::string > &vDataPlots)
 This member function creates the plot or animation selected by the plotting command. More...
 
void create2dPlot (size_t nPlotCompose, size_t nPlotComposeSize)
 This member function wraps the creation of all all two-dimensional plots (e.g. surface or density plots). More...
 
bool plot2d (mglData &_mData, mglData &_mData2, mglData *_mAxisVals, mglData &_mContVec)
 This member function creates an actual single two-dimensional plot based upon the current plotting command. More...
 
void createStdPlot (size_t nPlotCompose, size_t nPlotComposeSize)
 This member function wraps the creation of all one-dimensional plots (e.g. line or point plots). More...
 
bool plotstd (mglData &_mData, mglData &_mAxisVals, mglData _mData2[2], const short nType)
 This member function creates an actual single one-dimensional plot based upon the current plotting command. More...
 
void create3dPlot ()
 This member function handles the creation of all three-dimensional plots. More...
 
void create3dVect ()
 This member function handles the creation of all three-dimensional vector fields. More...
 
void create2dVect ()
 This member function handles the creation of all two-dimensional vector fields. More...
 
void create2dDrawing (std::vector< std::string > &vDrawVector)
 This member function handles the creation of all two-dimensional drawings. More...
 
void create3dDrawing (std::vector< std::string > &vDrawVector)
 This member function handles the creation of all three-dimensional drawings. More...
 
void createStd3dPlot (size_t nPlotCompose, size_t nPlotComposeSize)
 This member function wraps the creation of all trajectory-like plots (plots describing a series of points in 3D space). More...
 
bool plotstd3d (mglData _mData[3], mglData _mData2[3], const short nType)
 This member function creates an actual single three-dimensional trajectory. More...
 
bool checkMultiPlotArray (unsigned int nMultiPlot[2], unsigned int &nSubPlotMap, unsigned int nPlotPos, unsigned int nCols, unsigned int nLines)
 This member function checks, whether the selected subplot position is still empty. More...
 
long getNN (const mglData &_mData)
 This member function is a helper to return the number of data points located in the passed mglData object. More...
 
void filename (size_t nPlotComposeSize, size_t nPlotCompose)
 This member function creates a default plot file name based upon the currently used plotting command. More...
 
void setStyles ()
 This member function prepares the line and point styles based upon the currently used parameters. More...
 
std::string expandStyleForCurveArray (const std::string &sCurrentStyle, bool expand)
 This protected member function expands a style string into 9 style string with different luminosities. This is used by curve arrays. More...
 
void evaluateSubplot (std::string &sCmd, size_t nMultiplots[2], size_t &nSubPlots, size_t &nSubPlotMap)
 This member function evaluates the subplot command in a plot composition and determines, where to place the next plot and if that is actually possible. More...
 
void displayMessage (bool bAnimateVar)
 This member function writes a message to the terminal indicating that the algorithm is currently working. More...
 
std::vector< std::string > separateFunctionsAndData ()
 This member function separates the functions from the data plots and returns a vector containing the definitions of the data plots. More...
 
void extractDataValues (const std::vector< std::string > &vDataPlots)
 Creates the internal mglData objects and fills them with the data values from the MemoryManager class instance in the kernel. More...
 
void createDataLegends ()
 This member function creates the legend strings for the data plots. More...
 
std::string constructDataLegendElement (std::string &sColumnIndices, const std::string &sTableName)
 This member function is used to construct special legend elements. More...
 
size_t countValidElements (const mglData &_mData)
 This member function counts the valid data points in the passed mglData object. More...
 
void prepareMemory ()
 This member function prepares the memory array in the PlotData class instance to fit the desired plotting style. More...
 
void defaultRanges (size_t nPlotCompose, bool bNewSubPlot)
 This member function applies the default ranges to the plotting ranges. More...
 
void fillData (double dt_max, int t_animate)
 This member function calculates the plotting data points from usual expressions. More...
 
void fitPlotRanges (size_t nPlotCompose, bool bNewSubPlot)
 This member function fits the remaining plotting ranges for the calculated interval of data points. More...
 
void clearData ()
 Clearing member function for allocated memory on the heap. More...
 
void passRangesToGraph ()
 This member function informs the mglGraph object about the new plotting interval ranges. More...
 
void applyColorbar ()
 This member function applies the colour bar to the plot. More...
 
void applyLighting ()
 This member function applies the light effects to two- or three-dimensional plots. The orientation of the light sources depend on the dimensionality of the plot. More...
 
void applyGrid ()
 This member function applies the grid with the selected styles to the plot. More...
 
double getLabelPosition (int nCoord)
 This member function determines the position of the axis label, which depends on whether a box surrounds the plot and the selected coordinate system. More...
 
mglPoint createMglPoint (int nCoords, double r, double phi, double theta, bool b3D=false)
 This member function creates a mglPoint instance depending on the chosen coordinate system. More...
 
void setLogScale (bool bzLogscale)
 This member function handles the complex logscale logic applied to the coordinate system of the plot. More...
 
void directionalLight (double dPhi, double dTheta, int nId, char cColor='w', double dBrightness=0.5)
 This member function calculates the light source depending on the orientation of the graph. It is not used. More...
 
std::string getLegendStyle (const std::string &sLegend)
 This member function prepares the legend strings to fit the selected legend style (only colours or only styles or both). More...
 
mglPoint CalcCutBox (double dPhi, int nEdge=0, int nCoords=0, bool b3D=false)
 This member function calculates the two coordinates in space, which describe the cutting box. The cutting box depends on the rotation of the graph. More...
 
double getProjBackground (double dPhi, int nEdge=0)
 This member function determines the positions for the projected density and contour maps, which depend on the rotation of the graph and are chosen in a way that they are always in the background of the graph. More...
 
mglData fmod (const mglData &_mData, double dDenominator)
 This member function applies a floating point modulo operator on the data set. More...
 
void CoordSettings ()
 This member function applies axes and axis labels to the graph. More...
 
std::string CoordFunc (const std::string &sFuncDef, double dPhiScale=1.0, double dThetaScale=1.0)
 This member function is used to create a coordinate function for the coordinate system, which considers the desired axis scale. More...
 
std::string composeColoursForBarChart (long int nNum)
 This member function creates a special colour string, which is used for bar charts, which might contain more than one data set. More...
 

Private Member Functions

 Plot (const Plot &)=delete
 
Plotoperator= (const Plot &)=delete
 

Private Attributes

PlotAssetManager m_manager
 
std::vector< short > m_types
 
IntervalSet dataRanges
 
IntervalSet secDataRanges
 
bool bOutputDesired
 
std::string sFunc
 
std::string sOutputName
 
size_t nLegends
 
MemoryManager_data
 
mu::Parser_parser
 
Settings_option
 
FunctionDefinitionManager_functions
 
PlotData_pData
 
PlotInfo _pInfo
 
mglGraph * _graph
 

Detailed Description

This class handles the complete plotting process.

Definition at line 46 of file plotting.hpp.

Constructor & Destructor Documentation

◆ Plot() [1/2]

Plot::Plot ( const Plot )
privatedelete

◆ Plot() [2/2]

Plot::Plot ( std::string &  sCmd,
MemoryManager __data,
mu::Parser __parser,
Settings __option,
FunctionDefinitionManager __functions,
PlotData __pData 
)

◆ ~Plot()

Plot::~Plot ( )

Plot class destructor.

Definition at line 457 of file plotting.cpp.

References _graph, and clearData().

Here is the call graph for this function:

Member Function Documentation

◆ applyColorbar()

void Plot::applyColorbar ( )
protected

This member function applies the colour bar to the plot.

Returns
void

Definition at line 5523 of file plotting.cpp.

References _graph, _pData, _pInfo, PlotInfo::b3D, CPLX_PLANE, CRANGE, PlotData::getAxisScale(), PlotData::getColorScheme(), PlotData::getColorSchemeLight(), PlotData::getSettings(), PlotData::INT_COMPLEXMODE, PlotData::INT_MARKS, PlotData::LOG_BOX, PlotData::LOG_COLORBAR, PlotData::LOG_CONTFILLED, PlotData::LOG_CONTPROJ, PlotData::LOG_CRUST, PlotData::LOG_SCHEMATIC, PlotInfo::ranges, PlotInfo::sCommand, and XRANGE.

Referenced by createPlotOrAnimation().

Here is the call graph for this function:

◆ applyGrid()

void Plot::applyGrid ( )
protected

This member function applies the grid with the selected styles to the plot.

Returns
void

Definition at line 6971 of file plotting.cpp.

References _graph, _pData, _pInfo, CARTESIAN, PlotData::getFineGridStyle(), PlotData::getGridStyle(), PlotData::getSettings(), hasSecAxisBox(), PlotData::INT_COORDS, PlotData::INT_GRID, PlotData::LOG_BOX, and PlotData::LOG_SCHEMATIC.

Referenced by CoordSettings().

Here is the call graph for this function:

◆ applyLighting()

void Plot::applyLighting ( )
protected

This member function applies the light effects to two- or three-dimensional plots. The orientation of the light sources depend on the dimensionality of the plot.

Returns
void

Definition at line 5593 of file plotting.cpp.

References _graph, _pData, _pInfo, PlotInfo::b3D, PlotInfo::b3DVect, PlotInfo::bDraw, PlotInfo::bDraw3D, PlotData::FLOAT_ALPHAVAL, PlotData::getSettings(), PlotData::INT_LIGHTING, PlotData::LOG_ALPHA, PlotData::LOG_ALPHAMASK, PlotData::LOG_CONTFILLED, PlotData::LOG_CONTPROJ, PlotData::LOG_CRUST, PlotData::LOG_PIPE, and PlotInfo::sCommand.

Referenced by createPlotOrAnimation().

Here is the call graph for this function:

◆ applyPlotSizeAndQualitySettings()

void Plot::applyPlotSizeAndQualitySettings ( )
protected

This member function determines output size and quality on the plotting target and the plotting parameters.

Returns
void

Definition at line 854 of file plotting.cpp.

References _fontData, _graph, _pData, PlotData::FLOAT_ASPECT, PlotData::FLOAT_TEXTSIZE, PlotData::getAnimateSamples(), PlotData::getSettings(), PlotData::INT_HIGHRESLEVEL, PlotData::INT_SIZE_X, PlotData::INT_SIZE_Y, PlotData::LOG_OPENIMAGE, PlotData::LOG_SILENTMODE, and PlotData::STR_FILENAME.

Referenced by createSubPlotSet().

Here is the call graph for this function:

◆ CalcCutBox()

mglPoint Plot::CalcCutBox ( double  dPhi,
int  nEdge = 0,
int  nCoords = 0,
bool  b3D = false 
)
protected

This member function calculates the two coordinates in space, which describe the cutting box. The cutting box depends on the rotation of the graph.

Parameters
dPhidouble
nEdgeint
nCoordsint
b3Dbool
Returns
mglPoint

Definition at line 5745 of file plotting.cpp.

References _pInfo, CARTESIAN, createMglPoint(), M_PI, POLAR_PZ, POLAR_RP, POLAR_RZ, PlotInfo::ranges, SPHERICAL_PT, SPHERICAL_RP, SPHERICAL_RT, XCOORD, XRANGE, YCOORD, YRANGE, ZCOORD, and ZRANGE.

Referenced by create3dPlot(), create3dVect(), createStd3dPlot(), and plot2d().

Here is the call graph for this function:

◆ checkMultiPlotArray()

bool Plot::checkMultiPlotArray ( unsigned int  nMultiPlot[2],
unsigned int &  nSubPlotMap,
unsigned int  nPlotPos,
unsigned int  nCols,
unsigned int  nLines 
)
protected

This member function checks, whether the selected subplot position is still empty.

Parameters
nMultiPlot[2]unsigned int
nSubPlotMapunsigned int&
nPlotPosunsigned int
nColsunsigned int
nLinesunsigned int
Returns
bool

Definition at line 7075 of file plotting.cpp.

Referenced by evaluateSubplot().

◆ clearData()

void Plot::clearData ( )
protected

Clearing member function for allocated memory on the heap.

Returns
void

Definition at line 5107 of file plotting.cpp.

References PlotAssetManager::assets, and m_manager.

Referenced by create2dPlot(), create2dVect(), create3dPlot(), create3dVect(), createStd3dPlot(), createStdPlot(), createSubPlotSet(), defaultRanges(), fitPlotRanges(), passRangesToGraph(), and ~Plot().

◆ composeColoursForBarChart()

string Plot::composeColoursForBarChart ( long int  nNum)
protected

This member function creates a special colour string, which is used for bar charts, which might contain more than one data set.

Parameters
nNumlong int
Returns
string

Definition at line 7047 of file plotting.cpp.

References _pInfo, PlotInfo::nextStyle(), PlotInfo::nStyle, and PlotInfo::sLineStyles.

Referenced by plotstd().

Here is the call graph for this function:

◆ constructDataLegendElement()

string Plot::constructDataLegendElement ( std::string &  sColumnIndices,
const std::string &  sTableName 
)
protected

This member function is used to construct special legend elements.

Parameters
sColumnIndicesstring&
sTableNameconst string&
Returns
string

Definition at line 4285 of file plotting.cpp.

References _data, _parser, _pData, _pInfo, mu::ParserBase::Eval(), PlotData::FLOAT_BARS, PlotData::FLOAT_HBARS, getDataElements(), NumeReKernel::getInstance(), PlotData::getSettings(), MemoryManager::getTopHeadLineElement(), intCast(), PlotData::LOG_BOXPLOT, PlotInfo::sCommand, and mu::ParserBase::SetExpr().

Referenced by createDataLegends().

Here is the call graph for this function:

◆ CoordFunc()

string Plot::CoordFunc ( const std::string &  sFuncDef,
double  dPhiScale = 1.0,
double  dThetaScale = 1.0 
)
protected

This member function is used to create a coordinate function for the coordinate system, which considers the desired axis scale.

Parameters
sFuncDefconst std::string&
dPhiScaledouble
dThetaScaledouble
Returns
string

Definition at line 7008 of file plotting.cpp.

References toString().

Referenced by CoordSettings().

Here is the call graph for this function:

◆ CoordSettings()

◆ countValidElements()

size_t Plot::countValidElements ( const mglData &  _mData)
protected

This member function counts the valid data points in the passed mglData object.

Parameters
_mDataconst mglData&
Returns
size_t

Definition at line 4336 of file plotting.cpp.

References mu::isnan().

Referenced by createStd3dPlot(), plotstd(), and plotstd3d().

Here is the call graph for this function:

◆ create2dDrawing()

void Plot::create2dDrawing ( std::vector< std::string > &  vDrawVector)
protected

This member function handles the creation of all two-dimensional drawings.

Parameters
vDrawVectorvector<string>&
Returns
void

Definition at line 2167 of file plotting.cpp.

References _graph, _option, _parser, convertVectorToExpression(), mu::ParserBase::Eval(), NumeRe::StringParser::evalAndFormat(), NumeReKernel::getInstance(), NumeReKernel::getStringParser(), isInQuotes(), mu::real(), and mu::ParserBase::SetExpr().

Referenced by createPlotOrAnimation().

Here is the call graph for this function:

◆ create2dPlot()

void Plot::create2dPlot ( size_t  nPlotCompose,
size_t  nPlotComposeSize 
)
protected

This member function wraps the creation of all all two-dimensional plots (e.g. surface or density plots).

Parameters
nPlotComposesize_t
nPlotComposeSizesize_t
Returns
void

Definition at line 1101 of file plotting.cpp.

References _graph, _pData, _pInfo, PlotAssetManager::applyCoordSys(), PlotAssetManager::assets, clearData(), CPLX_PLANE, CPLX_REIM, NumeRe::StringParser::evalAndFormat(), fromSystemCodePage(), NumeReKernel::getInstance(), PlotData::getSettings(), NumeReKernel::getStringParser(), PlotData::INT_COMPLEXMODE, PlotData::INT_CONTLINES, PlotData::INT_COORDS, PlotData::LOG_ALPHAMASK, PlotData::LOG_COLORMASK, PlotData::LOG_CONTLABELS, PlotData::LOG_PARAMETRIC, PlotData::LOG_SCHEMATIC, m_manager, PlotInfo::nextStyle(), nLegends, PlotInfo::nSamples, PlotInfo::nStyle, plot2d(), PlotInfo::ranges, mu::real(), replaceToTeX(), PlotInfo::sCommand, PlotInfo::sContStyles, StripSpaces(), toString(), XCOORD, YCOORD, and ZRANGE.

Referenced by createPlotOrAnimation().

Here is the call graph for this function:

◆ create2dVect()

void Plot::create2dVect ( )
protected

This member function handles the creation of all two-dimensional vector fields.

Returns
void

Definition at line 2122 of file plotting.cpp.

References _graph, _pData, PlotAssetManager::assets, clearData(), PlotData::getColorScheme(), PlotData::getSettings(), PlotData::LOG_FIXEDLENGTH, PlotData::LOG_FLOW, PlotData::LOG_PIPE, m_manager, PT_FUNCTION, XCOORD, and YCOORD.

Referenced by createPlotOrAnimation().

Here is the call graph for this function:

◆ create3dDrawing()

void Plot::create3dDrawing ( std::vector< std::string > &  vDrawVector)
protected

This member function handles the creation of all three-dimensional drawings.

Parameters
vDrawVectorvector<string>&
Returns
void

Definition at line 2430 of file plotting.cpp.

References _graph, _option, _parser, convertVectorToExpression(), mu::ParserBase::Eval(), NumeRe::StringParser::evalAndFormat(), NumeReKernel::getInstance(), NumeReKernel::getStringParser(), isInQuotes(), mu::real(), and mu::ParserBase::SetExpr().

Referenced by createPlotOrAnimation().

Here is the call graph for this function:

◆ create3dPlot()

◆ create3dVect()

void Plot::create3dVect ( )
protected

This member function handles the creation of all three-dimensional vector fields.

Returns
void

Definition at line 2076 of file plotting.cpp.

References _graph, _pData, PlotAssetManager::assets, CalcCutBox(), clearData(), PlotData::getColorScheme(), PlotData::getRotateAngle(), PlotData::getSettings(), PlotData::INT_COORDS, PlotData::LOG_CUTBOX, PlotData::LOG_FIXEDLENGTH, PlotData::LOG_FLOW, PlotData::LOG_PIPE, m_manager, sFunc, XCOORD, YCOORD, and ZCOORD.

Referenced by createPlotOrAnimation().

Here is the call graph for this function:

◆ createDataLegends()

◆ createGraphHelper()

GraphHelper * Plot::createGraphHelper ( )
inline

Definition at line 122 of file plotting.hpp.

References _graph, and _pData.

Referenced by createPlot().

◆ createMglPoint()

mglPoint Plot::createMglPoint ( int  nCoords,
double  r,
double  phi,
double  theta,
bool  b3D = false 
)
protected

This member function creates a mglPoint instance depending on the chosen coordinate system.

Parameters
nCoordsint
rdouble
phidouble
thetadouble
b3Dbool
Returns
mglPoint

Definition at line 5900 of file plotting.cpp.

References POLAR_PZ, POLAR_RP, POLAR_RZ, SPHERICAL_PT, SPHERICAL_RP, and SPHERICAL_RT.

Referenced by CalcCutBox().

◆ createPlotOrAnimation()

bool Plot::createPlotOrAnimation ( size_t  nPlotCompose,
size_t  nPlotComposeSize,
bool  bNewSubPlot,
bool  bAnimateVar,
std::vector< std::string > &  vDrawVector,
const std::vector< std::string > &  vDataPlots 
)
protected

This member function creates the plot or animation selected by the plotting command.

Parameters
nPlotComposesize_t
nPlotComposeSizesize_t
bNewSubPlotbool
bAnimateVarbool
vDrawVectorvector<string>&
sDataAxisBindsconst string&
Returns
bool

It will also create the samples for the animation, which may be target either directly to a file (aka GIF) or to the GraphViewer, which will finalize the rendering step.

Definition at line 929 of file plotting.cpp.

References _defVars, _graph, _lang, _option, _pData, _pInfo, applyColorbar(), applyLighting(), PlotInfo::b2DVect, PlotInfo::b3DVect, PlotInfo::bDraw, PlotInfo::bDraw3D, bOutputDesired, create2dDrawing(), create2dPlot(), create2dVect(), create3dDrawing(), create3dPlot(), create3dVect(), createStd3dPlot(), createStdPlot(), defaultRanges(), extractDataValues(), fillData(), fitPlotRanges(), PlotData::FLOAT_PERSPECTIVE, fromSystemCodePage(), Language::get(), PlotData::getAnimateSamples(), PlotData::getRotateAngle(), PlotData::getSettings(), has3DView(), isMesh2D(), isMesh3D(), isPlot1D(), isVect2D(), isVect3D(), PlotData::LOG_ORTHOPROJECT, PlotData::LOG_SILENTMODE, m_manager, PlotInfo::nMaxPlotDim, PlotAssetManager::normalize(), PlotInfo::nStyle, passRangesToGraph(), NumeReKernel::printPreFmt(), PlotInfo::ranges, PlotInfo::sCommand, sOutputName, PlotData::STR_BACKGROUND, PlotData::STR_BACKGROUNDCOLORSCHEME, PlotData::STR_PLOTTITLE, Settings::systemPrints(), TCOORD, toString(), toSystemCodePage(), TRANGE, DefaultVariables::vValue, XCOORD, XRANGE, YCOORD, YRANGE, ZCOORD, and ZRANGE.

Referenced by createSubPlotSet().

Here is the call graph for this function:

◆ createStd3dPlot()

void Plot::createStd3dPlot ( size_t  nPlotCompose,
size_t  nPlotComposeSize 
)
protected

◆ createStdPlot()

void Plot::createStdPlot ( size_t  nPlotCompose,
size_t  nPlotComposeSize 
)
protected

◆ createSubPlotSet()

size_t Plot::createSubPlotSet ( bool &  bAnimateVar,
std::vector< std::string > &  vPlotCompose,
size_t  nSubPlotStart,
size_t  nMultiplots[2],
size_t &  nSubPlots,
size_t &  nSubPlotMap 
)
protected

This member function handles the creation of a single subplot, which may be a single plot or part of a plot composition.

Parameters
bAnimateVarbool&
vPlotComposevector<string>&
nSubPlotStartsize_t
nMultiplots[2]size_t
nSubPlotssize_t&
nSubPlotMapsize_t&
Returns
size_t

Definition at line 515 of file plotting.cpp.

References _defVars, _functions, _graph, _lang, _option, _parser, _pData, _pInfo, addLegends(), applyPlotSizeAndQualitySettings(), PlotAssetManager::assets, PlotInfo::b2D, PlotInfo::b2DVect, PlotInfo::b3D, PlotInfo::b3DVect, PlotInfo::bDraw, PlotInfo::bDraw3D, FunctionDefinitionManager::call(), SyntaxError::CANNOT_PLOT_STRINGS, CARTESIAN, clearData(), CRANGE, createPlotOrAnimation(), dataRanges, defaultRanges(), PlotData::deleteData(), displayMessage(), mu::ParserBase::Eval(), evaluateSubplot(), extractDataValues(), filename(), findCommand(), findVariableInExpression(), PlotData::FLOAT_BARS, PlotData::FLOAT_HBARS, SyntaxError::FUNCTION_ERROR, Language::get(), PlotData::getAnimateSamples(), NumeReKernel::getInstance(), PlotData::getLogscale(), getNextArgument(), PlotData::getRanges(), PlotData::getSettings(), NumeReKernel::getStringParser(), NumeRe::StringVarFactory::getStringValues(), PlotData::INT_COORDS, PlotData::INT_SAMPLES, IntervalSet::intervals, SyntaxError::invalid_position, isDraw(), isInQuotes(), isNotEmptyExpression(), PlotData::LOG_ALPHAMASK, PlotData::LOG_COLORMASK, PlotData::LOG_SILENTMODE, m_manager, m_types, PlotInfo::nFunctions, nLegends, Match::nPos, PlotInfo::nSamples, SyntaxError::NUMBER_OF_FUNCTIONS_NOT_MATCHING, SyntaxError::PLOT_ERROR, prepareMemory(), NumeReKernel::printPreFmt(), promptForUserInput(), PlotInfo::ranges, PlotInfo::sCommand, secDataRanges, separateFunctionsAndData(), mu::ParserBase::SetExpr(), PlotData::setLocalComposeParams(), setLogScale(), IntervalSet::setNames(), PlotData::setParams(), setStyles(), sFunc, sOutputName, PlotInfo::sPlotParams, Match::sString, PlotData::STR_FILENAME, StripSpaces(), Settings::systemPrints(), TCOORD, toSystemCodePage(), TRANGE, DefaultVariables::vValue, XCOORD, XRANGE, YCOORD, YRANGE, ZCOORD, and ZRANGE.

Referenced by Plot().

Here is the call graph for this function:

◆ defaultRanges()

void Plot::defaultRanges ( size_t  nPlotCompose,
bool  bNewSubPlot 
)
protected

This member function applies the default ranges to the plotting ranges.

Parameters
nPlotComposesize_t
bNewSubPlotbool
Returns
void

Default ranges are used, whenever the user does not supply custom ones. If the current plot contains data sets, then those ranges are used as default ranges (if the user did not supply custom ones).

Temporary

Definition at line 4428 of file plotting.cpp.

References _pData, _pInfo, PlotInfo::b2D, PlotInfo::b2DVect, PlotInfo::b3D, PlotInfo::b3DVect, PlotInfo::bDraw, PlotInfo::bDraw3D, CARTESIAN, clearData(), dataRanges, PlotData::getAddAxis(), PlotData::getGivenRanges(), PlotData::getLogscale(), PlotData::getRanges(), PlotData::getRangeSetting(), PlotData::getSettings(), PlotAssetManager::hasDataPlots(), PlotData::INT_COORDS, SyntaxError::invalid_position, mu::isinf(), mu::isnan(), Axis::ivl, m_manager, M_PI, Interval::max(), Interval::min(), PlotInfo::nMaxPlotDim, SyntaxError::PLOTDATA_IS_NAN, POLAR_PZ, POLAR_RP, POLAR_RZ, PlotInfo::ranges, PlotInfo::sCommand, secDataRanges, PlotInfo::secranges, SPHERICAL_PT, SPHERICAL_RP, SPHERICAL_RT, SyntaxError::WRONG_PLOT_INTERVAL_FOR_LOGSCALE, XCOORD, XRANGE, YCOORD, YRANGE, ZCOORD, and ZRANGE.

Referenced by createPlotOrAnimation(), and createSubPlotSet().

Here is the call graph for this function:

◆ determinePlottingDimensions()

void Plot::determinePlottingDimensions ( const std::string &  sPlotCommand)
protected

This member function determines the maximal plotting dimension of the passed command.

Parameters
sPlotCommandconst string&
Returns
void

Definition at line 475 of file plotting.cpp.

References _pInfo, and PlotInfo::nMaxPlotDim.

Referenced by Plot().

◆ directionalLight()

void Plot::directionalLight ( double  dPhi,
double  dTheta,
int  nId,
char  cColor = 'w',
double  dBrightness = 0.5 
)
protected

This member function calculates the light source depending on the orientation of the graph. It is not used.

Parameters
dPhidouble
dThetadouble
nIdint
cColorchar
dBrightnessdouble
Returns
void

Definition at line 5701 of file plotting.cpp.

References _graph, _pInfo, M_PI, PlotInfo::ranges, XRANGE, YRANGE, and ZRANGE.

◆ displayMessage()

void Plot::displayMessage ( bool  bAnimateVar)
protected

This member function writes a message to the terminal indicating that the algorithm is currently working.

Parameters
bAnimateVarbool
Returns
void

Definition at line 3475 of file plotting.cpp.

References _lang, _option, _pData, _pInfo, PlotInfo::b2D, PlotInfo::b2DVect, PlotInfo::b3D, PlotInfo::b3DVect, PlotInfo::bDraw, PlotInfo::bDraw3D, Language::get(), PlotData::getSettings(), PlotData::INT_HIGHRESLEVEL, Settings::isDraftMode(), PlotData::LOG_FLOW, PlotData::LOG_PIPE, PlotData::LOG_SILENTMODE, min, PlotInfo::nSamples, NumeReKernel::printPreFmt(), PlotInfo::sCommand, Settings::systemPrints(), and toSystemCodePage().

Referenced by createSubPlotSet().

Here is the call graph for this function:

◆ evaluateSubplot()

void Plot::evaluateSubplot ( std::string &  sCmd,
size_t  nMultiplots[2],
size_t &  nSubPlots,
size_t &  nSubPlotMap 
)
protected

This member function evaluates the subplot command in a plot composition and determines, where to place the next plot and if that is actually possible.

Parameters
sCmdstring&
nMultiplots[2]size_t
nSubPlotssize_t&
nSubPlotMapsize_t&
Returns
void

Definition at line 3318 of file plotting.cpp.

References _data, _functions, _graph, _option, _parser, _pData, FunctionDefinitionManager::call(), checkMultiPlotArray(), MemoryManager::containsTablesOrClusters(), mu::ParserBase::Eval(), findCommand(), findParameter(), SyntaxError::FUNCTION_ERROR, getArgAtPos(), getDataElements(), PlotData::getSettings(), PlotData::INT_LEGENDPOSITION, intCast(), SyntaxError::invalid_position, SyntaxError::INVALID_SUBPLOT_INDEX, PlotData::LOG_SCHEMATIC, nLegends, mu::ParserBase::SetExpr(), and StripSpaces().

Referenced by createSubPlotSet().

Here is the call graph for this function:

◆ expandStyleForCurveArray()

string Plot::expandStyleForCurveArray ( const std::string &  sCurrentStyle,
bool  expand 
)
protected

This protected member function expands a style string into 9 style string with different luminosities. This is used by curve arrays.

Parameters
sCurrentStyleconst string&
expandbool
Returns
string

Definition at line 3287 of file plotting.cpp.

References toString().

Referenced by plotstd().

Here is the call graph for this function:

◆ extractDataValues()

void Plot::extractDataValues ( const std::vector< std::string > &  vDataPlots)
protected

Creates the internal mglData objects and fills them with the data values from the MemoryManager class instance in the kernel.

Parameters
vDataPlotsconst std::vector<std::string>&
Returns
void

Definition at line 3663 of file plotting.cpp.

References _data, _pData, _pInfo, PlotAssetManager::ABSREIM, PlotAssetManager::assets, Indices::col, Interval::combine(), CPLX_PLANE, CPLX_REIM, dataRanges, DataAccessParser::evalIndices(), PlotData::FLOAT_BARS, PlotData::FLOAT_HBARS, VectorIndex::front(), getAccessParserForPlotAndFit(), NumeRe::ClusterManager::getCluster(), MemoryManager::getColElements(), MemoryManager::getCols(), getDataFromObject(), DataAccessParser::getDataGridDimensions(), DataAccessParser::getDataObject(), DataAccessParser::getIndices(), MemoryManager::getLines(), PlotData::getSettings(), PlotAssetManager::IMAG, PlotData::INT_COMPLEXMODE, VectorIndex::INVALID, SyntaxError::INVALID_DATA_ACCESS, SyntaxError::INVALID_INDEX, SyntaxError::invalid_position, DataAccessParser::isCluster(), isMesh2D(), VectorIndex::isOpenEnd(), isPlot1D(), isPlot3D(), isVect2D(), VectorIndex::last(), PlotData::LOG_BOXPLOT, PlotData::LOG_PARAMETRIC, PlotData::LOG_XERROR, PlotData::LOG_YERROR, m_manager, m_types, max, min, VectorIndex::numberOfNodes(), SyntaxError::PLOT_ERROR, VectorIndex::prepend(), PT_DATA, PT_NONE, mu::real(), PlotAssetManager::REAL, PlotAssetManager::REIM, Indices::row, PlotInfo::sCommand, secDataRanges, VectorIndex::setRange(), NumeRe::Cluster::size(), VectorIndex::size(), VectorIndex::subidx(), VectorIndex::to_string(), XCOORD, XRANGE, YCOORD, YRANGE, ZCOORD, and ZRANGE.

Referenced by createPlotOrAnimation(), and createSubPlotSet().

Here is the call graph for this function:

◆ filename()

void Plot::filename ( size_t  nPlotComposeSize,
size_t  nPlotCompose 
)
protected

This member function creates a default plot file name based upon the currently used plotting command.

Parameters
nPlotComposeSizesize_t
nPlotComposesize_t
Returns
void

Definition at line 3146 of file plotting.cpp.

References _pData, _pInfo, bOutputDesired, NumeRe::StringParser::evalAndFormat(), PlotData::getAnimateSamples(), NumeReKernel::getInstance(), PlotData::getSettings(), NumeReKernel::getStringParser(), PlotInfo::sCommand, PlotData::setFileName(), and PlotData::STR_FILENAME.

Referenced by createSubPlotSet().

Here is the call graph for this function:

◆ fillData()

void Plot::fillData ( double  dt_max,
int  t_animate 
)
protected

This member function calculates the plotting data points from usual expressions.

Parameters
dt_maxdouble
t_animateint
Returns
void

Definition at line 4589 of file plotting.cpp.

References _defVars, _option, _parser, _pData, _pInfo, PlotAssetManager::assets, PlotInfo::bDraw, PlotInfo::bDraw3D, convertVectorToExpression(), mu::ParserBase::Eval(), getAllArguments(), PlotData::getAnimateSamples(), PlotData::getLogscale(), isMesh2D(), isMesh3D(), isPlot1D(), isPlot3D(), isVect2D(), isVect3D(), m_manager, m_types, PlotInfo::nFunctions, PlotInfo::nSamples, SyntaxError::PLOT_ERROR, PT_FUNCTION, PlotInfo::ranges, PlotInfo::sCommand, mu::ParserBase::SetExpr(), sFunc, TCOORD, TRANGE, DefaultVariables::vValue, XCOORD, XRANGE, YCOORD, YRANGE, ZCOORD, and ZRANGE.

Referenced by createPlotOrAnimation().

Here is the call graph for this function:

◆ fitPlotRanges()

void Plot::fitPlotRanges ( size_t  nPlotCompose,
bool  bNewSubPlot 
)
protected

This member function fits the remaining plotting ranges for the calculated interval of data points.

Parameters
nPlotComposesize_t
bNewSubPlotbool
Returns
void

E.g. if a usual plot is calculated and the user did only supply the x range, then this function will calculate the corresponding y range (and extend it to about 10%).

Definition at line 4879 of file plotting.cpp.

References _pData, _pInfo, PlotAssetManager::ABSREIM, ALLRANGES, PlotInfo::b2D, PlotInfo::b2DVect, PlotInfo::b3D, PlotInfo::b3DVect, PlotInfo::bDraw, PlotInfo::bDraw3D, CARTESIAN, clearData(), CPLX_PLANE, CPLX_REIM, dataRanges, PlotData::getAddAxis(), PlotData::getAxisScale(), PlotAssetManager::getDataIntervals(), PlotAssetManager::getFunctionIntervals(), PlotData::getGivenRanges(), PlotData::getLogscale(), PlotData::getRanges(), PlotData::getRangeSetting(), PlotData::getSettings(), PlotAssetManager::hasDataPlots(), PlotAssetManager::IMAG, PlotData::INT_COMPLEXMODE, PlotData::INT_COORDS, SyntaxError::invalid_position, mu::isinf(), isMesh2D(), mu::isnan(), isPlot1D(), isPlot3D(), Axis::ivl, m_manager, Interval::max(), Interval::min(), ONLYLEFT, ONLYRIGHT, SyntaxError::PLOTDATA_IS_NAN, POLAR_PZ, POLAR_RP, PlotInfo::ranges, PlotAssetManager::REAL, PlotAssetManager::REIM, PlotInfo::sCommand, PlotInfo::secranges, PlotData::setAddAxis(), sFunc, SPHERICAL_PT, PlotAssetManager::weightedRange(), SyntaxError::WRONG_PLOT_INTERVAL_FOR_LOGSCALE, XRANGE, YCOORD, YRANGE, and ZRANGE.

Referenced by createPlotOrAnimation().

Here is the call graph for this function:

◆ fmod()

mglData Plot::fmod ( const mglData &  _mData,
double  dDenominator 
)
protected

This member function applies a floating point modulo operator on the data set.

Parameters
_mDataconst mglData&
dDenominatordouble
Returns
mglData

Definition at line 6009 of file plotting.cpp.

References fmod(), and getNN().

Referenced by fmod().

Here is the call graph for this function:

◆ getLabelPosition()

double Plot::getLabelPosition ( int  nCoord)
protected

This member function determines the position of the axis label, which depends on whether a box surrounds the plot and the selected coordinate system.

Parameters
nCoordint
Returns
double

Definition at line 6899 of file plotting.cpp.

References _pData, _pInfo, CARTESIAN, PlotData::getRotateAngle(), PlotData::getSettings(), hasSecAxisBox(), PlotData::INT_COORDS, PlotData::LOG_BOX, POLAR_PZ, POLAR_RP, POLAR_RZ, SPHERICAL_PT, SPHERICAL_RP, SPHERICAL_RT, XCOORD, YCOORD, and ZCOORD.

Referenced by CoordSettings().

Here is the call graph for this function:

◆ getLegendStyle()

string Plot::getLegendStyle ( const std::string &  sLegend)
protected

This member function prepares the legend strings to fit the selected legend style (only colours or only styles or both).

Parameters
sLegendconst string&
Returns
string

Definition at line 5983 of file plotting.cpp.

References _pData, PlotData::getSettings(), and PlotData::INT_LEGENDSTYLE.

Referenced by createStd3dPlot(), and createStdPlot().

Here is the call graph for this function:

◆ getNN()

long Plot::getNN ( const mglData &  _mData)
protected

This member function is a helper to return the number of data points located in the passed mglData object.

Parameters
_mDataconst mglData&
Returns
long

Definition at line 3130 of file plotting.cpp.

Referenced by createStd3dPlot(), createStdPlot(), fmod(), plotstd(), and plotstd3d().

◆ getProjBackground()

double Plot::getProjBackground ( double  dPhi,
int  nEdge = 0 
)
protected

This member function determines the positions for the projected density and contour maps, which depend on the rotation of the graph and are chosen in a way that they are always in the background of the graph.

Parameters
dPhidouble
nEdgeint
Returns
double

Definition at line 5939 of file plotting.cpp.

References _pInfo, PlotInfo::ranges, XRANGE, and YRANGE.

Referenced by create3dPlot().

◆ operator=()

Plot & Plot::operator= ( const Plot )
privatedelete

◆ passRangesToGraph()

◆ plot2d()

bool Plot::plot2d ( mglData &  _mData,
mglData &  _mData2,
mglData *  _mAxisVals,
mglData &  _mContVec 
)
protected

This member function creates an actual single two-dimensional plot based upon the current plotting command.

Parameters
_mDatamglData&
_mData2mglData&
_mAxisValsmglData*
_mContVecmglData&
Returns
bool

Definition at line 1233 of file plotting.cpp.

References _graph, _option, _pData, _pInfo, CalcCutBox(), CPLX_PLANE, PlotData::FLOAT_BARS, PlotData::getColorScheme(), PlotData::getColorSchemeLight(), PlotData::getColorSchemeMedium(), PlotData::getRotateAngle(), PlotData::getSettings(), PlotData::INT_COMPLEXMODE, PlotData::INT_COORDS, PlotData::INT_HIGHRESLEVEL, Settings::isDraftMode(), PlotData::LOG_ALPHAMASK, PlotData::LOG_BOX, PlotData::LOG_COLORMASK, PlotData::LOG_CONTFILLED, PlotData::LOG_CONTLABELS, PlotData::LOG_CONTPROJ, PlotData::LOG_CUTBOX, PlotInfo::nFunctions, PlotInfo::nStyle, PlotInfo::ranges, PlotInfo::sCommand, PlotInfo::sContStyles, and ZRANGE.

Referenced by create2dPlot().

Here is the call graph for this function:

◆ plotstd()

bool Plot::plotstd ( mglData &  _mData,
mglData &  _mAxisVals,
mglData  _mData2[2],
const short  nType 
)
protected

This member function creates an actual single one-dimensional plot based upon the current plotting command.

Parameters
_mDatamglData&
_mAxisValsmglData&
_mData2[2]mglData
nTypeconst short
Returns
bool

Definition at line 1675 of file plotting.cpp.

References _graph, _pData, _pInfo, composeColoursForBarChart(), countValidElements(), duplicatePoints(), expandStyleForCurveArray(), PlotData::FLOAT_BARS, PlotData::FLOAT_HBARS, PlotData::getColors(), getNN(), PlotData::getSettings(), PlotData::LOG_AREA, PlotData::LOG_BOXPLOT, PlotData::LOG_CONNECTPOINTS, PlotData::LOG_INTERPOLATE, PlotData::LOG_REGION, PlotData::LOG_STEPPLOT, PlotData::LOG_TABLE, PlotData::LOG_XERROR, PlotData::LOG_YERROR, PlotInfo::nextStyle(), PlotInfo::nSamples, PlotInfo::nStyle, PT_FUNCTION, PlotInfo::sConPointStyles, PlotInfo::sLineStyles, and PlotInfo::sPointStyles.

Referenced by createStdPlot().

Here is the call graph for this function:

◆ plotstd3d()

bool Plot::plotstd3d ( mglData  _mData[3],
mglData  _mData2[3],
const short  nType 
)
protected

This member function creates an actual single three-dimensional trajectory.

Parameters
_mData[3]mglData
_mData2[3]mglData
nTypeconst short
Returns
bool

Definition at line 3014 of file plotting.cpp.

References _graph, _pData, _pInfo, countValidElements(), duplicatePoints(), PlotData::FLOAT_BARS, PlotData::FLOAT_HBARS, PlotData::getColors(), PlotData::getColorScheme(), getNN(), PlotData::getSettings(), PlotData::INT_MARKS, PlotData::LOG_AREA, PlotData::LOG_BOXPLOT, PlotData::LOG_CONNECTPOINTS, PlotData::LOG_CRUST, PlotData::LOG_INTERPOLATE, PlotData::LOG_REGION, PlotData::LOG_STEPPLOT, PlotData::LOG_XERROR, PlotData::LOG_YERROR, PlotInfo::nextStyle(), PlotInfo::nSamples, PlotInfo::nStyle, PT_FUNCTION, PlotInfo::sConPointStyles, PlotInfo::sLineStyles, PlotInfo::sPointStyles, toString(), XCOORD, YCOORD, and ZCOORD.

Referenced by createStd3dPlot().

Here is the call graph for this function:

◆ prepareMemory()

void Plot::prepareMemory ( )
protected

This member function prepares the memory array in the PlotData class instance to fit the desired plotting style.

Returns
void

Definition at line 4361 of file plotting.cpp.

References _pInfo, PlotAssetManager::assets, isMesh2D(), isMesh3D(), isPlot1D(), isPlot3D(), isVect2D(), isVect3D(), m_manager, m_types, PlotInfo::nSamples, PT_FUNCTION, and PlotInfo::sCommand.

Referenced by createSubPlotSet().

Here is the call graph for this function:

◆ separateFunctionsAndData()

std::vector< std::string > Plot::separateFunctionsAndData ( )
protected

This member function separates the functions from the data plots and returns a vector containing the definitions of the data plots.

Returns
std::vector<std::string>

Definition at line 3590 of file plotting.cpp.

References _data, _pData, _pInfo, PlotAssetManager::assets, PlotInfo::b2DVect, PlotInfo::b3D, PlotInfo::b3DVect, PlotInfo::bDraw, PlotInfo::bDraw3D, MemoryManager::containsTablesOrClusters(), createDataLegends(), SyntaxError::DATAPOINTS_CANNOT_BE_MODIFIED_WHILE_PLOTTING, PlotData::getAxisbind(), getMatchingParenthesis(), getNextArgument(), SyntaxError::invalid_position, NumeRe::ClusterManager::isCluster(), MemoryManager::isTable(), m_manager, m_types, PT_DATA, PT_FUNCTION, sFunc, and StripSpaces().

Referenced by createSubPlotSet().

Here is the call graph for this function:

◆ setLogScale()

void Plot::setLogScale ( bool  bzLogscale)
protected

This member function handles the complex logscale logic applied to the coordinate system of the plot.

Parameters
bzLogscalebool
Returns
void

Definition at line 5672 of file plotting.cpp.

References _graph, _pData, CARTESIAN, CRANGE, PlotData::getLogscale(), PlotData::getSettings(), PlotData::INT_COORDS, XRANGE, YRANGE, and ZRANGE.

Referenced by createSubPlotSet().

Here is the call graph for this function:

◆ setStyles()

void Plot::setStyles ( )
protected

This member function prepares the line and point styles based upon the currently used parameters.

Returns
void

Definition at line 3228 of file plotting.cpp.

References _pData, _pInfo, PlotData::getColors(), PlotData::getLineStyles(), PlotData::getSettings(), PlotData::LOG_DRAWPOINTS, PlotData::LOG_XERROR, PlotData::LOG_YERROR, PlotInfo::nStyleMax, PlotInfo::sConPointStyles, PlotInfo::sContStyles, PlotInfo::sLineStyles, PlotInfo::sPointStyles, PlotData::STR_LINESIZES, and PlotData::STR_POINTSTYLES.

Referenced by createSubPlotSet().

Here is the call graph for this function:

Member Data Documentation

◆ _data

◆ _functions

FunctionDefinitionManager& Plot::_functions
private

Definition at line 61 of file plotting.hpp.

Referenced by createSubPlotSet(), and evaluateSubplot().

◆ _graph

◆ _option

◆ _parser

◆ _pData

◆ _pInfo

◆ bOutputDesired

bool Plot::bOutputDesired
private

Definition at line 53 of file plotting.hpp.

Referenced by createPlotOrAnimation(), filename(), and Plot().

◆ dataRanges

IntervalSet Plot::dataRanges
private

◆ m_manager

◆ m_types

std::vector<short> Plot::m_types
private

◆ nLegends

size_t Plot::nLegends
private

◆ secDataRanges

IntervalSet Plot::secDataRanges
private

Definition at line 52 of file plotting.hpp.

Referenced by createSubPlotSet(), defaultRanges(), and extractDataValues().

◆ sFunc

std::string Plot::sFunc
private

◆ sOutputName

std::string Plot::sOutputName
private

Definition at line 55 of file plotting.hpp.

Referenced by createPlotOrAnimation(), createSubPlotSet(), and Plot().


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