VTK  9.4.20241117
Backend.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
3#pragma once
4
5#include "Types.h"
6
7namespace RTW
8{
9VTK_ABI_NAMESPACE_BEGIN
10 class Backend
11 {
12 public:
13 virtual ~Backend() = default;
14
15 public:
16 virtual RTWError Init() = 0;
17 virtual void Shutdown() = 0;
18
19 virtual bool IsSupported(RTWFeature feature) const = 0;
20
21 virtual RTWData NewData(RTWDataType, size_t numItems) = 0;
22 virtual RTWData NewCopyData1D(const void *source, RTWDataType, size_t numItems) = 0;
23 virtual RTWData NewCopyData2D(const void *source, RTWDataType, size_t numItems1, size_t numItems2) = 0;
24 virtual RTWData NewCopyData3D(const void *source, RTWDataType, size_t numItems1, size_t numItems2, size_t numItems3) = 0;
25 virtual RTWData NewSharedData1D(const void *source, RTWDataType, uint32_t numItems) = 0;
26 virtual RTWData NewSharedData2D(const void *source, RTWDataType, uint32_t numItems1, uint32_t numItems2) = 0;
27 virtual RTWData NewSharedData3D(const void *source, RTWDataType, uint32_t numItems1, uint32_t numItems2,
28 uint32_t numItems3) = 0;
29 virtual RTWGeometry NewGeometry(const char *type) = 0;
30 virtual RTWGroup NewGroup() = 0;
31 virtual RTWTexture NewTexture(const char* type) = 0;
32 virtual RTWLight NewLight(const char *light_type) = 0;
33 virtual RTWMaterial NewMaterial(const char *material_type) = 0;
34 virtual RTWVolume NewVolume(const char *type) = 0;
36 virtual RTWTransferFunction NewTransferFunction(const char *type) = 0;
37 virtual RTWRenderer NewRenderer(const char *type) = 0;
38 virtual RTWCamera NewCamera(const char *type) = 0;
39 virtual RTWWorld NewWorld() = 0;
41 virtual RTWInstance NewInstance(RTWGroup geometry) = 0;
42 virtual RTWFrameBuffer NewFrameBuffer(const rtw::vec2i &size, const RTWFrameBufferFormat format, const uint32_t frameBufferChannels) = 0;
43
44 virtual void Release(RTWObject) = 0;
45
46
47 virtual void SetString(RTWObject, const char *id, const char *s) = 0;
48 virtual void SetObject(RTWObject, const char *id, RTWObject other) = 0;
49 virtual void SetObjectAsData(RTWObject target, const char *id, RTWDataType type, RTWObject obj) = 0;
50 virtual void SetParam(RTWObject, const char *id, RTWDataType type, const void* mem) = 0;
51 virtual void SetBool(RTWObject, const char *id, bool x) = 0;
52 virtual void SetBox1f(RTWObject, const char *id, float x, float y) = 0;
53 virtual void SetInt(RTWObject, const char *id, int32_t x) = 0;
54 virtual void SetUInt(RTWObject, const char *id, uint32_t x) = 0;
55 virtual void SetVec2i(RTWObject, const char *id, int32_t x, int32_t y) = 0;
56 virtual void SetFloat(RTWObject, const char *id, float x) = 0;
57 virtual void SetVec2f(RTWObject, const char *id, float x, float y) = 0;
58 virtual void SetVec3i(RTWObject, const char *id, int x, int y, int z) = 0;
59 virtual void SetVec3f(RTWObject, const char *id, float x, float y, float z) = 0;
60 virtual void SetVec4f(RTWObject, const char *id, float x, float y, float z, float w) = 0;
61 virtual void SetLinear2f(RTWObject, const char *id, float x, float y, float z, float w) = 0;
62
63 virtual void RemoveParam(RTWObject, const char *id) = 0;
64
65 virtual void Commit(RTWObject) = 0;
66
68
70 virtual const void* MapFrameBuffer(RTWFrameBuffer, const RTWFrameBufferChannel) = 0;
71 virtual void UnmapFrameBuffer(const void *mapped, RTWFrameBuffer) = 0;
72
73 virtual void SetDepthNormalizationGL(RTWFrameBuffer frameBuffer, float clipMin, float clipMax) = 0;
74 virtual int GetColorTextureGL(RTWFrameBuffer frameBuffer) = 0;
75 virtual int GetDepthTextureGL(RTWFrameBuffer frameBuffer) = 0;
76 };
77VTK_ABI_NAMESPACE_END
78}
struct RTWHandle * RTWData
Definition Types.h:238
struct RTWHandle * RTWCamera
Definition Types.h:232
RTWFrameBufferFormat
Definition Types.h:22
struct RTWHandle * RTWObject
Definition Types.h:245
struct RTWHandle * RTWTexture
Definition Types.h:244
struct RTWHandle * RTWTransferFunction
Definition Types.h:243
RTWFeature
Definition Types.h:250
struct RTWHandle * RTWFrameBuffer
Definition Types.h:229
struct RTWHandle * RTWGroup
Definition Types.h:233
struct RTWHandle * RTWGeometry
Definition Types.h:239
struct RTWHandle * RTWVolume
Definition Types.h:242
RTWError
Definition Types.h:11
struct RTWHandle * RTWVolumetricModel
Definition Types.h:236
RTWDataType
Definition Types.h:124
struct RTWHandle * RTWMaterial
Definition Types.h:240
struct RTWHandle * RTWRenderer
Definition Types.h:231
struct RTWHandle * RTWLight
Definition Types.h:241
struct RTWHandle * RTWInstance
Definition Types.h:234
RTWFrameBufferChannel
Definition Types.h:30
struct RTWHandle * RTWWorld
Definition Types.h:237
struct RTWHandle * RTWGeometricModel
Definition Types.h:235
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 RTWMaterial NewMaterial(const char *material_type)=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 void SetLinear2f(RTWObject, const char *id, float x, float y, float z, float w)=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 void SetBox1f(RTWObject, const char *id, float x, float y)=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 SetUInt(RTWObject, const char *id, uint32_t x)=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:8
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 *)