From 1bd9e0c140835ccaf1c8010b9541cb6c7f2894a2 Mon Sep 17 00:00:00 2001 From: Oliver Wang Date: Fri, 24 Oct 2003 21:21:46 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=2558 --- api/reduce.C | 85 ++++++--------------------------------------------- api/reduce.h | 6 ++-- checkin_notes | 7 +++++ 3 files changed, 20 insertions(+), 78 deletions(-) diff --git a/api/reduce.C b/api/reduce.C index 2f34387d5d..17285fc460 100644 --- a/api/reduce.C +++ b/api/reduce.C @@ -80,7 +80,8 @@ void REDUCED_ARRAY::reset() { last_ry_count = 0; } -void REDUCED_ARRAY::init_draw(GRAPH_STYLE st, float* p, float* s, double h0, double dh, float trans) { +void REDUCED_ARRAY::init_draw(GRAPH_STYLE st, float* p, float* s, double h0, double dh, float trans, + char* xl,char* yl,char* zl) { memcpy(draw_pos, p, sizeof(draw_pos)); memcpy(draw_size, s, sizeof(draw_size)); draw_deltax = draw_size[0]/rdimx; @@ -89,6 +90,9 @@ void REDUCED_ARRAY::init_draw(GRAPH_STYLE st, float* p, float* s, double h0, dou dhue = dh; alpha = trans; draw_style = st; + xlabel=xl; + ylabel=yl; + zlabel=zl; } // reduce a single row. This is called only if sdimx > rdimx; @@ -749,9 +753,9 @@ void REDUCED_ARRAY::draw_labels() { float wd=.015f; float l=1.0f; - char* zlabel = "Time(sec)"; - char* xlabel = "Frequency(HZ)"; - char* plabel = "Power"; +// char* zlabel = "Time(sec)"; +// char* xlabel = "Frequency(HZ)"; +// char* plabel = "Power"; char* zmax = "107.4"; char* zmin = "0"; @@ -834,76 +838,7 @@ void REDUCED_ARRAY::draw_labels() { draw_text_right(zpos,ch,lw,ls,zlabel); draw_text(xpos,ch,lw,ls,xlabel); - draw_text(ppos,ch,lw,ls,plabel); + draw_text(ppos,ch,lw,ls,ylabel); ortho_done(); -} - - -void REDUCED_ARRAY::draw_3dlabels() { - double model[16]; - double proj[16]; - float arrowh = .35f; - float arroww = .05f; - - glLineWidth(1.4f); - glBegin(GL_LINES); - glColor3f(1,1,1); - glVertex3f(draw_pos[0]+draw_size[0]+.4f,draw_pos[1],draw_pos[2]+draw_size[2]-.5f); - glVertex3f(draw_pos[0]+draw_size[0]+.4f,draw_pos[1]+1.2f,draw_pos[2]+draw_size[2]-.5f); - glEnd(); - - glBegin(GL_TRIANGLE_FAN); - glVertex3f(draw_pos[0]+draw_size[0]+.4f,draw_pos[1]+1.2f+arrowh,draw_pos[2]+draw_size[2]-.5f); - - glVertex3f(draw_pos[0]+draw_size[0]+.4f-arroww,draw_pos[1]+1.2f,draw_pos[2]+draw_size[2]-.5f-arroww); - glVertex3f(draw_pos[0]+draw_size[0]+.4f+arroww,draw_pos[1]+1.2f,draw_pos[2]+draw_size[2]-.5f-arroww); - glVertex3f(draw_pos[0]+draw_size[0]+.4f+arroww,draw_pos[1]+1.2f,draw_pos[2]+draw_size[2]-.5f+arroww); - glVertex3f(draw_pos[0]+draw_size[0]+.4f-arroww,draw_pos[1]+1.2f,draw_pos[2]+draw_size[2]-.5f+arroww); - glVertex3f(draw_pos[0]+draw_size[0]+.4f-arroww,draw_pos[1]+1.2f,draw_pos[2]+draw_size[2]-.5f-arroww); - glEnd(); - - int viewport[4]; - - get_matrix(model); - get_projection(proj); - get_viewport(viewport); - - float offset = 0; - - char* zlabel = "Time(sec)"; - char* xlabel = "Frequency(HZ)"; - char* plabel = "Power"; - - char* zmax = "107.4"; - char* zmin = "0"; - - char* xmax = "9765.620"; - char* xmin = "0.0"; - - float left_of_z = -0.1f; - float left_of_z2 = -0.04f; - float below_x = -.03f; - float center_x = -.06f; - - float w=.3f; - float l=1.0f; - float h=.3f; - float s=.3f; - mode_unshaded(); - glColor3d(1,1,1); - float zpos[3]={draw_pos[0]-.5f,draw_pos[1],draw_pos[2]+(draw_size[2]/2.0f)}; - float xpos[3]={draw_pos[0]+draw_size[0]/2.0f,draw_pos[1]-.2f,draw_pos[2]+draw_size[2]}; - float ppos[3]={draw_pos[0]+draw_size[0]+.4f,draw_pos[1]+1.5f/2.3f,draw_pos[2]+draw_size[2]-.5f}; - - glPushMatrix(); - float r[3] = {0,1,0}; - draw_rotated_text(zpos,h,w,s,zlabel,90.0f,r); - - glPopMatrix(); - - draw_text_line(xpos, w, l, xlabel); - draw_text_line(ppos, w, l, plabel); -} - - +} \ No newline at end of file diff --git a/api/reduce.h b/api/reduce.h index 904f2b515c..606bac4fe6 100644 --- a/api/reduce.h +++ b/api/reduce.h @@ -59,12 +59,13 @@ public: double hue0; double dhue; float alpha; + char* xlabel,*ylabel,*zlabel; GRAPH_STYLE draw_style; REDUCED_ARRAY(); ~REDUCED_ARRAY(); void init(int, int); - void init_draw(GRAPH_STYLE, float*, float*, double, double, float); + void init_draw(GRAPH_STYLE, float*, float*, double, double, float,char*,char*,char*); void set_max_dims(int, int); void reduce_source_row(float*, float*); void add_source_row(float*); @@ -84,8 +85,7 @@ public: void draw_part(double frac); void draw_axes(); void draw_axis_labels(); - void draw_labels(); - void draw_3dlabels(); + void draw_labels(); }; #endif diff --git a/checkin_notes b/checkin_notes index cd8158fb90..e2d4237aaa 100755 --- a/checkin_notes +++ b/checkin_notes @@ -7037,3 +7037,10 @@ David 24 Oct 2003 schema.sql sched/ handle_request.C + +Oliver 24 Oct 2003 + - updated reduced array class to contain the name of the labels. they are set when the reduced array + is created + + api/ + reduce.h,C