Esempio n. 1
0
void VDBRayMarcher::operator() (const tbb::blocked_range<size_t>& r) const {
	for (size_t j = r.begin(), je = r.end(); j < je; ++j) {
	AccessorType accessor2(mImpl->grid->getConstAccessor());
	SamplerType interpolator2(accessor2, mImpl->grid->transform());
		// Create an intersector for each thread
		IntersectorT intersector2(*(mImpl->grid));
        int NX = mImpl->table.findIntAttr("NX");
        int NY = mImpl->table.findIntAttr("NY");
		for (size_t i = 0, ie = NX; i < ie; ++i) {
			MeshPotato::MPUtils::MPRay ray;
			double x = (double)i/(NX - 1.0);
               		double y = (double)j/(NY - 1.0);
			ray = mImpl->camera->getRay(x,y);

			const DeepPixelBuffer deepColor = deepL(ray, intersector2, interpolator2);
//			std::vector<float> &pixel = image->pixel(i,j);
//			pixel[0] = c[0];
//			pixel[1] = c[1];
//			pixel[2] = c[2];
//			pixel[3] = c[3];
			mImpl->deepimage->value(i,j) = deepColor;
		}
	}
}
    void operator()(ACCESSOR& accessor1) const
    {
        ACCESSOR accessor2(other_grid->get_data());

        functor(accessor1, accessor2);
    }