Virtual U.org
Get Personal Training on VU Today
    
Top shadow
 
 register/help
User Name:

Password:

PieChart class Reference
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

PieChart Class Reference

Class for calculating and drawing a pie chart. More...

#include <OPIE.H>

List of all members.

Public Methods

void init (char *=NULL)
void init_image (int=-1)
 Call init_image() before starting calling draw_slice() <int> backColor = background color (default : V_BACKGROUND).

void put_image (int, int)
 Call put_image() after calling draw_slice() to draw slice <int> x, y = the top left corner of the image <int> refreshFlag = refresh flag.

void draw_slice (float, int)
 Draw a pie slice <int> sliceShare = share of the slice, in percentage <int> sliceColor = color of the slice.

 PieChart ()
 ~PieChart ()
void init (int, int, int, int, int, void *, char, int *, int *, char *=NULL, char *=NULL, char **=NULL, char=1, char=1, char=1, int=1, int *=NULL, int=Vga::active_buf->color_dark)
void init (int x1, int y1, int x2, int y2, int dataNum, float *dataArray, int *xStart, int *xEnd, char *xLabel, char *yLabel, char **legendArray=NULL, char transparentFlag=1, char orientationFlag=1, char valueFlag=1, int numFormat=1, int *seriesColor=NULL, int axisColor=Vga::active_buf->color_dark)
void init (int x1, int y1, int x2, int y2, int dataNum, double *dataArray, int *xStart, int *xEnd, char *xLabel, char *yLabel, char **legendArray=NULL, char transparentFlag=1, char orientationFlag=1, char valueFlag=1, int numFormat=1, int *seriesColor=NULL, int axisColor=Vga::active_buf->color_dark)
void init (int x1, int y1, int x2, int y2, int dataNum, int *dataArray, int *xStart, int *xEnd, char *xLabel, char *yLabel, char **legendArray=NULL, char transparentFlag=1, char orientationFlag=1, char valueFlag=1, int numFormat=1, int *seriesColor=NULL, int axisColor=Vga::active_buf->color_dark)
void init (int x1, int y1, int x2, int y2, int dataNum, long *dataArray, int *xStart, int *xEnd, char *xLabel, char *yLabel, char **legendArray=NULL, char transparentFlag=1, char orientationFlag=1, char valueFlag=1, int numFormat=1, int *seriesColor=NULL, int axisColor=Vga::active_buf->color_dark)
void deinit ()
void paint ()
void refresh ()
void set_font (Font *)
void calc_pos ()
void set_y_label_max_len (short yLabelMaxLen)

Public Attributes

short piechart_x1
short piechart_y1
short piechart_x2
short piechart_y2
short series_x1
short series_y1
short series_x2
short series_y2
short graph_height
short graph_width
short legend_width
short legend_height
short legend_x_num
short legend_y_num
char ** legend_array
char * x_label
char * y_label
int * series_color
int axis_color
char init_flag
char transparent_flag
char orientation_flag
char data_type_flag
char value_flag
int num_format
int series_num
int data_num
void * data_array
int * x_start
int * x_end
int centerx
int centery
int radius
short y_label_max_len

Protected Methods

void draw_legend ()
void draw_axis_label ()
void find_scale ()
void draw_scale ()
void draw_pie (double, double, int)
void draw_series ()
void draw_series_float ()
void draw_series_double ()
void draw_series_int ()
void draw_series_long ()
void draw_value (void *, int, short, short, int)

Protected Attributes

char x_axis_pos
double max_scale
short x_axis_step
Fontfont_ptr
short * piechart_bitmap


Detailed Description

Class for calculating and drawing a pie chart.

Definition at line 16 of file OPIE.H.


Constructor & Destructor Documentation

PieChart::PieChart  
 

Definition at line 50 of file OPIECHRT.CPP.

References NULL.

PieChart::~PieChart  
 

Definition at line 59 of file OPIECHRT.CPP.


Member Function Documentation

void PieChart::calc_pos  
 

calculate screen positions should be called after changing display settings

Definition at line 181 of file OPIECHRT.CPP.

References err_when, LEGEND_X_SPACING, and LEGEND_Y_SPACING.

void PieChart::deinit  
 

Definition at line 152 of file OPIECHRT.CPP.

References mem_del, and NULL.

Referenced by Department::course_report_deinit(), FacultyRes::summary_report_deinit(), and PlayerSchool::summary_student_report_deinit().

void PieChart::draw_axis_label   [protected]
 

Definition at line 272 of file OPIECHRT.CPP.

References COMMON_OFFSET.

void PieChart::draw_legend   [protected]
 

Definition at line 257 of file OPIECHRT.CPP.

References LEGEND_SIZE, LEGEND_X_SPACING, and LEGEND_Y_SPACING.

void PieChart::draw_pie double   ,
double   ,
int   
[protected]
 

Definition at line 419 of file OPIECHRT.CPP.

Referenced by draw_series_double(), draw_series_float(), and draw_series_long().

void PieChart::draw_scale   [protected]
 

