/* * Return false if a segment is not in a block or is forward in its block, and * true otherwise. Converts from pinch graph orientations to vg orientations. */ bool getOrientation(stPinchSegment* segment) { auto block = stPinchSegment_getBlock(segment); return block ? !stPinchSegment_getBlockOrientation(segment) : false; }
// Used for interactive debugging. void stCaf_printBlock(stPinchBlock *block) { stPinchBlockIt blockIt = stPinchBlock_getSegmentIterator(block); stPinchSegment *segment; while ((segment = stPinchBlockIt_getNext(&blockIt)) != NULL) { stPinchThread *thread = stPinchSegment_getThread(segment); Cap *cap = flower_getCap(flower, stPinchThread_getName(thread)); Event *event = cap_getEvent(cap); Sequence *sequence = cap_getSequence(cap); printf("%s.%s:%" PRIi64 "-%" PRIi64 ":%s\n", event_getHeader(event), sequence_getHeader(sequence), stPinchSegment_getStart(segment), stPinchSegment_getStart(segment) + stPinchSegment_getLength(segment), stPinchSegment_getBlockOrientation(segment) ? "+" : "-"); } }