本文整理汇总了C++中Split::left方法的典型用法代码示例。如果您正苦于以下问题:C++ Split::left方法的具体用法?C++ Split::left怎么用?C++ Split::left使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Split
的用法示例。
在下文中一共展示了Split::left方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: lheuristic
void Splitter<Heuristic>::split(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);
if (split.left(prim))
{
if (likely(lblock->insert(prim))) continue;
lheuristic.bin(lblock->base(),lblock->size());
lblock = lprims.insert(alloc->malloc(thread));
lblock->insert(prim);
}
else
{
if (likely(rblock->insert(prim))) continue;
rheuristic.bin(rblock->base(),rblock->size());
rblock = rprims.insert(alloc->malloc(thread));
rblock->insert(prim);
}
}
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: lheuristic
void Splitter<Heuristic>::split(size_t thread, PrimRefAlloc* alloc, const RTCGeometry* geom,
atomic_set<PrimRefBlock>& prims, const PrimInfo& pinfo, const Split& split)
{
Heuristic lheuristic(split.linfo,geom);
Heuristic rheuristic(split.rinfo,geom);
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);
if (split.left(prim))
{
if (likely(lblock->insert(prim))) continue;
lheuristic.bin(lblock->base(),lblock->size());
lblock = lprims.insert(alloc->malloc(thread));
lblock->insert(prim);
}
else
{
if (likely(rblock->insert(prim))) continue;
rheuristic.bin(rblock->base(),rblock->size());
rblock = rprims.insert(alloc->malloc(thread));
rblock->insert(prim);
}
}
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);
}