Definition at line 347 of file OPIECHRT.CPP.

References COMMON_OFFSET.

void PieChart::draw_series   [protected]
 

Definition at line 406 of file OPIECHRT.CPP.

void PieChart::draw_series_double   [protected]
 

Definition at line 564 of file OPIECHRT.CPP.

References centerx, centery, data_array, data_num, draw_pie(), radius, and V_GRAY.

void PieChart::draw_series_float   [protected]
 

Definition at line 533 of file OPIECHRT.CPP.

References centerx, centery, data_array, data_num, draw_pie(), radius, and V_GRAY.

void PieChart::draw_series_int   [protected]
 

Definition at line 468 of file OPIECHRT.CPP.

References fabs, and V_GRAY.

void PieChart::draw_series_long   [protected]
 

Definition at line 504 of file OPIECHRT.CPP.

References centerx, centery, data_array, data_num, draw_pie(), radius, and V_GRAY.

void PieChart::draw_slice float   ,
int   
 

Draw a pie slice <int> sliceShare = share of the slice, in percentage <int> sliceColor = color of the slice.

Definition at line 83 of file OPIE.CPP.

References MAX_DEGREE.

void PieChart::draw_value void *   ,
int   ,
short   ,
short   ,
int   
[protected]
 

Definition at line 596 of file OPIECHRT.CPP.

void PieChart::find_scale   [protected]
 

Definition at line 313 of file OPIECHRT.CPP.

References fabs.

void PieChart::init int    x1,
int    y1,
int    x2,
int    y2,
int    dataNum,
long *    dataArray,
int *    xStart,
int *    xEnd,
char *    xLabel,
char *    yLabel,
char **    legendArray = NULL,
char    transparentFlag = 1,
char    orientationFlag = 1,
char    valueFlag = 1,
int    numFormat = 1,
int *    seriesColor = NULL,
int    axisColor = Vga::active_buf-,
color_dark   
[inline]
 

Definition at line 60 of file OPIECHRT.H.

References Vga::active_buf, DATA_LONG, and NULL.

void PieChart::init int    x1,
int    y1,
int    x2,
int    y2,
int    dataNum,
int *    dataArray,
int *    xStart,
int *    xEnd,
char *    xLabel,
char *    yLabel,
char **    legendArray = NULL,
char    transparentFlag = 1,
char    orientationFlag = 1,
char    valueFlag = 1,
int    numFormat = 1,
int *    seriesColor = NULL,
int    axisColor = Vga::active_buf-,
color_dark   
[inline]
 

Definition at line 58 of file OPIECHRT.H.

References Vga::active_buf, DATA_INT, and NULL.

void PieChart::init int    x1,
int    y1,
int    x2,
int    y2,
int    dataNum,
double *    dataArray,
int *    xStart,
int *    xEnd,
char *    xLabel,
char *    yLabel,
char **    legendArray = NULL,
char    transparentFlag = 1,
char    orientationFlag = 1,
char    valueFlag = 1,
int    numFormat = 1,
int *    seriesColor = NULL,
int    axisColor = Vga::active_buf-,
color_dark   
[inline]
 

Definition at line 56 of file OPIECHRT.H.

References Vga::active_buf, DATA_DOUBLE, and NULL.

void PieChart::init int    x1,
int    y1,
int    x2,
int    y2,
int    dataNum,
float *    dataArray,
int *    xStart,
int *    xEnd,
char *    xLabel,
char *    yLabel,
char **    legendArray = NULL,
char    transparentFlag = 1,
char    orientationFlag = 1,
char    valueFlag = 1,
int    numFormat = 1,
int *    seriesColor = NULL,
int    axisColor = Vga::active_buf-,
color_dark   
[inline]
 

Definition at line 54 of file OPIECHRT.H.

References Vga::active_buf, DATA_FLOAT, and NULL.

void PieChart::init int   ,
int   ,
int   ,
int   ,
int   ,
void *   ,
char   ,
int *   ,
int *   ,
char *    = NULL,
char *    = NULL,
char **    = NULL,
char    = 1,
char    = 1,
char    = 1,
int    = 1,
int *    = NULL,
int    = Vga::active_buf-,
color_dark   
 

void PieChart::init char *    slotIconPtr = NULL
 

[char*] slotIconPtr = pointer to the pie slot icon (default : icon_sys.read("PIESLOT1") )

Definition at line 21 of file OPIE.CPP.

References MAX_DEGREE, and PI_OVER180.

Referenced by Department::course_report_2(), FacultyRes::summary_report_1(), FacultyRes::summary_report_2(), PlayerSchool::summary_student_report_1(), and PlayerSchool::summary_student_report_2().

void PieChart::init_image int    = -1
 

Call init_image() before starting calling draw_slice() <int> backColor = background color (default : V_BACKGROUND).

Definition at line 63 of file OPIE.CPP.

References V_BACKGROUND.

void PieChart::paint  
 

Definition at line 219 of file OPIECHRT.CPP.

Referenced by Department::course_report_2().

