本文整理汇总了C++中TopSegmentIteratorPtr::setArrayIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ TopSegmentIteratorPtr::setArrayIndex方法的具体用法?C++ TopSegmentIteratorPtr::setArrayIndex怎么用?C++ TopSegmentIteratorPtr::setArrayIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TopSegmentIteratorPtr
的用法示例。
在下文中一共展示了TopSegmentIteratorPtr::setArrayIndex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateBlockEdges
void LodExtract::updateBlockEdges(const Genome* inParentGenome,
SegmentMap& segMap,
const LodBlock* block,
BottomSegmentIteratorPtr bottom,
TopSegmentIteratorPtr top)
{
Genome* outParentGenome = bottom->getGenome();
const LodSegment* rootSeg = NULL;
SegmentSet* segSet;
SegmentSet::iterator setIt;
// Zap all segments in parent genome
SegmentMap::iterator mapIt = segMap.find(inParentGenome);
if (mapIt != segMap.end())
{
segSet = mapIt->second;
assert(segSet != NULL);
setIt = segSet->begin();
for (; setIt != segSet->end(); ++setIt)
{
bottom->setArrayIndex(outParentGenome, (*setIt)->getArrayIndex());
for (hal_size_t i = 0; i < bottom->getNumChildren(); ++i)
{
bottom->setChildIndex(i, NULL_INDEX);
bottom->setTopParseIndex(NULL_INDEX);
}
}
// Choose first segment as parent to all segments in the child genome
setIt = segSet->begin();
rootSeg = *(setIt);
bottom->setArrayIndex(outParentGenome, (*setIt)->getArrayIndex());
}
// Do the child genomes
const Genome* inGrandParentGenome = inParentGenome->getParent();
SegmentSet::iterator nextIt;
for (mapIt = segMap.begin(); mapIt != segMap.end(); ++mapIt)
{
if (mapIt->first != inParentGenome and mapIt->first != inGrandParentGenome)
{
Genome* outChildGenome =
_outAlignment->openGenome(mapIt->first->getName());
hal_index_t childIndex = outParentGenome->getChildIndex(outChildGenome);
assert(childIndex >= 0);
segSet = mapIt->second;
assert(segSet != NULL);
for (setIt = segSet->begin(); setIt != segSet->end(); ++setIt)
{
top->setArrayIndex(outChildGenome, (*setIt)->getArrayIndex());
top->setBottomParseIndex(NULL_INDEX);
// Connect to parent
if (rootSeg != NULL)
{
top->setParentIndex(bottom->getArrayIndex());
bool reversed = (*setIt)->getFlipped() != rootSeg->getFlipped();
top->setParentReversed(reversed);
if (setIt == segSet->begin())
{
bottom->setChildIndex(childIndex, top->getArrayIndex());
bottom->setChildReversed(childIndex, reversed);
}
}
else
{
top->setParentIndex(NULL_INDEX);
}
// Connect to next paralogy
SegmentSet::iterator setNext = setIt;
++setNext;
if (setNext == segSet->end())
{
setNext = segSet->begin();
}
if (setNext == setIt)
{
top->setNextParalogyIndex(NULL_INDEX);
}
else
{
top->setNextParalogyIndex((*setNext)->getArrayIndex());
}
}
}
}
}