/* * shorten.c Jim Piper 20-05-86 * * using density profile, shorten tips of mid points polygon, * and specified density and moment profiles * until within chromosome body (density at least 1% of peak). * ******************************************************************************* * MODIFICATION HISTORY * -------------------- * Who When What * --- ---- ---- * JP 05-09-86 Copes both with float and scaled integer axis polygons. ******************************************************************************* */ #include #include "../h/wstruct.h" #include "../h/chromanal.h" multishorten(mpol,prof0,profs,n) struct object *mpol, *prof0, **profs; int n; { register int i,l,*g,maxh; register struct histogramdomain *hdom; register struct polygondomain *p; int e1,e2; hdom = (struct histogramdomain *)prof0->idom; p = (struct polygondomain *)mpol->idom; l = hdom->npoints; g = hdom->hv; maxh = e1 = e2 = 0; for (i=0; i maxh) maxh = *g; g++; } maxh /= 100; while (*--g <= maxh) e2++; g = hdom->hv; while (*g++ <= maxh) e1++; e2 += e1; p->nvertices -= e2; switch (p->type) { case 1: p->vtx += e1; break; case 2: (struct fvertex *)(p->vtx) += e1; break; } for (i=0; iidom; hdom->hv += e1; hdom->npoints -= e2; } }