#include <volprogram.h>
Classes | |
| struct | CompileSettings |
| Simple structure holding compile settings. More... | |
Public Types | |
| enum | Mode { M_SLICE, M_3D_COLOR_CUBE, M_3D_RAYCAST } |
| The mode tells the program what is about to be rendered. More... | |
Public Member Functions | |
| VolProgram (const char *name) | |
| Loads the GLSL Program from the filesystem. | |
| ~VolProgram () | |
| void | SetMode (Mode mode) |
| Set the current mode. | |
| void | SetVolumeTexture (GLuint texture) |
| Set the volume texture to use. | |
| void | SetBackAndFrontTextures (GLuint back, GLuint front) |
| Set the front and back textures used when raycasting. | |
| void | SetTransferFunctionTexture (GLuint tex) |
| Set the texture representing the transfer function. | |
| void | Use () |
| Make this program the current OpenGL program. | |
Private Member Functions | |
| GLuint | CompileProgram (const char *name, const CompileSettings &settings) const |
| Compiles the GLSL program. | |
| void | RecompileWhenRequired () |
Private Attributes | |
| Mode | mode_ |
| bool | recompile_ |
| std::string | progname_ |
| Identifies the shaders to use by rellative_path/shader_filenames (without extension). | |
OpenGL generated id's | |
| GLuint | program_ |
| Program id obtained through 'glCreateProgram'. | |
| GLuint | volume_texture_ |
| Texture id of 3D Texture holding density data. | |
| GLuint | front_texture_ |
| Texture id of 2D Texture holding flattened 3D color cube for front faces. | |
| GLuint | back_texture_ |
| Texture id of 2D Texture holding flattened 3D color cube for back faces. | |
| GLuint | transfer_texture_ |
Definition at line 8 of file volprogram.h.
| enum VolProgram::Mode |
The mode tells the program what is about to be rendered.
| M_SLICE | Used when drawing slices. |
| M_3D_COLOR_CUBE | Used when drawing the bounding cube. |
| M_3D_RAYCAST | Used when doing raycasting. |
Definition at line 11 of file volprogram.h.
| VolProgram::VolProgram | ( | const char * | name | ) | [explicit] |
Loads the GLSL Program from the filesystem.
The GLSL program is stored on the filesystem. Vertex and fragment shaders are stored in separate files which are found by appending ".v_source" and ".f_source" respectively.
Definition at line 23 of file volprogram.cpp.
References RecompileWhenRequired().
| VolProgram::~VolProgram | ( | ) |
| GLuint VolProgram::CompileProgram | ( | const char * | name, | |
| const CompileSettings & | settings | |||
| ) | const [private] |
Compiles the GLSL program.
The GLSL program is stored on the filesystem. Vertex and fragment shaders are stored in separate files which are found by appending ".v_source" and ".f_source" respectively.
Definition at line 29 of file volprogram.cpp.
References VolProgram::CompileSettings::mode.
Referenced by RecompileWhenRequired().
| void VolProgram::RecompileWhenRequired | ( | ) | [private] |
Definition at line 136 of file volprogram.cpp.
References CompileProgram(), M_3D_COLOR_CUBE, M_3D_RAYCAST, M_SLICE, VolProgram::CompileSettings::mode, mode_, progname_, program_, and recompile_.
Referenced by Use(), and VolProgram().
| void VolProgram::SetBackAndFrontTextures | ( | GLuint | back, | |
| GLuint | front | |||
| ) |
Set the front and back textures used when raycasting.
Definition at line 119 of file volprogram.cpp.
References back_texture_, and front_texture_.
Referenced by VolumeCanvas::Render3dView().
| void VolProgram::SetMode | ( | Mode | mode | ) |
Set the current mode.
Definition at line 130 of file volprogram.cpp.
References mode_, and recompile_.
Referenced by VolumeCanvas::Render3dView(), and VolumeCanvas::RenderSliceView().
| void VolProgram::SetTransferFunctionTexture | ( | GLuint | tex | ) |
Set the texture representing the transfer function.
Definition at line 125 of file volprogram.cpp.
References transfer_texture_.
Referenced by VolumeCanvas::Render3dView(), and VolumeCanvas::RenderSliceView().
| void VolProgram::SetVolumeTexture | ( | GLuint | texture | ) |
Set the volume texture to use.
Definition at line 114 of file volprogram.cpp.
References volume_texture_.
Referenced by VolumeCanvas::Render3dView(), and VolumeCanvas::RenderSliceView().
| void VolProgram::Use | ( | ) |
Make this program the current OpenGL program.
Definition at line 159 of file volprogram.cpp.
References back_texture_, front_texture_, program_, RecompileWhenRequired(), transfer_texture_, and volume_texture_.
Referenced by VolumeCanvas::Render3dView(), and VolumeCanvas::RenderSliceView().
GLuint VolProgram::back_texture_ [private] |
Texture id of 2D Texture holding flattened 3D color cube for back faces.
Definition at line 62 of file volprogram.h.
Referenced by SetBackAndFrontTextures(), and Use().
GLuint VolProgram::front_texture_ [private] |
Texture id of 2D Texture holding flattened 3D color cube for front faces.
Definition at line 61 of file volprogram.h.
Referenced by SetBackAndFrontTextures(), and Use().
Mode VolProgram::mode_ [private] |
std::string VolProgram::progname_ [private] |
Identifies the shaders to use by rellative_path/shader_filenames (without extension).
Definition at line 68 of file volprogram.h.
Referenced by RecompileWhenRequired().
GLuint VolProgram::program_ [private] |
Program id obtained through 'glCreateProgram'.
Definition at line 59 of file volprogram.h.
Referenced by RecompileWhenRequired(), Use(), and ~VolProgram().
bool VolProgram::recompile_ [private] |
GLuint VolProgram::transfer_texture_ [private] |
Texture id of 1D Texture used by shader to mapping density values to color/opacity
Definition at line 63 of file volprogram.h.
Referenced by SetTransferFunctionTexture(), and Use().
GLuint VolProgram::volume_texture_ [private] |
Texture id of 3D Texture holding density data.
Definition at line 60 of file volprogram.h.
Referenced by SetVolumeTexture(), and Use().
1.5.7.1