本文整理汇总了C++中ImportParameter::GetAreaNodeIndexCellSizeMax方法的典型用法代码示例。如果您正苦于以下问题:C++ ImportParameter::GetAreaNodeIndexCellSizeMax方法的具体用法?C++ ImportParameter::GetAreaNodeIndexCellSizeMax怎么用?C++ ImportParameter::GetAreaNodeIndexCellSizeMax使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImportParameter
的用法示例。
在下文中一共展示了ImportParameter::GetAreaNodeIndexCellSizeMax方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Import
//.........这里部分代码省略.........
nodeTypeData[i].cellYStart=std::min(nodeTypeData[i].cellYStart,cell->first.y);
nodeTypeData[i].cellYEnd=std::max(nodeTypeData[i].cellYEnd,cell->first.y);
}
}
nodeTypeData[i].cellXCount=nodeTypeData[i].cellXEnd-nodeTypeData[i].cellXStart+1;
nodeTypeData[i].cellYCount=nodeTypeData[i].cellYEnd-nodeTypeData[i].cellYStart+1;
// Count absolute number of entries
for (std::map<Pixel,size_t>::const_iterator cell=cellFillCount[i].begin();
cell!=cellFillCount[i].end();
++cell) {
entryCount+=cell->second;
max=std::max(max,cell->second);
}
// Average number of entries per tile cell
double average=entryCount*1.0/cellFillCount[i].size();
// If we do not have any entries, we store it now
if (cellFillCount[i].empty()) {
continue;
}
// If the fill rate of the index is too low, we use this index level anyway
if (nodeTypeData[i].indexCells/(1.0*nodeTypeData[i].cellXCount*nodeTypeData[i].cellYCount)<=
parameter.GetAreaNodeIndexMinFillRate()) {
progress.Warning(typeConfig.GetTypeInfo(i).GetName()+" ("+NumberToString(i)+") is not well distributed");
continue;
}
// If average fill size and max fill size for tile cells
// is within limits, store it now.
if (max<=parameter.GetAreaNodeIndexCellSizeMax() &&
average<=parameter.GetAreaNodeIndexCellSizeAverage()) {
continue;
}
// else, we remove it from the list and try again with an higher
// level.
currentNodeTypes.erase(i);
}
}
// Now process all types for this limit, that are within the limits
for (std::set<TypeId>::const_iterator cnt=currentNodeTypes.begin();
cnt!=currentNodeTypes.end();
cnt++) {
maxLevel=std::max(maxLevel,level);
progress.Info("Type "+typeConfig.GetTypeInfo(*cnt).GetName()+"(" + NumberToString(*cnt)+"), "+NumberToString(nodeTypeData[*cnt].indexCells)+" cells, "+NumberToString(nodeTypeData[*cnt].indexEntries)+" objects");
remainingNodeTypes.erase(*cnt);
}
level++;
}
//
// Writing index file
//
progress.SetAction("Generating 'areanode.idx'");
if (!writer.Open(AppendFileToDir(parameter.GetDestinationDirectory(),
"areanode.idx"))) {