NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
plotting.cpp File Reference
#include <wx/image.h>
#include "plotting.hpp"
#include "plotasset.hpp"
#include "../maths/parser_functions.hpp"
#include "../../kernel.hpp"
Include dependency graph for plotting.cpp:

Go to the source code of this file.

Macros

#define APPR_ONE   0.9999999
 
#define APPR_TWO   1.9999999
 
#define STYLES_COUNT   20
 

Functions

std::string removeQuotationMarks (const std::string &)
 This function simply removes the surrounding quotation marks. More...
 
static bool isPlot1D (const std::string &sCommand)
 
static bool isPlot3D (const std::string &sCommand)
 
static bool isMesh2D (const std::string &sCommand)
 
static bool isMesh3D (const std::string &sCommand)
 
static bool isVect2D (const std::string &sCommand)
 
static bool isVect3D (const std::string &sCommand)
 
static bool isDraw (const std::string &sCommand)
 
static bool has3DView (const std::string &sCommand)
 
void createPlot (std::string &sCmd, MemoryManager &_data, mu::Parser &_parser, Settings &_option, FunctionDefinitionManager &_functions, PlotData &_pData)
 Wrapper function for creating plots. Will create an instance of the Plot class, which will handle the plotting process. More...
 
mglData duplicatePoints (const mglData &_mData)
 This static function is a fix for the MathGL bug, which connects points outside of the data range. More...
 
static void writeTiff (mglGraph *_graph, const string &sOutputName)
 This static function uses wxWidgets functionality to add TIFF exporting support to MathGL. More...
 
static mglData scaleSecondaryToPrimaryInterval (const mglData &_mData, const Interval &ivl, const Interval &secIvl)
 Simple helper function for Plot::createStdPlot. More...
 
static void applyNiceAxis (Interval &ivl, bool isLogarithmic)
 Apply the needed interval modification to switch to an optical "nice" and well readable interval. More...
 
static bool hasSecAxisBox (const PlotData &_pData, const PlotInfo &_pInfo)
 Static helper function to determine, whether a box is needed due to secondary axes. More...
 

Variables

DefaultVariables _defVars
 
mglGraph _fontData
 

Macro Definition Documentation

◆ APPR_ONE

#define APPR_ONE   0.9999999

Definition at line 93 of file plotting.cpp.

◆ APPR_TWO

#define APPR_TWO   1.9999999

Definition at line 94 of file plotting.cpp.

◆ STYLES_COUNT

#define STYLES_COUNT   20

Definition at line 95 of file plotting.cpp.

Function Documentation

◆ applyNiceAxis()

static void applyNiceAxis ( Interval ivl,
bool  isLogarithmic 
)
static

Apply the needed interval modification to switch to an optical "nice" and well readable interval.

Parameters
ivlInterval&
isLogarithmicbool
Returns
void

Definition at line 5123 of file plotting.cpp.

References date::abs(), date::ceil(), date::floor(), Interval::front(), intPower(), mu::isnan(), Interval::max(), max, Interval::min(), Interval::range(), and Interval::reset().

Referenced by Plot::passRangesToGraph().

Here is the call graph for this function:

◆ createPlot()

void createPlot ( std::string &  sCmd,
MemoryManager _data,
mu::Parser _parser,
Settings _option,
FunctionDefinitionManager _functions,
PlotData _pData 
)

Wrapper function for creating plots. Will create an instance of the Plot class, which will handle the plotting process.

Parameters
sCmdstd::string&
_dataDatafile&
_parsermu::Parser&
_optionSettings&
_functionsDefine&
_pDataPlotData&
Returns
void

Definition at line 113 of file plotting.cpp.

