/*#define ILLUS*/ /* * dcdisplay.c Jim Piper 23-01-87 * * MODIFICATIONS * ------------- * 29-02-88 jimp Change call parameters to "display1" * 10-02-87 jimp Added colour LUT set-up routine, and use colour * to distinguish candidate types in displays, using * overlays. May make laser-printer output less good ?? * Moved boundary display from "display2" to "display1". */ #include #include #include #include #define RED 2 #define GREEN 1 #define YELLOW 3 #define GREYS 248 logo() { moveto(2,2); lwidth(3); lineby(4092,0); lineby(0,4092); lineby(-4092,0); lineby(0,-4092); lwidth(1); user(9,0); } #ifndef ILLUS colourlut() { int i; /* Bit-plane zero - green */ for (i=GREEN; i<=255; i+=2) setrgb(i,0,255,0); /* Bit-plane one - red */ for (i=RED; i<=255; i+=4) setrgb(i,255,0,0); #ifdef YEL /* Bit-plane zero and one - yellow */ for (i=YELLOW; i<=255; i+=4) setrgb(i,255,255,0); #endif YEL /* Bit-plane two - purple */ for (i=4; i<=255; i+=8) setrgb(i,255,0,255); /* grey scales */ setrgb(0,255,255,210); for (i=8; i<256; i+=8) setrgb(i,i,i,i); update(); } #else ILLUS colourlut() { int i; /* Bit-plane zero - black */ for (i=GREEN; i<=255; i+=4) setrgb(i,0,0,0); /* Bit-plane one - black */ for (i=RED; i<=255; i+=4) setrgb(i,0,0,0); /* Bit-plane zero and one - black */ for (i=YELLOW; i<=255; i+=4) setrgb(i,0,0,0); /* Bit-plane two - black */ for (i=4; i<=255; i+=8) setrgb(i,0,0,0); /* grey scales */ setrgb(0,255,255,255); for (i=8; i<256; i+=8) setrgb(i,255-i,255-i,255-i); update(); } #endif ILLUS display1(BOUND_CANDS,PROF_CANDS,cell,number,spobj,mpol,prof,bpdom,f,chcp,timestring,SCALE) struct object *spobj, *mpol, *prof; struct polygondomain *bpdom; struct pframe *f; struct chromcands *chcp; char *cell, *timestring; { struct intervaldomain *idom; struct object *newprof, *makemain(); struct histogramdomain *hdom, *newhdom, *makehistodmn(); struct object *b, *ibound(); char s[256]; int i; hdom = (struct histogramdomain *)prof->idom; f->type = 60; f->scale = SCALE/8; f->ix = f->iy = 8; f->dx = 1024; f->dy = 2048; colour(255); /* necessary on Vax to clear all planes */ clear(); colour(GREYS); lwidth(1); #ifndef ILLUS logo(); lwidth(2); sprintf(s,"cell-file %s object %d",cell,number); dispstring(s,100,200); #endif ILLUS /* dispstring(timestring,100,100); */ idom = spobj->idom; f->ox = (idom->kol1 + idom->lastkl)/2; f->oy = (idom->line1 + idom->lastln)/2; picframe(spobj,f); if (PROF_CANDS) picframe(mpol,f); colour(GREEN); if (BOUND_CANDS) picpoly(bpdom,f); /* naughty, picpoly should be static in picframe */ f->dx += SCALE*16; f->ix = 1; /* * we want to display normalised profile, * but will need it later, so copy */ if (PROF_CANDS) { newhdom = makehistodmn(1,hdom->npoints); newprof = makemain(13,newhdom,NULL,NULL,NULL); newhdom->r = hdom->r; newhdom->k = hdom->k; newhdom->l = hdom->l; for (i=0; inpoints; i++) newhdom->hv[i] = hdom->hv[i]; histo256normalise(newprof); for (i=0; inpoints; i++) newhdom->hv[i] /= 2; picframe(newprof,f); freeobj(newprof); } f->dx -= 16*SCALE; f->ix = 8; #ifdef ILLUS f->dx += 1380; b = ibound(spobj,1); picframe(b,f); freeobj(b); f->dx -= 1380; tsize(120,120); moveto(1024,1024); text("a"); moveby(768,0); text("b"); moveby(768,0); text("c"); moveby(768,0); text("d"); #else ILLUS sprintf(s,"%d candidates; profile peak %d",chcp->ncands,chcp->profmax); dispstring(s,100,3900); #endif ILLUS } display2(cndp,cpol,cprof, mpol,f,i,SCALE) struct cand *cndp; struct object *cpol, *cprof, *mpol; struct pframe *f; { char s[256]; struct polygondomain *mpdom; struct fvertex *vtx; struct fpoint fp; int scalewas; mpdom = (struct polygondomain *)mpol->idom; vtx = (struct fvertex *)mpdom->vtx; fp.type = 41; fp.style = 2; fp.k = vtx[cndp->profpos].vtX; fp.l = vtx[cndp->profpos].vtY; switch(cndp->candtype) { case 1: colour(RED); break; case 2: colour(GREEN); break; default: colour(255); break; } #ifndef ILLUS sprintf(s,"cand %d pr-pos %d val %d",cndp->candnum,cndp->profpos,cndp->u.sy.profval); dispstring(s,100,3800-100*i); #endif ILLUS /* picframe(&fp,f); */ f->ix = f->iy = 1; f->ox *= 8; f->oy *= 8; picframe(cpol,f); #ifdef ILLUS f->dx += 1380; picframe(cpol,f); f->dx -= 1380; #endif ILLUS f->ox /= 8; f->oy /= 8; f->dx += 1380 + SCALE*24; f->dy = 2048 - 512 + i*768; f->ix = 24; scalewas = f->scale; f->scale /= 2; picframe(cprof,f); f->scale = scalewas; f->ix = 8; f->iy = 8; f->dx -= (1380 + SCALE*24); f->dy = 2048; update(); }