VTK
VisRTXBackend.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../Backend.h"
4 
5 namespace RTW
6 {
7  /*
8  * Translates OSPRay-ish wrapper API calls to VisRTX
9  */
10  class VisRTXBackend : public RTW::Backend
11  {
12  public:
13  VisRTXBackend() = default;
14  ~VisRTXBackend() = default;
15 
16  RTWError Init() override;
17  void Shutdown() override;
18 
19  bool IsSupported(RTWFeature feature) const override;
20 
21  RTWData NewData(size_t numElements, RTWDataType dataType, const void *source, const uint32_t dataCreationFlags) override;
22  RTWGeometry NewGeometry(const char *type) override;
23  RTWTexture NewTexture(const char* type) override;
24  RTWLight NewLight(RTWRenderer renderer, const char *type);
25  RTWMaterial NewMaterial(RTWRenderer renderer, const char *material_type);
26  RTWRenderer NewRenderer(const char *type) override;
27  RTWCamera NewCamera(const char *type) override;
28  RTWModel NewModel() override;
29  RTWFrameBuffer NewFrameBuffer(const rtw::vec2i &size, const RTWFrameBufferFormat format, const uint32_t frameBufferChannels) override;
30  void Release(RTWObject object) override;
31 
32  void AddGeometry(RTWModel model, RTWGeometry geometry) override;
33 
34  void SetString(RTWObject object, const char *id, const char *s) override;
35  void SetObject(RTWObject object, const char *id, RTWObject other) override;
36  void SetData(RTWObject object, const char *id, RTWData data) override;
37  void SetMaterial(RTWGeometry geometry, RTWMaterial material) override;
38  void Set1i(RTWObject object, const char *id, int32_t x) override;
39  void Set1f(RTWObject object, const char *id, float x) override;
40  void Set2f(RTWObject object, const char *id, float x, float y) override;
41  void Set2i(RTWObject object, const char *id, int x, int y) override;
42  void Set3i(RTWObject object, const char *id, int x, int y, int z) override;
43  void Set3f(RTWObject object, const char *id, float x, float y, float z) override;
44  void Set4f(RTWObject object, const char *id, float x, float y, float z, float w) override;
45 
46  void RemoveParam(RTWObject object, const char *id) override;
47 
48  void Commit(RTWObject object) override;
49 
50  float RenderFrame(RTWFrameBuffer frameBuffer, RTWRenderer renderer, const uint32_t frameBufferChannels) override;
51 
52  void FrameBufferClear(RTWFrameBuffer frameBuffer, const uint32_t frameBufferChannels) override;
53  const void* MapFrameBuffer(RTWFrameBuffer frameBuffer, const RTWFrameBufferChannel channel) override;
54  void UnmapFrameBuffer(const void *mapped, RTWFrameBuffer frameBuffer) override;
55 
56  void SetDepthNormalizationGL(RTWFrameBuffer frameBuffer, float clipMin, float clipMax) override;
57  int GetColorTextureGL(RTWFrameBuffer frameBuffer) override;
58  int GetDepthTextureGL(RTWFrameBuffer frameBuffer) override;
59 
60  public:
61  /*
62  * Unsupported or redundant calls
63  */
64  RTWLight NewLight3(const char *light_type) override
65  {
66  return this->NewLight(nullptr, light_type);
67  }
68 
69  RTWMaterial NewMaterial2(const char *renderer_type, const char *material_type) override
70  {
71  return this->NewMaterial(nullptr, material_type);
72  }
73 
74  RTWGeometry NewInstance(RTWModel modelToInstantiate, const rtw::affine3f &transform) override
75  {
76  return nullptr;
77  }
78 
79  RTWVolume NewVolume(const char *type) override
80  {
81  return nullptr;
82  }
83 
85  {
86  return nullptr;
87  }
88 
89  void AddVolume(RTWModel model, RTWVolume volume) override
90  {
91  }
92 
93  RTWError SetRegion(RTWVolume volume, void *source, const rtw::vec3i &regionCoords, const rtw::vec3i &regionSize) override
94  {
95  return RTW_NO_ERROR;
96  }
97  };
98 }
RTWVolume
struct RTWHandle * RTWVolume
Definition: Types.h:90
RTW::VisRTXBackend::Init
RTWError Init() override
RTWLight
struct RTWHandle * RTWLight
Definition: Types.h:90
RTW::VisRTXBackend::RemoveParam
void RemoveParam(RTWObject object, const char *id) override
RTW::VisRTXBackend::NewLight3
RTWLight NewLight3(const char *light_type) override
Definition: VisRTXBackend.h:64
RTW::VisRTXBackend::Set1f
void Set1f(RTWObject object, const char *id, float x) override
RTW_NO_ERROR
Definition: Types.h:8
RTW::VisRTXBackend::Set3f
void Set3f(RTWObject object, const char *id, float x, float y, float z) override
RTW::VisRTXBackend::GetColorTextureGL
int GetColorTextureGL(RTWFrameBuffer frameBuffer) override
RTWFrameBuffer
struct RTWHandle * RTWFrameBuffer
Definition: Types.h:90
RTWObject
struct RTWHandle * RTWObject
Definition: Types.h:90
RTW::VisRTXBackend::FrameBufferClear
void FrameBufferClear(RTWFrameBuffer frameBuffer, const uint32_t frameBufferChannels) override
RTWFrameBufferChannel
RTWFrameBufferChannel
Definition: Types.h:22
vtkX3D::type
Definition: vtkX3D.h:522
RTW::VisRTXBackend::SetObject
void SetObject(RTWObject object, const char *id, RTWObject other) override
vtkX3D::data
Definition: vtkX3D.h:321
RTW::VisRTXBackend::Release
void Release(RTWObject object) override
RTW::VisRTXBackend::NewData
RTWData NewData(size_t numElements, RTWDataType dataType, const void *source, const uint32_t dataCreationFlags) override
RTWModel
struct RTWHandle * RTWModel
Definition: Types.h:90
RTW::VisRTXBackend
Definition: VisRTXBackend.h:10
RTW::VisRTXBackend::NewModel
RTWModel NewModel() override
RTW::VisRTXBackend::NewTransferFunction
RTWTransferFunction NewTransferFunction(const char *type) override
Definition: VisRTXBackend.h:84
RTW
Definition: Backend.h:5
RTWFeature
RTWFeature
Definition: Types.h:107
RTW::VisRTXBackend::Set2f
void Set2f(RTWObject object, const char *id, float x, float y) override
RTW::VisRTXBackend::NewRenderer
RTWRenderer NewRenderer(const char *type) override
rtw::vec2i
Definition: Types.h:81
RTW::VisRTXBackend::RenderFrame
float RenderFrame(RTWFrameBuffer frameBuffer, RTWRenderer renderer, const uint32_t frameBufferChannels) override
RTW::VisRTXBackend::NewVolume
RTWVolume NewVolume(const char *type) override
Definition: VisRTXBackend.h:79
RTW::VisRTXBackend::AddVolume
void AddVolume(RTWModel model, RTWVolume volume) override
Definition: VisRTXBackend.h:89
RTW::VisRTXBackend::SetString
void SetString(RTWObject object, const char *id, const char *s) override
RTW::VisRTXBackend::Set1i
void Set1i(RTWObject object, const char *id, int32_t x) override
RTW::VisRTXBackend::SetData
void SetData(RTWObject object, const char *id, RTWData data) override
RTW::VisRTXBackend::AddGeometry
void AddGeometry(RTWModel model, RTWGeometry geometry) override
RTW::VisRTXBackend::NewMaterial2
RTWMaterial NewMaterial2(const char *renderer_type, const char *material_type) override
Definition: VisRTXBackend.h:69
RTW::VisRTXBackend::NewLight
RTWLight NewLight(RTWRenderer renderer, const char *type)
RTW::VisRTXBackend::SetDepthNormalizationGL
void SetDepthNormalizationGL(RTWFrameBuffer frameBuffer, float clipMin, float clipMax) override
RTW::VisRTXBackend::NewTexture
RTWTexture NewTexture(const char *type) override
RTWMaterial
struct RTWHandle * RTWMaterial
Definition: Types.h:90
RTWGeometry
struct RTWHandle * RTWGeometry
Definition: Types.h:90
RTW::VisRTXBackend::Set3i
void Set3i(RTWObject object, const char *id, int x, int y, int z) override
RTW::VisRTXBackend::~VisRTXBackend
~VisRTXBackend()=default
RTWFrameBufferFormat
RTWFrameBufferFormat
Definition: Types.h:16
vtkX3D::size
Definition: vtkX3D.h:259
RTW::VisRTXBackend::Set2i
void Set2i(RTWObject object, const char *id, int x, int y) override
RTWTransferFunction
struct RTWHandle * RTWTransferFunction
Definition: Types.h:90
RTW::VisRTXBackend::NewFrameBuffer
RTWFrameBuffer NewFrameBuffer(const rtw::vec2i &size, const RTWFrameBufferFormat format, const uint32_t frameBufferChannels) override
RTW::VisRTXBackend::NewCamera
RTWCamera NewCamera(const char *type) override
RTWTexture
struct RTWHandle * RTWTexture
Definition: Types.h:90
RTW::VisRTXBackend::Shutdown
void Shutdown() override
RTW::VisRTXBackend::VisRTXBackend
VisRTXBackend()=default
RTW::VisRTXBackend::MapFrameBuffer
const void * MapFrameBuffer(RTWFrameBuffer frameBuffer, const RTWFrameBufferChannel channel) override
RTW::VisRTXBackend::SetRegion
RTWError SetRegion(RTWVolume volume, void *source, const rtw::vec3i &regionCoords, const rtw::vec3i &regionSize) override
Definition: VisRTXBackend.h:93
RTW::VisRTXBackend::Commit
void Commit(RTWObject object) override
RTW::VisRTXBackend::UnmapFrameBuffer
void UnmapFrameBuffer(const void *mapped, RTWFrameBuffer frameBuffer) override
RTW::Backend
Definition: Backend.h:7
rtw::affine3f
Definition: Types.h:87
rtw::vec3i
Definition: Types.h:82
RTWData
struct RTWHandle * RTWData
Definition: Types.h:90
RTW::VisRTXBackend::Set4f
void Set4f(RTWObject object, const char *id, float x, float y, float z, float w) override
RTW::VisRTXBackend::IsSupported
bool IsSupported(RTWFeature feature) const override
RTWRenderer
struct RTWHandle * RTWRenderer
Definition: Types.h:90
RTW::VisRTXBackend::NewInstance
RTWGeometry NewInstance(RTWModel modelToInstantiate, const rtw::affine3f &transform) override
Definition: VisRTXBackend.h:74
source
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Definition: vtkBoostGraphAdapter.h:959
RTWError
RTWError
Definition: Types.h:6
RTW::VisRTXBackend::GetDepthTextureGL
int GetDepthTextureGL(RTWFrameBuffer frameBuffer) override
RTW::VisRTXBackend::NewMaterial
RTWMaterial NewMaterial(RTWRenderer renderer, const char *material_type)
RTW::VisRTXBackend::SetMaterial
void SetMaterial(RTWGeometry geometry, RTWMaterial material) override
RTWCamera
struct RTWHandle * RTWCamera
Definition: Types.h:90
RTW::VisRTXBackend::NewGeometry
RTWGeometry NewGeometry(const char *type) override
RTWDataType
RTWDataType
Definition: Types.h:59