philsupertramp/game-math
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
FunctionPlot Class Reference

#include <Plot.h>

Inheritance diagram for FunctionPlot:
Plot

Public Member Functions

 FunctionPlot (std::function< double(const double &)> fun, const char *name="")
 
void AddData (const double &start, const double &end, const double &stepSize, const char *name)
 
- Public Member Functions inherited from Plot
 Plot (const std::string &title="")
 
void clear_file ()
 
void title (const std::string &title)
 
void xAxis (const std::string &name)
 
void yAxis (const std::string &name)
 
void pointSize (const int &size)
 
void lineWidth (const int &size)
 
void AddData (const Matrix< double > &x, const Matrix< double > &y, const std::string &name, DataTypes dataType=DataTypes::NONE, const char *character=nullptr)
 
void AddData (const Matrix< double > &mat, const std::string &name, DataTypes dataTypeName=DataTypes::NONE, const char *pointChar=nullptr, int dimensions=2)
 
virtual void operator() () const
 

Private Attributes

std::function< double(const double &)> Function
 Function to evaluate and display. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Plot
void writeAttributes (FILE *gnuplot) const
 
- Protected Attributes inherited from Plot
const char * dataFileName
 data storage file name More...
 
const char * plotTypeName
 representation of plot type More...
 
const char * plotType = "plot"
 representation of plot type More...
 
FILE * storageFile = nullptr
 data storage file More...
 
PlotAttributes attributes = {}
 attributes for plot More...
 
int numElements = 0
 number elements within the plot More...
 
PlotBoundary bY {}
 x-axis boundaries for the resulting plot More...
 
PlotBoundary bX {}
 y-axis boundaries for the resulting plot More...
 

Detailed Description

Wrapper class to easily generate a plot based on a function.

Examples
plot/TestPlot.cpp.

Constructor & Destructor Documentation

◆ FunctionPlot()

FunctionPlot::FunctionPlot ( std::function< double(const double &)>  fun,
const char *  name = "" 
)
inlineexplicit

default constructor, requires function fun

Parameters
funfunction to plot
nameplot title

Member Function Documentation

◆ AddData()

void FunctionPlot::AddData ( const double &  start,
const double &  end,
const double &  stepSize,
const char *  name 
)
inline

Adds data to the plot context

Parameters
startstarting value
endend value
stepSizedesired step size
namedata set name
Examples
plot/TestPlot.cpp.

Member Data Documentation

◆ Function

std::function<double(const double&)> FunctionPlot::Function
private

Function to evaluate and display.


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