1 // Copyright 2009-2021 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 
4 #pragma once
5 
6 #include "api/ISPCDevice.h"
7 #include "common/Managed.h"
8 // embree
9 #include "embree3/rtcore.h"
10 
11 #include "openvkl/volume.h"
12 
13 namespace ospray {
14 
15 struct OSPRAY_SDK_INTERFACE Volume : public ManagedObject
16 {
17   Volume(const std::string &vklType);
18   ~Volume() override;
19 
20   std::string toString() const override;
21 
22   void commit() override;
23 
24   void setDevice(RTCDevice embreeDevice, VKLDevice vklDevice);
25 
26  private:
27   void checkDataStride(const Data *) const;
28   void handleParams();
29 
30   // Friends //
31 
32   friend struct Isosurfaces;
33   friend struct VolumetricModel;
34 
35   // Data //
36 
37   RTCGeometry embreeGeometry{nullptr};
38   VKLVolume vklVolume{nullptr};
39   VKLSampler vklSampler{nullptr};
40 
41   box3f bounds{empty};
42 
43   std::string vklType;
44   RTCDevice embreeDevice{nullptr};
45   VKLDevice vklDevice{nullptr};
46 };
47 
48 OSPTYPEFOR_SPECIALIZATION(Volume *, OSP_VOLUME);
49 
50 } // namespace ospray
51