22 vtkMultiBlockDataSet *outputImages,
24 vtkPointSet *inputObject,
25 vtkPointSet *inputGrid)
const {
28#ifdef TTK_ENABLE_EMBREE
33 status = this->initializeDevice(device);
37 auto inputObjectConnectivityList =
static_cast<vtkIdType *
>(
41 status = this->initializeScene<vtkIdType>(
44 device, inputObject->GetNumberOfPoints(),
46 inputObjectCells->GetNumberOfCells(), inputObjectConnectivityList);
56 float *samplingPositions
58 int const nSamplingPositions = inputGrid->GetNumberOfPoints();
59 auto camParameters = inputGrid->GetPointData();
60 auto camUp =
static_cast<double *
>(
62 auto camDir =
static_cast<double *
>(
64 auto camHeight =
static_cast<double *
>(
66 auto camNearFar =
static_cast<double *
>(
68 auto camAngle =
static_cast<double *
>(
70 auto resolution =
static_cast<double *
>(
72 auto projectionMode =
static_cast<double *
>(
75 for(
int i = 0; i < nSamplingPositions; i++) {
77 double camPos[3]{samplingPositions[i * 3], samplingPositions[i * 3 + 1],
78 samplingPositions[i * 3 + 2]};
82 outputImage->SetDimensions(resolution[0], resolution[1], 1);
83 outputImage->SetSpacing(1, 1, 1);
84 outputImage->SetOrigin(0, 0, 0);
85 outputImage->AllocateScalars(VTK_FLOAT, 1);
87 size_t const nPixels = resolution[i * 2] * resolution[i * 2 + 1];
88 auto outputImagePD = outputImage->GetPointData();
90 auto depthBuffer = outputImagePD->GetArray(0);
91 depthBuffer->SetName(
"Depth");
94 primitiveIdArray->SetName(
"PrimitiveId");
95 primitiveIdArray->SetNumberOfComponents(1);
96 primitiveIdArray->SetNumberOfTuples(nPixels);
97 auto primitiveIdArrayData
99 outputImagePD->AddArray(primitiveIdArray);
102 barycentricCoordinates->SetName(
"BarycentricCoordinates");
103 barycentricCoordinates->SetNumberOfComponents(2);
104 barycentricCoordinates->SetNumberOfTuples(nPixels);
105 auto barycentricCoordinatesData
107 outputImagePD->AddArray(barycentricCoordinates);
110 status = this->renderImage(
112 primitiveIdArrayData, barycentricCoordinatesData,
114 scene, &resolution[i * 2], camPos, &camDir[i * 3], &camUp[i * 3],
115 projectionMode[i] == 0 ? camHeight[i] : camAngle[i],
116 projectionMode[i] == 0);
125 inputObject,
this, primitiveIdArrayData, barycentricCoordinatesData,
126 inputObjectConnectivityList);
132 outputImages->SetBlock(i, outputImage);
136 this->deallocateScene(device, scene);
143 this->printErr(
"TTK was build without EMBREE backend.");