UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ui_node_linechart.h File Reference
#include "../ui_nodes.h"

Go to the source code of this file.

Data Structures

class  uiLineChartNode
 
struct  lineChartExtraData_s
 extradata for the linechart node More...
 

Typedefs

typedef struct lineChartExtraData_s lineChartExtraData_t
 extradata for the linechart node More...
 

Functions

void UI_RegisterLineChartNode (uiBehaviour_t *behaviour)
 Registers lineChart node. More...
 
bool UI_ClearLineChart (uiNode_t *node)
 Clears all drawings froma lineChart. More...
 
bool UI_AddLineChartLine (uiNode_t *node, const char *id, bool visible, const vec4_t color, bool dots, int numPoints)
 Add a line to the chart. More...
 
bool UI_AddLineChartCoord (uiNode_t *node, const char *id, int x, int y)
 Add a data point to a line chart. More...
 
bool UI_ShowChartLine (uiNode_t *node, const char *id, bool visible)
 Shows/hides a chart line. More...
 
bool UI_ShowChartDots (uiNode_t *node, const char *id, bool visible)
 Shows/hides small dots at data points of a chart. More...
 

Typedef Documentation

extradata for the linechart node

Todo:
add info about axes min-max...

Function Documentation

bool UI_AddLineChartCoord ( uiNode_t node,
const char *  id,
int  x,
int  y 
)

Add a data point to a line chart.

Parameters
[in,out]nodeChart node to extend
[in]idLine ID to extend
[in]xHorizontal coordinate of the data point
[in]yVertical coordinate of the data point
Note
You cannot add more data points to a line than what was originally set

Definition at line 176 of file ui_node_linechart.cpp.

References Com_Printf(), EXTRADATA, LIST_Foreach, MAX_VAR, Q_strneq, Q_strnull(), and UI_GetPath().

Referenced by uiLineChartNode_t_add_point().

bool UI_AddLineChartLine ( uiNode_t node,
const char *  id,
bool  visible,
const vec4_t  color,
bool  dots,
int  numPoints 
)

Add a line to the chart.

Parameters
[in,out]nodeChart node to extend
[in]idName of the chart line to add
[in]visibleWhether the chart line be rendered
[in]colorRGBA Color of the chart line
[in]dotsWhether to draw little squares to the datapoints
[in]numPointsNumber of datapoints to allocate

Definition at line 133 of file ui_node_linechart.cpp.

References Com_Printf(), line_s::dots, EXTRADATA, line_s::id, line_s::lineColor, LIST_Add(), LIST_Foreach, MAX_VAR, line_s::maxPoints, Mem_PoolAllocTypeN, line_s::numPoints, line_s::pointList, Q_streq, Q_strncpyz(), Q_strnull(), ui_dynPool, UI_GetPath(), Vector4Copy, and line_s::visible.

Referenced by uiLineChartNode_t_add_line().

bool UI_ClearLineChart ( uiNode_t node)

Clears all drawings froma lineChart.

Parameters
nodeThe node to clear

Definition at line 109 of file ui_node_linechart.cpp.

References EXTRADATA, LIST_Delete(), LIST_Foreach, and Mem_Free.

Referenced by uiLineChartNode::deleteNode(), and uiLineChartNode_t_clear().

void UI_RegisterLineChartNode ( uiBehaviour_t behaviour)

Registers lineChart node.

Parameters
[out]behaviourUI node behaviour structure

Definition at line 261 of file ui_node_linechart.cpp.

References EXTRADATA_TYPE, uiBehaviour_t::extraDataSize, uiBehaviour_t::lua_SWIG_typeinfo, uiBehaviour_t::manager, uiBehaviour_t::name, UI_RegisterExtradataNodeProperty, UI_SWIG_TypeQuery(), V_BOOL, and V_COLOR.

bool UI_ShowChartDots ( uiNode_t node,
const char *  id,
bool  visible 
)

Shows/hides small dots at data points of a chart.

Parameters
[in,out]nodeChart node in which the line is
[in]idLine ID to alter
[in]visibleBoolean switch of the dot's visibility

Definition at line 236 of file ui_node_linechart.cpp.

References Com_Printf(), EXTRADATA, LIST_Foreach, MAX_VAR, Q_strneq, Q_strnull(), and UI_GetPath().

bool UI_ShowChartLine ( uiNode_t node,
const char *  id,
bool  visible 
)

Shows/hides a chart line.

Parameters
[in,out]nodeChart node in which the line is
[in]idLine ID to show/hide
[in]visibleBoolean switch of line's visibility (including dots)

Definition at line 209 of file ui_node_linechart.cpp.

References Com_Printf(), EXTRADATA, LIST_Foreach, MAX_VAR, Q_strneq, Q_strnull(), and UI_GetPath().