int get_temp_coords(topview * t, int level, int v, double *coord_x, double *coord_y) { Hierarchy *hp = t->fisheyeParams.h; ex_vtx_data *gg = hp->geom_graphs[level]; /* v_data *g = hp->graphs[level]; */ if (!t->fisheyeParams.animate) { if (gg[v].active_level != level) return 0; *coord_x = (double) gg[v].physical_x_coord; *coord_y = (double) gg[v].physical_y_coord; } else { double x0, y0, x1, y1; int OAL, AL; x0 = 0; y0 = 0; x1 = 0; y1 = 0; AL = gg[v].active_level; OAL = gg[v].old_active_level; if ((OAL < level) || (AL < level)) //no draw return 0; if ((OAL >= level) || (AL >= level)) //draw the node { if ((OAL == level) && (AL == level)) //draw as is from old coords to new) { x0 = (double) gg[v].old_physical_x_coord; y0 = (double) gg[v].old_physical_y_coord; x1 = (double) gg[v].physical_x_coord; y1 = (double) gg[v].physical_y_coord; } if ((OAL > level) && (AL == level)) //draw as from ancs to new) { find_old_physical_coords(t->fisheyeParams.h, level, v, &x0, &y0); x1 = (double) gg[v].physical_x_coord; y1 = (double) gg[v].physical_y_coord; } if ((OAL == level) && (AL > level)) //draw as from ancs to new) { find_physical_coords(t->fisheyeParams.h, level, v, &x1, &y1); x0 = (double) gg[v].old_physical_x_coord; y0 = (double) gg[v].old_physical_y_coord; } get_interpolated_coords(x0, y0, x1, y1, view->active_frame, view->total_frames, coord_x, coord_y); if ((x0 == 0) || (x1 == 0)) return 0; } } return 1; }
int get_temp_coords(topview* t,int level,int v,double* coord_x,double* coord_y,float *R,float *G,float *B) { Hierarchy *hp = t->h; ex_vtx_data *gg = hp->geom_graphs[level]; /* v_data *g = hp->graphs[level]; */ int OAL,AL; OAL=gg[v].old_active_level; AL=gg[v].active_level; /*if ((OAL > level) && (AL>level)) return 0;*/ if ((OAL < level) && (AL<level)) return 0; if (!t->animate) { if (AL == level) { *coord_x=(double)gg[v].physical_x_coord; *coord_y=(double)gg[v].physical_y_coord; return 1; } else return 0; } else { double x0,y0,x1,y1; x0=0; y0=0; x1=0; y1=0; get_active_frame(t); if ((OAL == level) && (AL==level)) { x0=(double)gg[v].old_physical_x_coord; y0=(double)gg[v].old_physical_y_coord; x1=(double)gg[v].physical_x_coord; y1=(double)gg[v].physical_y_coord; *G=0; *R=1; } if ((OAL == level) && (AL>level)) { x0=(double)gg[v].old_physical_x_coord; y0=(double)gg[v].old_physical_y_coord; find_physical_coords(t->h,level,v,&x1,&y1); *G=view->active_frame/view->total_frames; *R=0; } if ((OAL > level) && (AL==level)) { find_old_physical_coords(t->h,level,v,&x0,&y0); x1=(double)gg[v].physical_x_coord; y1=(double)gg[v].physical_y_coord; *R=view->active_frame/view->total_frames; *G=1/(view->active_frame/view->total_frames+0.0000001); } if ((OAL > level) && (AL>level)) { find_old_physical_coords(t->h,level,v,&x0,&y0); find_physical_coords(t->h,level,v,&x1,&y1); *G=1; *R=0; } get_interpolated_coords(x0,y0,x1,y1,view->active_frame,view->total_frames,coord_x,coord_y); return 1; } return 0; }