// Return true if pt click over a threshold of the join, false if not bool gqbGraphSimple::clickOnJoin(gqbQueryJoin *join, wxPoint &pt, wxPoint &origin, wxPoint &dest) { wxPoint origin2=origin; wxPoint dest2=dest; if(join->getAnchorsUsed().x==1) { origin2.x+=20; } else { origin2.x-=20; } if(join->getAnchorsUsed().y==1) { dest2.x+=20; } else { dest2.x-=20; } // Check origin anchor bool value1=insideLine(pt,origin,origin2,lineClickThreshold); // Check dest anchor bool value2=insideLine(pt,dest,dest2,lineClickThreshold); // Check line between both tables bool value3=insideLine(pt,origin2,dest2,lineClickThreshold); if(value1 || value2 || value3) return true; else return false; }
void checkBlock(mafBlock_t *mb, char *fullname, uint64_t pos) { mafLine_t *ml = maf_mafBlock_getHeadLine(mb); char *vignette = NULL; while (ml != NULL) { if (maf_mafLine_getType(ml) != 's') { ml = maf_mafLine_getNext(ml); continue; } if (!(strcmp(maf_mafLine_getSpecies(ml), fullname) == 0)) { ml = maf_mafLine_getNext(ml); continue; } if (insideLine(ml, pos)) { vignette = extractVignette(ml, pos); printf("block %" PRIu64 ", line %" PRIu64 ": s %s %" PRIu64 " %" PRIu64 " %c %" PRIu64 " %s\n", maf_mafBlock_getLineNumber(mb), maf_mafLine_getLineNumber(ml), fullname, maf_mafLine_getStart(ml), maf_mafLine_getLength(ml), maf_mafLine_getStrand(ml), maf_mafLine_getSourceLength(ml), vignette); free(vignette); } ml = maf_mafLine_getNext(ml); } }