void PieChart::put_image int   ,
int   
 

Call put_image() after calling draw_slice() to draw slice <int> x, y = the top left corner of the image <int> refreshFlag = refresh flag.

Definition at line 118 of file OPIE.CPP.

References MAX_DEGREE, and V_WHITE.

void PieChart::refresh  
 

Definition at line 233 of file OPIECHRT.CPP.

Referenced by Department::course_report_2(), FacultyRes::summary_report_1(), FacultyRes::summary_report_2(), PlayerSchool::summary_student_report_1(), and PlayerSchool::summary_student_report_2().

void PieChart::set_font Font  
 

Definition at line 165 of file OPIECHRT.CPP.

void PieChart::set_y_label_max_len short    yLabelMaxLen [inline]
 

Definition at line 69 of file OPIECHRT.H.


Member Data Documentation

int PieChart::axis_color
 

Definition at line 31 of file OPIECHRT.H.

int PieChart::centerx
 

Definition at line 38 of file OPIECHRT.H.

Referenced by draw_series_double(), draw_series_float(), and draw_series_long().

int PieChart::centery
 

Definition at line 38 of file OPIECHRT.H.

Referenced by draw_series_double(), draw_series_float(), and draw_series_long().

void* PieChart::data_array
 

Definition at line 36 of file OPIECHRT.H.

Referenced by draw_series_double(), draw_series_float(), and draw_series_long().

int PieChart::data_num
 

Definition at line 35 of file OPIECHRT.H.

Referenced by draw_series_double(), draw_series_float(), and draw_series_long().

char PieChart::data_type_flag
 

Definition at line 33 of file OPIECHRT.H.

Font* PieChart::font_ptr [protected]
 

Definition at line 46 of file OPIECHRT.H.

short PieChart::graph_height
 

Definition at line 28 of file OPIECHRT.H.

short PieChart::graph_width
 

Definition at line 28 of file OPIECHRT.H.

char PieChart::init_flag
 

Definition at line 32 of file OPIECHRT.H.

char** PieChart::legend_array
 

Definition at line 30 of file OPIECHRT.H.

short PieChart::legend_height
 

Definition at line 29 of file OPIECHRT.H.

short PieChart::legend_width
 

Definition at line 29 of file OPIECHRT.H.

short PieChart::legend_x_num
 

Definition at line 29 of file OPIECHRT.H.

short PieChart::legend_y_num
 

Definition at line 29 of file OPIECHRT.H.

double PieChart::max_scale [protected]
 

Definition at line 44 of file OPIECHRT.H.

int PieChart::num_format
 

Definition at line 34 of file OPIECHRT.H.

char PieChart::orientation_flag
 

Definition at line 32 of file OPIECHRT.H.

short* PieChart::piechart_bitmap [protected]
 

Definition at line 47 of file OPIECHRT.H.

short PieChart::piechart_x1
 

Definition at line 26 of file OPIECHRT.H.

short PieChart::piechart_x2
 

Definition at line 26 of file OPIECHRT.H.

short PieChart::piechart_y1
 

Definition at line 26 of file OPIECHRT.H.

short PieChart::piechart_y2
 

Definition at line 26 of file OPIECHRT.H.

int PieChart::radius
 

Definition at line 39 of file OPIECHRT.H.

Referenced by draw_series_double(), draw_series_float(), and draw_series_long().

int* PieChart::series_color
 

Definition at line 31 of file OPIECHRT.H.

Referenced by Department::course_report_2(), FacultyRes::summary_report_1(), FacultyRes::summary_report_2(), PlayerSchool::summary_student_report_1(), and PlayerSchool::summary_student_report_2().

int PieChart::series_num
 

Definition at line 35 of file OPIECHRT.H.

short PieChart::series_x1
 

Definition at line 27 of file OPIECHRT.H.

short PieChart::series_x2
 

Definition at line 27 of file OPIECHRT.H.

short PieChart::series_y1
 

Definition at line 27 of file OPIECHRT.H.

short PieChart::series_y2
 

Definition at line 27 of file OPIECHRT.H.

char PieChart::transparent_flag
 

Definition at line 32 of file OPIECHRT.H.

char PieChart::value_flag
 

Definition at line 33 of file OPIECHRT.H.

char PieChart::x_axis_pos [protected]
 

Definition at line 43 of file OPIECHRT.H.

short PieChart::x_axis_step [protected]
 

Definition at line 45 of file OPIECHRT.H.

int * PieChart::x_end
 

Definition at line 37 of file OPIECHRT.H.

char * PieChart::x_label
 

Definition at line 30 of file OPIECHRT.H.

int* PieChart::x_start
 

Definition at line 37 of file OPIECHRT.H.

char * PieChart::y_label
 

Definition at line 30 of file OPIECHRT.H.

short PieChart::y_label_max_len
 

Definition at line 40 of file OPIECHRT.H.


The documentation for this class was generated from the following files:
Generated on Fri Aug 23 01:39:28 2002 for VirtualU by doxygen1.2.17