-
Notifications
You must be signed in to change notification settings - Fork 5
/
volrenraycastcuda.h
45 lines (36 loc) · 1.12 KB
/
volrenraycastcuda.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef VOLRENRAYCASTCUDA_H
#define VOLRENRAYCASTCUDA_H
#include <volrenraycast.h>
#include <tfintegrated.h>
#include <volumeglcuda.h>
#include <QtOpenGL>
#include <cuda_runtime.h>
#include <cuda_gl_interop.h>
namespace yy {
namespace volren {
class VolRenRaycastCuda : public VolRenRaycast
{
public:
VolRenRaycastCuda();
static std::unique_ptr<VolRenRaycastCuda> create();
virtual ~VolRenRaycastCuda();
virtual void initializeGL();
virtual void resize(int w, int h);
virtual void setVolume(const std::shared_ptr<IVolume> &volume);
virtual void setColormap(const std::shared_ptr<IColormap>& colormap);
virtual std::shared_ptr<ImageAbstract> output() const;
protected:
virtual void raycast();
private:
void updateCUDAResources();
void updateCUDALights(const QMatrix4x4& matView);
protected:
std::shared_ptr<IVolumeCUDA> volume;
std::shared_ptr<IColormapCUDA> colormap;
GLuint outPBO;
cudaGraphicsResource *entryRes, *exitRes, *outRes;
int texWidth, texHeight;
};
} // namespace volren
} // namespace yy
#endif // VOLRENRAYCASTCUDA_H