本文整理汇总了C++中ARRAY::Remove_All方法的典型用法代码示例。如果您正苦于以下问题:C++ ARRAY::Remove_All方法的具体用法?C++ ARRAY::Remove_All怎么用?C++ ARRAY::Remove_All使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ARRAY
的用法示例。
在下文中一共展示了ARRAY::Remove_All方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: task_queue
template<class T> void RENDER_WORLD<T>::
Render(const RANGE<VECTOR<int,2> >& pixels, PROGRESS_INDICATOR &progress)
{
RENDERING_RAY<T> dummy_root;
VECTOR<int,2> box_size=camera.film.Samples_Extent();
VECTOR<int,2> lengths=pixels.Edge_Lengths();
ARRAY<typename FILM<T>::SAMPLE> samples;
progress.Initialize((lengths.x/box_size.x+1)*(lengths.y/box_size.y+1)); // +1 to account for rounding; occasionally will be incorrect, but will get close enough to 100% to judge
// progress
if(threads>1){
#ifdef USE_PTHREADS
pthread_mutex_t mutex;
pthread_mutex_init(&mutex,0);
THREAD_QUEUE task_queue(4);
for(int box_x=0;box_x*box_size.x<lengths.x;box_x++) for(int box_y=0;box_y*box_size.y<lengths.y;box_y++){
VECTOR<int,2> lower_corner=VECTOR<int,2>(box_x*box_size.x,box_y*box_size.y)+pixels.min_corner;
task_queue.Queue(new RENDER_TASK<T>(*this,progress,&mutex,RANGE<VECTOR<int,2> >(lower_corner,lower_corner+box_size)));}
task_queue.Wait();
pthread_mutex_destroy(&mutex);
#else
PHYSBAM_FATAL_ERROR("Threads non 1, but USE_PTHREADS disabled");
#endif
}
else for(int box_x=0;box_x*box_size.x<lengths.x;box_x++) for(int box_y=0;box_y*box_size.y<lengths.y;box_y++){
samples.Remove_All();
VECTOR<int,2> lower_corner=VECTOR<int,2>(box_x*box_size.x,box_y*box_size.y)+pixels.min_corner;
camera.film.Generate_Samples(RANGE<VECTOR<int,2> >(lower_corner,lower_corner+box_size),camera,samples);
progress.Progress();
for(int i=1;i<=samples.m;i++){
typename FILM<T>::SAMPLE& sample=samples(i);
RENDERING_RAY<T> ray(RAY<VECTOR<T,3> >(camera.position,sample.world_position-camera.position),1,Point_Inside_Object(camera.position));
dummy_root.recursion_depth=0;dummy_root.current_object=ether;
sample.radiance=Cast_Ray(ray,dummy_root);
sample.alpha=ray.ray.semi_infinite?(T)0:(T)1;
camera.film.Add_Sample(sample);}}
}