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

Password:

OGRPAREA.H Source File
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

OGRPAREA.H

Go to the documentation of this file.
00001 //Filename    : OGraphArea.H
00002 //Description : Header of object GraphArea
00003 
00004 #ifndef __OGRAPHAREA_H
00005 #define __OGRAPHAREA_H
00006 
00007 #include <OVGA.H>
00008 #include <OFONT.H>
00009 
00010 //--------- Define macro constant -----------//
00011 
00012 #ifndef __OGRPHYR_H
00013 #ifndef __OGRAPHA_H
00014 enum {
00015     DATA_FLOAT = 1, DATA_DOUBLE = 2,
00016     DATA_INT = 3, DATA_LONG = 4
00017 };
00018 #endif
00019 #endif
00020 
00021 //--------- Define class GraphArea --------//
00022 //
00024 class GraphArea {
00025 public:
00026     short GraphArea_x1, GraphArea_y1, GraphArea_x2, GraphArea_y2;
00027     short series_x1, series_y1, series_x2, series_y2;
00028     short graph_height, graph_width;
00029     short legend_width, legend_height, legend_x_num, legend_y_num;
00030     char **legend_array, *x_label, *y_label;
00031     int *series_color, axis_color;
00032     char init_flag, transparent_flag, orientation_flag;
00033     char data_type_flag, value_flag;
00034     int num_format;
00035     int series_num, *data_num;
00036     int this_year_indicator;
00037     void *data_array;
00038     int *x_start, *x_end;
00039     short y_label_max_len;
00040 
00041 protected:
00042     char x_axis_pos;                              // 0-bottom, 1-center
00043     double max_scale;                             // max abs value of the graph
00044     short x_axis_step;                            // step size on x-axis
00045     Font *font_ptr;
00046     short *GraphArea_bitmap;
00047 
00048 public:
00049     GraphArea();
00050     ~GraphArea();
00051 
00052     void init(int,int,int,int,int,int*,void*,char,int,char* =NULL,char* =NULL,char** =NULL,char=1,char=1,char=1,int=1,int* =NULL,int=Vga::active_buf->color_dark);
00053     void init(int x1,int y1,int x2,int y2,int seriesNum,int *dataNum,float* dataArray,int thisyear,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)
00054         { init(x1, y1, x2, y2, seriesNum, dataNum, (void*) dataArray, DATA_FLOAT,thisyear, xLabel, yLabel, legendArray, transparentFlag, orientationFlag, valueFlag, numFormat, seriesColor, axisColor); }
00055     void init(int x1,int y1,int x2,int y2,int seriesNum,int *dataNum,double* dataArray,int thisyear,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)
00056         { init(x1, y1, x2, y2, seriesNum, dataNum, (void*) dataArray, DATA_DOUBLE, thisyear, xLabel, yLabel, legendArray, transparentFlag, orientationFlag, valueFlag, numFormat, seriesColor, axisColor); }
00057     void init(int x1,int y1,int x2,int y2,int seriesNum,int *dataNum,int* dataArray,int thisyear,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)
00058         { init(x1, y1, x2, y2, seriesNum, dataNum, (void*) dataArray, DATA_INT, thisyear, xLabel, yLabel, legendArray, transparentFlag, orientationFlag, valueFlag, numFormat, seriesColor, axisColor); }
00059     void init(int x1,int y1,int x2,int y2,int seriesNum,int *dataNum,long* dataArray,int thisyear,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)
00060         { init(x1, y1, x2, y2, seriesNum, dataNum, (void*) dataArray, DATA_LONG, thisyear, xLabel, yLabel, legendArray, transparentFlag, orientationFlag, valueFlag, numFormat, seriesColor, axisColor); }
00061 
00062     void deinit();
00063     void paint();
00064     void refresh();
00065     void set_font(Font *);
00066     void calc_pos();
00067 
00068     void set_y_label_max_len(short yLabelMaxLen) { y_label_max_len = yLabelMaxLen; }
00069 
00070 protected:
00071     void draw_legend();
00072     void draw_axis_label();
00073     void find_scale();
00074     void draw_scale();
00075     void draw_series();
00076     void draw_series_float();
00077     void draw_series_double();
00078     void draw_series_int();
00079     void draw_series_long();
00080     void draw_value(void *, int, short, short, int);
00081 
00082 };
00083 
00084 //--------------------------//
00085 #endif

Generated on Fri Aug 23 01:37:49 2002 for VirtualU by doxygen1.2.17