Forge

Public Member Functions
Plot Class Reference

Plot is a line graph to display two dimensional data. More...

`#include <plot.h>`

## Public Member Functions
FGAPI | Plot (const unsigned pNumPoints, const dtype pDataType, const ChartType pChartType, const PlotType pPlotType=FG_PLOT_LINE, const MarkerType pMarkerType=FG_MARKER_NONE)
| Creates a Plot object. More...
FGAPI | Plot (const Plot &pOther)
| Copy constructor for Plot. More...
FGAPI | Plot (const fg_plot pHandle)
| Construct Plot ojbect from fg_plot resource handle. More...
FGAPI | ~Plot ()
| Plot Destructor. More...
FGAPI void | setColor (const forge::Color pColor)
| Set the color of line graph(plot) More...
FGAPI void | setColor (const float pRed, const float pGreen, const float pBlue, const float pAlpha)
| Set the color of line graph(plot) More...
FGAPI void | setLegend (const char *pLegend)
| Set plot legend. More...
FGAPI void | setMarkerSize (const float pMarkerSize)
| Set global marker size. More...
FGAPI unsigned | vertices () const
| Get the buffer identifier for vertices. More...
FGAPI unsigned | colors () const
| Get the buffer identifier for color values per vertex. More...
FGAPI unsigned | alphas () const
| Get the buffer identifier for alpha values per vertex. More...
FGAPI unsigned | radii () const
| Get the buffer identifier for per vertex marker sizes. More...
FGAPI unsigned | verticesSize () const
| Get the vertex buffer size in bytes. More...
FGAPI unsigned | colorsSize () const
| Get the colors buffer size in bytes. More...
FGAPI unsigned | alphasSize () const
| Get the alpha values buffer size in bytes. More...
FGAPI unsigned | radiiSize () const
| Get the marker sizes buffer size in bytes. More...
FGAPI fg_plot | get () const
| Get the handle to internal implementation of plot. More...

## Detailed Description

Plot is a line graph to display two dimensional data.

Examples:
  cpu/bubblechart.cpp, cpu/field.cpp, cpu/plot3.cpp, cpu/plotting.cpp, opencl/bubblechart.cpp, opencl/field.cpp, opencl/plot3.cpp, and opencl/plotting.cpp.

## Constructor & Destructor Documentation

## ◆ Plot() [1/3]

FGAPI Plot | ( | const unsigned | pNumPoints,
|  | const dtype | pDataType,
|  | const ChartType | pChartType,
|  | const PlotType | pPlotType = `FG_PLOT_LINE`,
|  | const MarkerType | pMarkerType = `FG_MARKER_NONE`
| ) |  |

Creates a Plot object.

Parameters

  [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] | pChartType | dictates the dimensionality of the chart
  [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.

## ◆ Plot() [2/3]

FGAPI Plot | ( | const Plot & | pOther | ) |

Copy constructor for Plot.

Parameters

  [in] | pOther | is the Plot of which we make a copy of.

## ◆ Plot() [3/3]

FGAPI Plot | ( | const fg_plot | pHandle | ) |
| explicit

Construct Plot ojbect from fg_plot resource handle.

Parameters

  [in] | pHandle | is the input fg_plot resource handle

Note
  This kind of construction assumes ownership of the resource handle is released during the Plot object's destruction.

## ◆ ~Plot()

FGAPI ~Plot | ( |  | ) |

Plot Destructor.

## Member Function Documentation

## ◆ alphas()

FGAPI unsigned alphas | ( |  | ) | const

Get the buffer identifier for alpha values per vertex.

Returns
  alpha values buffer resource id.

Examples:
  cpu/bubblechart.cpp, and opencl/bubblechart.cpp.

## ◆ alphasSize()

FGAPI unsigned alphasSize | ( |  | ) | const

Get the alpha values buffer size in bytes.

Returns
  alpha buffer size in bytes

Examples:
  cpu/bubblechart.cpp, and opencl/bubblechart.cpp.

## ◆ colors()

FGAPI unsigned colors | ( |  | ) | const

Get the buffer identifier for color values per vertex.

Returns
  colors buffer resource id.

Examples:
  cpu/bubblechart.cpp, and opencl/bubblechart.cpp.

## ◆ colorsSize()

FGAPI unsigned colorsSize | ( |  | ) | const

Get the colors buffer size in bytes.

Returns
  colors buffer size in bytes

Examples:
  cpu/bubblechart.cpp, and opencl/bubblechart.cpp.

## ◆ get()

FGAPI fg_plot get | ( |  | ) | const

Get the handle to internal implementation of plot.

## ◆ radii()

FGAPI unsigned radii | ( |  | ) | const

Get the buffer identifier for per vertex marker sizes.

Returns
  marker sizes buffer resource id.

Examples:
  cpu/bubblechart.cpp, and opencl/bubblechart.cpp.

## ◆ radiiSize()

FGAPI unsigned radiiSize | ( |  | ) | const

Get the marker sizes buffer size in bytes.

Returns
  marker sizes buffer size in bytes

Examples:
  cpu/bubblechart.cpp, and opencl/bubblechart.cpp.

## ◆ setColor() [1/2]

FGAPI void setColor | ( | const forge::Color | pColor | ) |

Set the color of line graph(plot)

Parameters

  [in] | pColor | takes values of forge::Color to define plot color

Examples:
  cpu/bubblechart.cpp, cpu/field.cpp, cpu/plotting.cpp, opencl/bubblechart.cpp, opencl/field.cpp, and opencl/plotting.cpp.

## ◆ setColor() [2/2]

FGAPI void setColor | ( | const float | pRed,
|  | const float | pGreen,
|  | const float | pBlue,
|  | const float | pAlpha
| ) |  |

Set the color of line graph(plot)

Parameters

  [in] | pRed | is Red component in range [0, 1]
  [in] | pGreen | is Green component in range [0, 1]
  [in] | pBlue | is Blue component in range [0, 1]
  [in] | pAlpha | is Blue component in range [0, 1]

## ◆ setLegend()

FGAPI void setLegend | ( | const char * | pLegend | ) |

Set plot legend.

Parameters

  [in] | pLegend |

Examples:
  cpu/bubblechart.cpp, cpu/field.cpp, cpu/plotting.cpp, opencl/bubblechart.cpp, opencl/field.cpp, and opencl/plotting.cpp.

## ◆ setMarkerSize()

FGAPI void setMarkerSize | ( | const float | pMarkerSize | ) |

Set global marker size.

This size will be used for rendering markers if no per vertex marker sizes are provided. This value defaults to 10

Parameters

  [in] | pMarkerSize | is the target marker size for scatter plots or line plots with markers

Examples:
  cpu/bubblechart.cpp, cpu/field.cpp, opencl/bubblechart.cpp, and opencl/field.cpp.

## ◆ vertices()

FGAPI unsigned vertices | ( |  | ) | const

Get the buffer identifier for vertices.

Returns
  vertex buffer resource id.

Examples:
  cpu/bubblechart.cpp, cpu/field.cpp, cpu/plot3.cpp, cpu/plotting.cpp, opencl/bubblechart.cpp, opencl/field.cpp, opencl/plot3.cpp, and opencl/plotting.cpp.

## ◆ verticesSize()

FGAPI unsigned verticesSize | ( |  | ) | const

Get the vertex buffer size in bytes.

Returns
  vertex buffer size in bytes

Examples:
  cpu/bubblechart.cpp, cpu/field.cpp, cpu/plot3.cpp, cpu/plotting.cpp, opencl/bubblechart.cpp, opencl/field.cpp, opencl/plot3.cpp, and opencl/plotting.cpp.

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

- plot.h