14#ifdef TTK_ENABLE_EMBREE
15#include <embree3/rtcore.h>
27#ifdef TTK_ENABLE_EMBREE
29 int initializeDevice(RTCDevice &device)
const;
31 template <
typename IT>
32 int initializeScene(RTCScene &scene,
34 const RTCDevice &device,
35 const size_t &nVertices,
36 const float *vertexCoords,
37 const size_t &nTriangles,
38 const IT *connectivityList)
const;
40 int renderImage(
float *depthBuffer,
41 unsigned int *primitiveIds,
42 float *barycentricCoordinates,
44 const RTCScene &scene,
45 const double resolution[2],
46 const double camCenter[3],
47 const double camDir[3],
48 const double camUp[3],
49 const double &camFactor,
50 const bool &orthographicProjection =
true)
const;
52 int deallocateScene(RTCDevice &device, RTCScene &scene)
const;
58#ifdef TTK_ENABLE_EMBREE
61int ttk::CinemaImagingEmbree::initializeScene(
64 const RTCDevice &device,
65 const size_t &nVertices,
66 const float *vertexCoords,
67 const size_t &nTriangles,
68 const IT *connectivityList)
const {
70 this->
printMsg(
"Initializing Scene (#v:" + std::to_string(nVertices)
71 +
"|#t:" + std::to_string(nTriangles) +
")",
74 scene = rtcNewScene(device);
76 RTCGeometry mesh = rtcNewGeometry(device, RTC_GEOMETRY_TYPE_TRIANGLE);
80 rtcSetSharedGeometryBuffer(mesh, RTC_BUFFER_TYPE_VERTEX, 0,
81 RTC_FORMAT_FLOAT3, (
const void *)vertexCoords, 0,
82 3 *
sizeof(
float), nVertices);
99 unsigned int *indices = (
unsigned int *)rtcSetNewGeometryBuffer(
100 mesh, RTC_BUFFER_TYPE_INDEX, 0, RTC_FORMAT_UINT3,
101 3 *
sizeof(
unsigned int), nTriangles);
103 for(
size_t t = 0, tn = nTriangles * 3; t < tn; t++)
104 indices[t] = (
unsigned int)connectivityList[t];
106 rtcCommitGeometry(mesh);
107 rtcAttachGeometry(scene, mesh);
108 rtcReleaseGeometry(mesh);
111 rtcCommitScene(scene);
113 this->
printMsg(
"Initializing Scene (#v:" + std::to_string(nVertices)
114 +
"|#t:" + std::to_string(nTriangles) +
")",
TTK CinemaImagingEmbree processing package.
~CinemaImagingEmbree() override
TTK modules that generates images of a dataset.
printMsg(debug::output::BOLD+" | | | | | . \\ | | (__| | / __/| |_| / __/|__ _|"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)