Exemplo n.º 1
0
	Tiles
	ParallelRenderer::worker (TaskDispatcher& _task_dispatcher, World& _world, 
	    Settings& _settings, Engine& _engine, SuperSampling& _super_sampling)
	{
		Tiles result;
		SerialRenderer serial_renderer;
		Settings settings = _settings;
		
		while (1)
		{
			boost::optional<Task> optional_task = _task_dispatcher.get_task();
			if (!optional_task)
				break;

			Task task = optional_task.get();
			settings.area = task;

			Image rendered_image = serial_renderer.render(_world, settings, _engine,
			    _super_sampling);

			Tile tile;
			tile.task = task;
			tile.image = rendered_image;
			result.push_back(tile);
		}

		return result;
	}
Exemplo n.º 2
0
static void trace(Node *n, Tiles &v) {
  v.clear();
  while (n) {
    v.push_back(n->tile);
    n = n->next;
  }
  std::reverse(v.begin(), v.end());
}
 void apply(osg::Group& group)
 {
     osgVolume::VolumeTile* tile = dynamic_cast<osgVolume::VolumeTile*>(&group);
     if (tile) _tiles.push_back(tile);
     else traverse(group);
 }