rts_glVolumeViewer.h
1.88 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef RTS_GLVOLUMEVIEWER_H
#define RTS_GLVOLUMEVIEWER_H
#include <windows.h>
#include <gl/glew.h>
#include <FL/glut.h>
#include <gl/gl.h>
//#include <gl/glxext.h>
#include <gl/glext.h>
#include <gl/wglext.h>
//#include <gl/wglext.h>
#include "rtsMath.h"
#include "rtsVolume.h"
#include "rts_glUtilities.h"
class rts_glVolumeViewer
{
private:
rtsVolume m_source;
GLuint m_volume_texture;
vector3D m_texture_size; //size of the volume being viewed (in voxels)
vector3D m_voxel_size;
bool m_optimize; //optimization flag (use more texture space for faster viz)
point3D m_p; //position of the volume (0,0,0) corner in space
vector3D m_dimensions;
double m_alpha_scale;
unsigned char m_min_threshold; //min and max thresholds to be displayed
unsigned char m_max_threshold;
unsigned int m_num_planes;
GLuint m_dl_planes; //planes display list
double m_inner_radius; //radius of the inscribed sphere
double m_outer_radius; //radius of the circumscribed sphere
void m_draw_plane(point3D p, vector3D n, vector3D u); //draws a camera-oriented plane at point with normal n
void m_load_texture();
public:
rts_glVolumeViewer();
//rts_glVolumeViewer(rtsVolume volume_data, point3D position);
rts_glVolumeViewer(rtsVolume volume_data,
point3D position,
vector3D voxel_size);
void SetSize(float x, float y, float z);
void SetVoxelSize(float x, float y, float z);
vector3D GetSize();
vector3D GetVoxelSize();
void RenderBoundingBox();
void RenderCameraSlice(point3D eye_point, vector3D camera_up, float slice_number = 0.0);
void RenderVolume(point3D eye_point, vector3D camera_up);
void SetAlphaScale(double scale){m_alpha_scale = scale;}
void SetNumPlanes(unsigned int planes);
void SetThreshold(unsigned char lower, unsigned char upper);
void Optimize(bool flag);
void Invert();
};
#endif