Forge
|
Chart is base canvas where other plottable objects are rendered. More...
#include <chart.h>
Public Member Functions | |
FGAPI | Chart (const ChartType cType) |
Creates a Chart object with given dimensional property. More... | |
FGAPI | Chart (const Chart &pOther) |
Chart copy constructor. More... | |
FGAPI | ~Chart () |
Chart destructor. More... | |
FGAPI void | setAxesTitles (const char *pX, const char *pY, const char *pZ=NULL) |
Set axes titles for the chart. More... | |
FGAPI void | setAxesLimits (const float pXmin, const float pXmax, const float pYmin, const float pYmax, const float pZmin=0, const float pZmax=0) |
Set axes data ranges. More... | |
FGAPI void | getAxesLimits (float *pXmin, float *pXmax, float *pYmin, float *pYmax, float *pZmin=NULL, float *pZmax=NULL) |
Get axes data ranges. More... | |
FGAPI void | setLegendPosition (const float pX, const float pY) |
Set legend position for Chart. More... | |
FGAPI void | add (const Image &pImage) |
Add an existing Image object to the current chart. More... | |
FGAPI void | add (const Histogram &pHistogram) |
Add an existing Histogram object to the current chart. More... | |
FGAPI void | add (const Plot &pPlot) |
Add an existing Plot object to the current chart. More... | |
FGAPI void | add (const Surface &pSurface) |
Add an existing Surface object to the current chart. More... | |
FGAPI void | add (const VectorField &pVectorField) |
Add an existing vector field object to the current chart. More... | |
FGAPI Image | image (const unsigned pWidth, const unsigned pHeight, const ChannelFormat pFormat=FG_RGBA, const dtype pDataType=f32) |
Create and add an Image object to the current chart. More... | |
FGAPI Histogram | histogram (const unsigned pNBins, const dtype pDataType) |
Create and add an Histogram object to the current chart. More... | |
FGAPI Plot | plot (const unsigned pNumPoints, const dtype pDataType, const PlotType pPlotType=FG_PLOT_LINE, const MarkerType pMarkerType=FG_MARKER_NONE) |
Create and add an Plot object to the current chart. More... | |
FGAPI Surface | surface (const unsigned pNumXPoints, const unsigned pNumYPoints, const dtype pDataType, const PlotType pPlotType=FG_PLOT_SURFACE, const MarkerType pMarkerType=FG_MARKER_NONE) |
Create and add an Plot object to the current chart. More... | |
FGAPI VectorField | vectorField (const unsigned pNumPoints, const dtype pDataType) |
Create and add an Vector Field object to the current chart. More... | |
FGAPI void | render (const Window &pWindow, const int pX, const int pY, const int pVPW, const int pVPH) const |
Render the chart to given window. More... | |
FGAPI fg_chart | get () const |
Get the handle to internal implementation of Chart. More... | |
FGAPI ChartType | getChartType () const |
Get the type of the chart. More... | |
Chart is base canvas where other plottable objects are rendered.
Charts come in two types:
Creates a Chart object with given dimensional property.
[in] | cType | is chart dimension property |
FGAPI void add | ( | const VectorField & | pVectorField | ) |
Add an existing vector field object to the current chart.
[in] | pVectorField | is the Surface to render on the chart |
FGAPI void getAxesLimits | ( | float * | pXmin, |
float * | pXmax, | ||
float * | pYmin, | ||
float * | pYmax, | ||
float * | pZmin = NULL , |
||
float * | pZmax = NULL |
||
) |
Get axes data ranges.
[out] | pXmin | is x-axis minimum data value |
[out] | pXmax | is x-axis maximum data value |
[out] | pYmin | is y-axis minimum data value |
[out] | pYmax | is y-axis maximum data value |
[out] | pZmin | is z-axis minimum data value |
[out] | pZmax | is z-axis maximum data value |
Create and add an Histogram object to the current chart.
[in] | pNBins | is number of bins the data is sorted out |
[in] | pDataType | takes one of the values of dtype that indicates the integral data type of histogram data |
FGAPI Image image | ( | const unsigned | pWidth, |
const unsigned | pHeight, | ||
const ChannelFormat | pFormat = FG_RGBA , |
||
const dtype | pDataType = f32 |
||
) |
Create and add an Image object to the current chart.
[in] | pWidth | Width of the image |
[in] | pHeight | Height of the image |
[in] | pFormat | Color channel format of image, uses one of the values of ChannelFormat |
[in] | pDataType | takes one of the values of dtype that indicates the integral data type of histogram data |
FGAPI Plot plot | ( | const unsigned | pNumPoints, |
const dtype | pDataType, | ||
const PlotType | pPlotType = FG_PLOT_LINE , |
||
const MarkerType | pMarkerType = FG_MARKER_NONE |
||
) |
Create and add an Plot object to the current chart.
[in] | pNumPoints | is number of data points to display |
[in] | pDataType | takes one of the values of dtype that indicates the integral data type of plot data |
[in] | pPlotType | dictates the type of plot/graph, it can take one of the values of PlotType |
[in] | pMarkerType | indicates which symbol is rendered as marker. It can take one of the values of MarkerType. |
FGAPI void render | ( | const Window & | pWindow, |
const int | pX, | ||
const int | pY, | ||
const int | pVPW, | ||
const int | pVPH | ||
) | const |
Render the chart to given window.
[in] | pWindow | is target window to where chart will be rendered |
[in] | pX | is x coordinate of origin of viewport in window coordinates |
[in] | pY | is y coordinate of origin of viewport in window coordinates |
[in] | pVPW | is the width of the viewport |
[in] | pVPH | is the height of the viewport |
FGAPI void setAxesLimits | ( | const float | pXmin, |
const float | pXmax, | ||
const float | pYmin, | ||
const float | pYmax, | ||
const float | pZmin = 0 , |
||
const float | pZmax = 0 |
||
) |
Set axes data ranges.
[in] | pXmin | is x-axis minimum data value |
[in] | pXmax | is x-axis maximum data value |
[in] | pYmin | is y-axis minimum data value |
[in] | pYmax | is y-axis maximum data value |
[in] | pZmin | is z-axis minimum data value |
[in] | pZmax | is z-axis maximum data value |
FGAPI void setAxesTitles | ( | const char * | pX, |
const char * | pY, | ||
const char * | pZ = NULL |
||
) |
Set axes titles for the chart.
[in] | pX | is x-axis title label |
[in] | pY | is y-axis title label |
[in] | pZ | is z-axis title label |
FGAPI void setLegendPosition | ( | const float | pX, |
const float | pY | ||
) |
Set legend position for Chart.
[in] | pX | is horizontal position in normalized coordinates |
[in] | pY | is vertical position in normalized coordinates |
FGAPI Surface surface | ( | const unsigned | pNumXPoints, |
const unsigned | pNumYPoints, | ||
const dtype | pDataType, | ||
const PlotType | pPlotType = FG_PLOT_SURFACE , |
||
const MarkerType | pMarkerType = FG_MARKER_NONE |
||
) |
Create and add an Plot object to the current chart.
[in] | pNumXPoints | is number of data points along X dimension |
[in] | pNumYPoints | is number of data points along Y dimension |
[in] | pDataType | takes one of the values of dtype that indicates the integral data type of plot data |
[in] | pPlotType | is the render type which can be one of PlotType (valid choices are FG_PLOT_SURFACE and FG_PLOT_SCATTER) |
[in] | pMarkerType | is the type of MarkerType to draw for FG_PLOT_SCATTER plot type |
FGAPI VectorField vectorField | ( | const unsigned | pNumPoints, |
const dtype | pDataType | ||
) |
Create and add an Vector Field object to the current chart.
[in] | pNumPoints | is number of data points to display |
[in] | pDataType | takes one of the values of dtype that indicates the integral data type of vector field data |