".get_person_name($rootid)."
".$pgv_lang["gen_ped_chart"].""; // -- print the form to change the number of displayed generations if ($view!="preview") { print "\n\t
\n\t\t".$pgv_lang["root_person"]."".$pgv_lang["find_id"]."
"; print "\n\t\t".$pgv_lang["generations"]."
\n\t\t"; print ""; print "\n"; print "\n\t\t
"; } // -- the $treeid array will hold all of the individual ids to be displayed on the pedigree chart // -- the id in position 0 is the root person. The other positions are filled according to the following algorithm // -- if an individual is at position $i then individual $i's father will occupy position ($i*2)+1 and $i's mother // -- will occupy ($i*2)+2 $treeid = array(); $treeid[0]=$rootid; // -- maximum size of the id array is 2^$PEDIGREE_GENERATIONS - 1 $treesize = pow(2, (int)($PEDIGREE_GENERATIONS))-1; // -- fill in the id array for($i=0; $i<($treesize/2); $i++) { if ($treeid[$i]) { $famids = find_family_ids($treeid[$i]); if (count($famids)>0) { $parents=false; $j=0; while((!$parents)&&($j=0; $i--) { // -- check to see if we have moved to the next generation if ($i < floor($treesize / (pow(2, $curgen)))) { $curgen++; } $prevyoffset = $yoffset; // -- calculate the yoffset Position in the generation Spacing between boxes put child between parents $yoffset = $baseyoffset+(($i-pow(2, $PEDIGREE_GENERATIONS-$curgen)) * (($bheight+$byspacing) * pow(2, $curgen-1)))+((($bheight+$byspacing)/2)*pow(2,$curgen-1))+(($bheight+$byspacing) * pow(2, $curgen-1)); // -- calculate the xoffset $xoffset = 20+$basexoffset+ (($PEDIGREE_GENERATIONS - $curgen) * ($bwidth+$bxspacing)); // -- if we are in the middle generations then we need to draw the connecting lines if (($curgen >2) && ($curgen < $PEDIGREE_GENERATIONS)) { if ($i %2 ==1) { print " \n"; ?>