// Constant: WIDTH
// Width of the OpenGL window in pixels.
#define WIDTH 800

// Constant: HEIGHT
// Height of the OpenGL window in pixels.
#define HEIGHT 540


// Constant: UPDATE_RATE_IN_MS
// OpenGL content update rate in milliseconds.
#define UPDATE_RATE_IN_MS 20


// Macro: UNREFERENCED
// Used for unreferenced parameters to suppress compiler warnings.
#define UNREFERENCED(P) P


// Macro: MAX
// Returns the maximum of two values a and b.
#ifndef MAX
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif


// Macro: MIN
// Returns the minimum of two values a and b.
#ifndef MIN
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif


// Constant: FILTER_SIZE
// Number of data entries to be shown when filtering.
#define FILTER_SIZE 10

// Constant: SORTING_DELAY_IN_MS
// Delay added to bars while sorting to reduce occlusion.
#define SORTING_DELAY_IN_MS 25

// Constant: VALUE_CHANGE_SCALE_STEPS
// Amount of steps for the value change transition.
#define VALUE_CHANGE_SCALE_STEPS 20

// Constant: VALUE_CHANGE_SWAP_STEPS
// Amount of steps for swapping in the value change transition.
#define VALUE_CHANGE_SWAP_STEPS 10

// Constant: FILTERING_SCALE_STEPS
// Amount of steps for scaling in the filtering transition.
#define FILTERING_SCALE_STEPS MOVE_STEPS

// Constant: MOVE_STEPS
// Amount of steps for the move transition.
#define MOVE_STEPS 30

// Constant: BLEND_STEPS
// Amount of steps for the color blend transition.
#define BLEND_STEPS 20

// Constant: NEW_GRID_LINE_DELAY_IN_MS
// Delay added to the blend-in of new grid lines.
#define NEW_GRID_LINE_DELAY_IN_MS 50


// Constant: ORIENTATION_HORIZONTAL
// Indicator for horizontal orientation.
#define ORIENTATION_HORIZONTAL 0

// Constant: ORIENTATION_VERTICAL
// Indicator for vertical orientation.
#define ORIENTATION_VERTICAL 1


// Constant: FONTSTYLE_HEADLINE
// Indicator for a headline font style of a label.
#define FONTSTYLE_HEADLINE 0

// Constant: FONTSTYLE_ELEMENT
// Indicator for a normal font style of a label.
#define FONTSTYLE_ELEMENT 1

// Constant: FONTSTYLE_BAR
// Indicator for a font style used for bars of a label.
#define FONTSTYLE_BAR 2


// Constant: VERTICAL_TEXT_OFFSET
// Offset added to vertical text labels in pixels.
#define VERTICAL_TEXT_OFFSET 4

// Constant: VERTICAL_AXIS_TEXT_OFFSET
// Offset added to vertical axis labels in pixels.
#define VERTICAL_AXIS_TEXT_OFFSET 20

// Constant: GRID_LINE_TEXT_OFFSET
// Offset added to grid line labels in pixels.
#define GRID_LINE_TEXT_OFFSET 70

// Constant: BAR_TEXT_OFFSET
// Offset added to bar labels in pixels.
#define BAR_TEXT_OFFSET 10


// Constant: AXIS_WIDTH
// Line width of axes in OpenGL line unit.
#define AXIS_WIDTH 2.0f

// Constant: AXIS_COLOR
// Intensity value of axes.
#define AXIS_COLOR 0.0f


// Constant: GRID_LINE_COLOR
// Intensity value of grid lines.
#define GRID_LINE_COLOR 0.7f

// Constant: GRID_LINE_WIDTH
// Line width of grid lines in OpenGL line unit.
#define GRID_LINE_WIDTH 1.5f

// Constant: GRID_LINES
// Number of grid lines used in a chart.
#define GRID_LINES 5

// Constant: GRID_HIGH_VALUE
// Highest value a chart can have at highest scaling.
#define GRID_HIGH_VALUE 100.0

// Constant: GRID_HIGH_VALUE_STEP_SIZE
// Step size according to the highest value and the number of grid lines.
#define GRID_HIGH_VALUE_STEP_SIZE 20

// Constant: GRID_SECOND_HIGH_VALUE
// Highest value a chart can have at second highest scaling.
#define GRID_SECOND_HIGH_VALUE 75.0

// Constant: GRID_SECOND_HIGH_VALUE_STEP_SIZE
// Step size according to the second highest value and the number of grid lines.
#define GRID_SECOND_HIGH_VALUE_STEP_SIZE 15

// Constant: GRID_MID_VALUE
// Highest value a chart can have at medium scaling.
#define GRID_MID_VALUE 50.0

// Constant: GRID_MID_VALUE_STEP_SIZE
// Step size according to the medium value and the number of grid lines.
#define GRID_MID_VALUE_STEP_SIZE 10

// Constant: GRID_LOW_VALUE
// Highest value a chart can have at lowest scaling.
#define GRID_LOW_VALUE 25.0

// Constant: GRID_LOW_VALUE_STEP_SIZE
// Step size according to the lowest value and the number of grid lines.
#define GRID_LOW_VALUE_STEP_SIZE 5


// Constant: ORIGIN_X
// X coordinate of the chart origin.
#define ORIGIN_X -0.8f

// Constant: ORIGIN_Y
// Y coordinate of the chart origin.
#define ORIGIN_Y -0.5f

// Constant: UPPER_X
// X coordinate of the right end of the chart.
#define UPPER_X 0.85f

// Constant: UPPER_Y
// Y coordinate of the upper end of the chart.
#define UPPER_Y 0.7f


// Constant: BIG_SPACE
// Space added before the first and after the last data element.
#define BIG_SPACE 0.05f


// Constant: PIE_CHART_CENTER_X
// X coordinate of the center in a pie chart.
#define PIE_CHART_CENTER_X 0.0f

// Constant: PIE_CHART_CENTER_Y
// Y coordinate if the center in a pie chart.
#define PIE_CHART_CENTER_Y -0.15f

// Constant: PIE_CHART_RADIUS
// Radius of a pie chart.
#define PIE_CHART_RADIUS 0.70f

// Constant: PIE_CHART_LABEL_RADIUS
// Radius for the circle where labels are placed.
#define PIE_CHART_LABEL_RADIUS 0.75f

// Constant: PIE_CHART_LABEL_OFFSET
// Offset added to pie chart labels in pixels.
#define PIE_CHART_LABEL_OFFSET 15.0f

// Constant: PIE_CHART_LABEL_OFFSET_VALUE
// Maximum data value for a data element where a label offset is added to avoid occlusion.
#define PIE_CHART_LABEL_OFFSET_VALUE 7.0f

// Constant: PIE_CHART_SCALE_MAXIMUM
// Scaling value used for sorting to pretend a rotation of the pie chart.
#define PIE_CHART_SCALE_MAXIMUM 50000.0f


// Constant: PI
// Pi.
#define PI 3.1415926f