References Plot::createGraphHelper(), NumeRe::WindowManager::createWindow(), PlotData::deleteData(), NumeReKernel::getInstance(), PlotData::getSettings(), PlotData::getTargetGUI(), NumeRe::WindowManager::getWindowInformation(), NumeReKernel::getWindowManager(), SyntaxError::INVALID_WINDOW_ID, SyntaxError::INVALID_WINDOW_ITEM_ID, PlotData::LOG_OPENIMAGE, PlotData::LOG_SILENTMODE, NumeRe::WindowInformation::nStatus, NumeRe::Window::setItemGraph(), NumeRe::STATUS_RUNNING, and NumeRe::WindowInformation::window.

Referenced by cmd_plotting().

Here is the call graph for this function:

◆ duplicatePoints()

mglData duplicatePoints ( const mglData &  _mData)

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

Parameters
_mDataconst mglData&
Returns
mglData

Definition at line 157 of file plotting.cpp.

Referenced by Plot::plotstd(), and Plot::plotstd3d().

◆ has3DView()

static bool has3DView ( const std::string &  sCommand)
static

Definition at line 81 of file plotting.cpp.

References isMesh3D(), and isPlot3D().

Referenced by Plot::createPlotOrAnimation().

Here is the call graph for this function:

◆ hasSecAxisBox()

static bool hasSecAxisBox ( const PlotData _pData,
const PlotInfo _pInfo 
)
static

Static helper function to determine, whether a box is needed due to secondary axes.

Parameters
_pDataconst PlotData&
_pInfoconst PlotInfo&
Returns
bool

Definition at line 6038 of file plotting.cpp.

References CARTESIAN, Interval::front(), PlotData::getAddAxis(), PlotData::getSettings(), PlotData::INT_COORDS, mu::isnan(), isPlot1D(), Axis::ivl, PlotData::LOG_SCHEMATIC, PlotInfo::sCommand, XCOORD, and YCOORD.

Referenced by Plot::applyGrid(), Plot::CoordSettings(), and Plot::getLabelPosition().

Here is the call graph for this function:

◆ isDraw()

static bool isDraw ( const std::string &  sCommand)
static

Definition at line 76 of file plotting.cpp.

Referenced by Plot::createSubPlotSet().

◆ isMesh2D()

static bool isMesh2D ( const std::string &  sCommand)
static

◆ isMesh3D()

static bool isMesh3D ( const std::string &  sCommand)
static

◆ isPlot1D()

static bool isPlot1D ( const std::string &  sCommand)
static

◆ isPlot3D()

static bool isPlot3D ( const std::string &  sCommand)
static

◆ isVect2D()

static bool isVect2D ( const std::string &  sCommand)
static

◆ isVect3D()

static bool isVect3D ( const std::string &  sCommand)
static

◆ removeQuotationMarks()

std::string removeQuotationMarks ( const std::string &  sString)

This function simply removes the surrounding quotation marks.

Parameters
sStringconst std::string&
Returns
std::string

Definition at line 79 of file stringfunctions.hpp.

Referenced by Plot::createDataLegends(), and Plot::createStdPlot().

◆ scaleSecondaryToPrimaryInterval()

static mglData scaleSecondaryToPrimaryInterval ( const mglData &  _mData,
const Interval ivl,
const Interval secIvl 
)
static

Simple helper function for Plot::createStdPlot.

Parameters
_mDataconst mglData&
ivlconst Interval&
secIvlconst Interval&
Returns
mglData

Definition at line 1372 of file plotting.cpp.

References Interval::min(), and Interval::range().

Referenced by Plot::createStdPlot().

Here is the call graph for this function:

◆ writeTiff()

static void writeTiff ( mglGraph *  _graph,
const string &  sOutputName 
)
static

This static function uses wxWidgets functionality to add TIFF exporting support to MathGL.

Parameters
_graphmglGraph*
sOutputNameconst string&
Returns
void

Definition at line 199 of file plotting.cpp.

Referenced by Plot::Plot().

Variable Documentation

◆ _defVars

◆ _fontData

mglGraph _fontData
extern

Definition at line 40 of file kernel.cpp.

Referenced by Plot::applyPlotSizeAndQualitySettings().