本文整理汇总了C++中Split::split方法的典型用法代码示例。如果您正苦于以下问题:C++ Split::split方法的具体用法?C++ Split::split怎么用?C++ Split::split使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Split
的用法示例。
在下文中一共展示了Split::split方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: lheuristic
void Splitter<Heuristic>::split_spatial(const TaskScheduler::ThreadInfo& thread, PrimRefAlloc* alloc, const BuildTriangle* triangles, const Vec3fa* vertices,
atomic_set<PrimRefBlock>& prims, const PrimInfo& pinfo, const Split& split)
{
Heuristic lheuristic(split.linfo,triangles,vertices);
Heuristic rheuristic(split.rinfo,triangles,vertices);
atomic_set<PrimRefBlock>::item* lblock = lprims.insert(alloc->malloc(thread));
atomic_set<PrimRefBlock>::item* rblock = rprims.insert(alloc->malloc(thread));
while (atomic_set<PrimRefBlock>::item* block = prims.take())
{
for (size_t i=0; i<block->size(); i++)
{
const PrimRef& prim = block->at(i);
PrimRef lprim, rprim; split.split(prim,lprim,rprim);
if (lprim.id() != size_t(-1) && !lblock->insert(lprim))
{
lheuristic.bin(lblock->base(),lblock->size());
lblock = lprims.insert(alloc->malloc(thread));
lblock->insert(lprim);
}
if (rprim.id() != size_t(-1) && !rblock->insert(rprim))
{
rheuristic.bin(rblock->base(),rblock->size());
rblock = rprims.insert(alloc->malloc(thread));
rblock->insert(rprim);
}
}
alloc->free(thread,block);
}
lheuristic.bin(lblock->base(),lblock->size()); linfo = split.linfo; lheuristic.best(lsplit);
rheuristic.bin(rblock->base(),rblock->size()); rinfo = split.rinfo; rheuristic.best(rsplit);
}
示例2: Input
void Input(){
//world and location data for current area
game_world = gsmRef->getAdventure()->getWorld();
//get command entered
getline(cin, input);
//separate words in the command
args = s.split(input, ' ');
//process
CommandManager cm(game_world);
cm.Process(args);
game_world = cm.UpdatedWorld();
}