VTK  9.1.0
Backend.h
Go to the documentation of this file.
1#pragma once
2
3#include "Types.h"
4
5namespace RTW
6{
7 class Backend
8 {
9 public:
10 virtual ~Backend() = default;
11
12 public:
13 virtual RTWError Init() = 0;
14 virtual void Shutdown() = 0;
15
16 virtual bool IsSupported(RTWFeature feature) const = 0;
17
18 virtual RTWData NewData(RTWDataType, size_t numItems) = 0;
19 virtual RTWData NewCopyData1D(const void *source, RTWDataType, size_t numItems) = 0;
20 virtual RTWData NewCopyData2D(const void *source, RTWDataType, size_t numItems1, size_t numItems2) = 0;
21 virtual RTWData NewCopyData3D(const void *source, RTWDataType, size_t numItems1, size_t numItems2, size_t numItems3) = 0;
22 virtual RTWData NewSharedData1D(const void *source, RTWDataType, uint32_t numItems) = 0;
23 virtual RTWData NewSharedData2D(const void *source, RTWDataType, uint32_t numItems1, uint32_t numItems2) = 0;
24 virtual RTWData NewSharedData3D(const void *source, RTWDataType, uint32_t numItems1, uint32_t numItems2,
25 uint32_t numItems3) = 0;
26 virtual RTWGeometry NewGeometry(const char *type) = 0;
27 virtual RTWGroup NewGroup() = 0;
28 virtual RTWTexture NewTexture(const char* type) = 0;
29 virtual RTWLight NewLight(const char *light_type) = 0;
30 virtual RTWMaterial NewMaterial(const char *renderer_type, const char *material_type) = 0;
31 virtual RTWVolume NewVolume(const char *type) = 0;
34 virtual RTWRenderer NewRenderer(const char *type) = 0;
35 virtual RTWCamera NewCamera(const char *type) = 0;
36 virtual RTWWorld NewWorld() = 0;
38 virtual RTWInstance NewInstance(RTWGroup geometry) = 0;
39 virtual RTWFrameBuffer NewFrameBuffer(const rtw::vec2i &size, const RTWFrameBufferFormat format, const uint32_t frameBufferChannels) = 0;
40
41 virtual void Release(RTWObject) = 0;
42
43
44 virtual void SetString(RTWObject, const char *id, const char *s) = 0;
45 virtual void SetObject(RTWObject, const char *id, RTWObject other) = 0;
46 virtual void SetObjectAsData(RTWObject target, const char *id, RTWDataType type, RTWObject obj) = 0;
47 virtual void SetParam(RTWObject, const char *id, RTWDataType type, const void* mem) = 0;
48 virtual void SetBool(RTWObject, const char *id, bool x) = 0;
49 virtual void SetInt(RTWObject, const char *id, int32_t x) = 0;
50 virtual void SetVec2i(RTWObject, const char *id, int32_t x, int32_t y) = 0;
51 virtual void SetFloat(RTWObject, const char *id, float x) = 0;
52 virtual void SetVec2f(RTWObject, const char *id, float x, float y) = 0;
53 virtual void SetVec3i(RTWObject, const char *id, int x, int y, int z) = 0;
54 virtual void SetVec3f(RTWObject, const char *id, float x, float y, float z) = 0;
55 virtual void SetVec4f(RTWObject, const char *id, float x, float y, float z, float w) = 0;
56
57 virtual void RemoveParam(RTWObject, const char *id) = 0;
58
59 virtual void Commit(RTWObject) = 0;
60
62
64 virtual const void* MapFrameBuffer(RTWFrameBuffer, const RTWFrameBufferChannel) = 0;
65 virtual void UnmapFrameBuffer(const void *mapped, RTWFrameBuffer) = 0;
66
67 virtual void SetDepthNormalizationGL(RTWFrameBuffer frameBuffer, float clipMin, float clipMax) = 0;
68 virtual int GetColorTextureGL(RTWFrameBuffer frameBuffer) = 0;
69 virtual int GetDepthTextureGL(RTWFrameBuffer frameBuffer) = 0;
70 };
71}
struct RTWHandle * RTWData
Definition: Types.h:229
struct RTWHandle * RTWCamera
Definition: Types.h:223
RTWFrameBufferFormat
Definition: Types.h:18
struct RTWHandle * RTWObject
Definition: Types.h:236
struct RTWHandle * RTWTexture
Definition: Types.h:235
struct RTWHandle * RTWTransferFunction
Definition: Types.h:234
RTWFeature
Definition: Types.h:241
struct RTWHandle * RTWFrameBuffer
Definition: Types.h:220
struct RTWHandle * RTWGroup
Definition: Types.h:224
struct RTWHandle * RTWGeometry
Definition: Types.h:230
struct RTWHandle * RTWVolume
Definition: Types.h:233
RTWError
Definition: Types.h:7
struct RTWHandle * RTWVolumetricModel
Definition: Types.h:227
RTWDataType
Definition: Types.h:120
struct RTWHandle * RTWMaterial
Definition: Types.h:231
struct RTWHandle * RTWRenderer
Definition: Types.h:222
struct RTWHandle * RTWLight
Definition: Types.h:232
struct RTWHandle * RTWInstance
Definition: Types.h:225
RTWFrameBufferChannel
Definition: Types.h:26
struct RTWHandle * RTWWorld
Definition: Types.h:228
struct RTWHandle * RTWGeometricModel
Definition: Types.h:226
virtual RTWData NewData(RTWDataType, size_t numItems)=0
virtual void SetFloat(RTWObject, const char *id, float x)=0
virtual RTWFrameBuffer NewFrameBuffer(const rtw::vec2i &size, const RTWFrameBufferFormat format, const uint32_t frameBufferChannels)=0
virtual void Shutdown()=0
virtual const void * MapFrameBuffer(RTWFrameBuffer, const RTWFrameBufferChannel)=0
virtual RTWTexture NewTexture(const char *type)=0
virtual RTWCamera NewCamera(const char *type)=0
virtual RTWError Init()=0
virtual void SetParam(RTWObject, const char *id, RTWDataType type, const void *mem)=0
virtual RTWData NewSharedData2D(const void *source, RTWDataType, uint32_t numItems1, uint32_t numItems2)=0
virtual RTWRenderer NewRenderer(const char *type)=0
virtual RTWData NewCopyData3D(const void *source, RTWDataType, size_t numItems1, size_t numItems2, size_t numItems3)=0
virtual RTWData NewCopyData2D(const void *source, RTWDataType, size_t numItems1, size_t numItems2)=0
virtual RTWGeometricModel NewGeometricModel(RTWGeometry geometry)=0
virtual RTWVolume NewVolume(const char *type)=0
virtual bool IsSupported(RTWFeature feature) const =0
virtual void SetInt(RTWObject, const char *id, int32_t x)=0
virtual void SetVec2i(RTWObject, const char *id, int32_t x, int32_t y)=0
virtual int GetColorTextureGL(RTWFrameBuffer frameBuffer)=0
virtual void SetDepthNormalizationGL(RTWFrameBuffer frameBuffer, float clipMin, float clipMax)=0
virtual RTWTransferFunction NewTransferFunction(const char *type)=0
virtual RTWData NewCopyData1D(const void *source, RTWDataType, size_t numItems)=0
virtual float RenderFrame(RTWFrameBuffer, RTWRenderer, RTWCamera, RTWWorld)=0
virtual void SetVec2f(RTWObject, const char *id, float x, float y)=0
virtual void Release(RTWObject)=0
virtual void SetVec3f(RTWObject, const char *id, float x, float y, float z)=0
virtual void Commit(RTWObject)=0
virtual RTWInstance NewInstance(RTWGroup geometry)=0
virtual void SetObject(RTWObject, const char *id, RTWObject other)=0
virtual void SetString(RTWObject, const char *id, const char *s)=0
virtual ~Backend()=default
virtual RTWGroup NewGroup()=0
virtual RTWVolumetricModel NewVolumetricModel(RTWVolume volume)=0
virtual RTWLight NewLight(const char *light_type)=0
virtual RTWMaterial NewMaterial(const char *renderer_type, const char *material_type)=0
virtual RTWGeometry NewGeometry(const char *type)=0
virtual void SetBool(RTWObject, const char *id, bool x)=0
virtual void SetVec3i(RTWObject, const char *id, int x, int y, int z)=0
virtual void SetObjectAsData(RTWObject target, const char *id, RTWDataType type, RTWObject obj)=0
virtual void FrameBufferClear(RTWFrameBuffer)=0
virtual void UnmapFrameBuffer(const void *mapped, RTWFrameBuffer)=0
virtual void RemoveParam(RTWObject, const char *id)=0
virtual int GetDepthTextureGL(RTWFrameBuffer frameBuffer)=0
virtual RTWWorld NewWorld()=0
virtual void SetVec4f(RTWObject, const char *id, float x, float y, float z, float w)=0
virtual RTWData NewSharedData1D(const void *source, RTWDataType, uint32_t numItems)=0
virtual RTWData NewSharedData3D(const void *source, RTWDataType, uint32_t numItems1, uint32_t numItems2, uint32_t numItems3)=0
Definition: Backend.h:6
@ type
Definition: vtkX3D.h:522
@ size
Definition: vtkX3D.h:259
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)