当前位置: 首页>>代码示例>>C++>>正文


C++ Split::left方法代码示例

本文整理汇总了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);
 }
开发者ID:GHF,项目名称:trayrace,代码行数:34,代码来源:splitter.cpp

示例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);
 }
开发者ID:1510649869,项目名称:tungsten,代码行数:34,代码来源:splitter.cpp


注:本文中的Split::left方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。