25 vtkMultiBlockDataSet *outputImages,
27 vtkPointSet *inputObject,
28 vtkPointSet *inputGrid)
const {
39 float *samplingPositions
41 int const nSamplingPositions = inputGrid->GetNumberOfPoints();
42 auto camParameters = inputGrid->GetPointData();
43 auto camUp =
static_cast<double *
>(
45 auto camNearFar =
static_cast<double *
>(
47 auto camDir =
static_cast<double *
>(
49 auto camHeight =
static_cast<double *
>(
51 auto camAngle =
static_cast<double *
>(
53 auto resolution =
static_cast<double *
>(
55 auto projectionMode =
static_cast<double *
>(
58 auto inputObjectConnectivityList =
static_cast<vtkIdType *
>(
64 inputObjectConnectivityList, inputObjectCells->GetNumberOfCells());
68 for(
int i = 0; i < nSamplingPositions; i++) {
70 double camPos[3]{samplingPositions[i * 3], samplingPositions[i * 3 + 1],
71 samplingPositions[i * 3 + 2]};
75 outputImage->SetDimensions(resolution[0], resolution[1], 1);
76 outputImage->SetSpacing(1, 1, 1);
77 outputImage->SetOrigin(0, 0, 0);
78 outputImage->AllocateScalars(VTK_FLOAT, 1);
80 size_t const nPixels = resolution[i * 2] * resolution[i * 2 + 1];
81 auto outputImagePD = outputImage->GetPointData();
83 auto depthBuffer = outputImagePD->GetArray(0);
84 depthBuffer->SetName(
"Depth");
87 primitiveIdArray->SetName(
"PrimitiveId");
88 primitiveIdArray->SetNumberOfComponents(1);
89 primitiveIdArray->SetNumberOfTuples(nPixels);
90 auto primitiveIdArrayData
92 outputImagePD->AddArray(primitiveIdArray);
95 barycentricCoordinates->SetName(
"BarycentricCoordinates");
96 barycentricCoordinates->SetNumberOfComponents(2);
97 barycentricCoordinates->SetNumberOfTuples(nPixels);
98 auto barycentricCoordinatesData
100 outputImagePD->AddArray(barycentricCoordinates);
103 status = this->renderImage(
107 inputObject->GetNumberOfPoints(),
109 inputObjectCells->GetNumberOfCells(), inputObjectConnectivityList, bvh,
110 &resolution[i * 2], camPos, &camDir[i * 3], &camUp[i * 3], camHeight[i],
111 projectionMode[i] == 0, camAngle[i]);
120 inputObject,
this, primitiveIdArrayData, barycentricCoordinatesData,
121 inputObjectConnectivityList);
127 outputImages->SetBlock(i, outputImage);