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

Password:

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

OGRPHYR.H

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

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