#include <Renderer.h>
Public Member Functions | |
Renderer () | |
one must not directly instantiate the Renderer, VolumeRendering will provide an instance | |
~Renderer () | |
bool | loadVolume (const std::string &) |
loads a Volume from the given filename and sets it as active to be rendered | |
void | setTransferFunction (TransferFunction &) |
sets a Transferfunction to be used by the rendering | |
void | setAnimate (bool) |
toggles between animated or still image rendering (animated is default) | |
void | switchRenderMode (int) |
toggles between rendermode: 0 means Slicing-Rendering, 1 means Volume-Rendering | |
void | switchAxis (int) |
selects the axis to be manipulated: 0 = x, 1 = y, 2 = z | |
void | setAxisCoord (float) |
changes the axis coordinate | |
void | initGL () |
is being called to initalize the Renderer. MUST NOT BE CALLED, is done by RenderWindow | |
void | resizeGL (int, int) |
is being called to to resize the Viewport. MUST NOT BE CALLED, is done by RenderWindow | |
void | paintGL () |
is being called regulary to keep up the Rendering-Loop. MUST NOT BE CALLED, is done by RenderWindow | |
void | animate () |
is being called to process animation-steps when animation is active. MUST NOT BE CALLED, is done by RenderWindow | |
void | setSampleDist (float) |
sets the sample distance | |
void | setUseTf (bool) |
toggles between use of transferfunction or not | |
Private Member Functions | |
void | createFBO (GLuint *, GLuint *) |
creates a FBO and stores the IDs of the FBO and the Texture in the given params | |
void | renderVolumeBox () |
renders the Colorcube in the active bound FBO | |
void | renderSlicing () |
renders one frame of the Slicing-Rendering | |
void | renderVolume () |
renders one frame of the Volume-Rendering | |
void | animateSlicing () |
calculates the animation for the Slicing-Rendering | |
void | animateVolume () |
calculates the animation for the Volume-Rendering | |
void | checkGLFeatures () |
checks if all OpenGL features are present on this hardware neede to to Volume-Rendering as implemented hiere | |
Static Private Member Functions | |
static GLuint | createProgram (const std::string &, const std::string &) |
creates a Shader-Program out of two given files: the vertexprogram and the fragmentprogram | |
static GLint | queryUniformLoc (GLint, const GLchar *) |
queries and returns uniform locations | |
static bool | readShaderSource (const std::string &, std::string &) |
reads text from a file to load shader sourcefiles | |
Private Attributes | |
Volume * | volume |
the active volume instance, 0 when nothing loaded | |
bool | animationFlag |
true when animation is activated, false otherwise | |
int | renderMode |
0 for Slicing-Rendering, 1 for Volume-Rendering | |
float | rotationAngles [3] |
stores the rotation angles of each axes | |
int | axisIndex |
the index of the axis which is about to be changed (either through animation or manually through setAxisCoord) | |
float | axisCoord |
stores the axisCoord during Slicing-Rendering between 0 and 1 (which in fact maps directly to the 3D texturecoordinate of the selected Axis: axisIndex) | |
bool | increaseSlice |
true when the axisCoord should be increased during animation, false when it should be decreased during animatino | |
float | sampleDist |
the sampledistance between each point of the volume shader | |
bool | useTransferfunction |
a flag wheter to use a transferfunction or not | |
double | loopFactor |
the factor how long the last rendering step took | |
GLuint | width |
width of the viewport | |
GLuint | height |
height of the viewport | |
GLuint | transferTexture |
OpenGL-ID of the Transferfunction-Texture. | |
GLuint | volumeTexture |
OpenGL-ID of the Volume-Texture. | |
GLuint | frontTexture |
OpenGL-ID of the Frontfaces-Texture (rendered by using FBO). | |
GLuint | backTexture |
OpenGL-ID of the Backfaces-Texture (rendered by using FBO). | |
GLuint | frontFBO |
OpenGL-ID of the Frontfaces-Rendering FBO. | |
GLuint | backFBO |
OpenGL-ID of the Backfaces-Rendering FBO. | |
GLuint | slicingProgram |
OpenGL-ID of the Shaderprogram used for Slicing-Rendering. | |
GLuint | volumeProgram |
OpenGL-ID of the Shaderprogram used for Volume-Rendering. | |
GLuint | slicingProgramMit |
GLuint | volumeProgramMit |
GLint | volumeSlicingTextureLocation |
OpenGL-ID of the uniform location of the Volume-Texture in the Slicing-Rendering Shader. | |
GLint | volumeSlicingTransferLocation |
OpenGL-ID of the uniform location of the Transferfunction-Texture in the Slicing-Rendering Shader. | |
GLint | transferTextureLocation |
OpenGL-ID of the uniform location of the Transferfunction-Texture in the Volume-Rendering Shader. | |
GLint | volumeTextureLocation |
OpenGL-ID of the uniform location of the Volume-Texture in the Volume-Rendering Shader. | |
GLint | frontTextureLocation |
OpenGL-ID of the uniform location of the Frontfaces-Texture in the Volume-Rendering Shader. | |
GLint | backTextureLocation |
OpenGL-ID of the uniform location of the Backfaces-Texture in the Volume-Rendering Shader. | |
GLint | lightVecLocation |
OpenGL-ID of the uniform location of the Lightdirection in the Volume-Rendering Shader. | |
GLint | sampleDistLocation |
OpenGL-ID of the uniform location of the SampleDirection in the Volume-Rendering Shader. | |
GLint | volumeSlicingTextureLocationMit |
OpenGL-ID of the uniform location of the Volume-Texture in the MIT Slicing-Rendering Shader. | |
GLint | transferTextureLocationMit |
OpenGL-ID of the uniform location of the Transferfunction-Texture in the MIT Slicing-Rendering Shader. | |
GLint | volumeTextureLocationMit |
OpenGL-ID of the uniform location of the Volume-Texture in the MIT Volume-Rendering Shader. | |
GLint | frontTextureLocationMit |
OpenGL-ID of the uniform location of the Frontfaces-Texture in the MIT Volume-Rendering Shader. | |
GLint | backTextureLocationMit |
OpenGL-ID of the uniform location of the Backfaces-Texture in the MIT Volume-Rendering Shader. | |
GLint | sampleDistLocationMit |
OpenGL-ID of the uniform location of the SampleDirection in the MIT Volume-Rendering Shader. | |
Classes | |
class | TFPoint |
class | TransferFunction |
Renderer::Renderer | ( | ) |
one must not directly instantiate the Renderer, VolumeRendering will provide an instance
Renderer::~Renderer | ( | ) |
bool Renderer::loadVolume | ( | const std::string & | fileName | ) |
loads a Volume from the given filename and sets it as active to be rendered
void Renderer::setTransferFunction | ( | TransferFunction & | tf | ) |
sets a Transferfunction to be used by the rendering
void Renderer::setAnimate | ( | bool | flag | ) |
toggles between animated or still image rendering (animated is default)
void Renderer::switchRenderMode | ( | int | mode | ) |
toggles between rendermode: 0 means Slicing-Rendering, 1 means Volume-Rendering
void Renderer::switchAxis | ( | int | axis | ) |
selects the axis to be manipulated: 0 = x, 1 = y, 2 = z
void Renderer::setAxisCoord | ( | float | coord | ) |
changes the axis coordinate
void Renderer::initGL | ( | ) |
is being called to initalize the Renderer. MUST NOT BE CALLED, is done by RenderWindow
void Renderer::resizeGL | ( | int | w, | |
int | h | |||
) |
is being called to to resize the Viewport. MUST NOT BE CALLED, is done by RenderWindow
void Renderer::paintGL | ( | ) |
is being called regulary to keep up the Rendering-Loop. MUST NOT BE CALLED, is done by RenderWindow
void Renderer::animate | ( | ) |
is being called to process animation-steps when animation is active. MUST NOT BE CALLED, is done by RenderWindow
void Renderer::setSampleDist | ( | float | in_sampleDist | ) |
sets the sample distance
void Renderer::setUseTf | ( | bool | useTf | ) |
toggles between use of transferfunction or not
void Renderer::createFBO | ( | GLuint * | texID, | |
GLuint * | fboID | |||
) | [private] |
creates a FBO and stores the IDs of the FBO and the Texture in the given params
void Renderer::renderVolumeBox | ( | ) | [private] |
renders the Colorcube in the active bound FBO
void Renderer::renderSlicing | ( | ) | [private] |
renders one frame of the Slicing-Rendering
void Renderer::renderVolume | ( | ) | [private] |
renders one frame of the Volume-Rendering
void Renderer::animateSlicing | ( | ) | [private] |
calculates the animation for the Slicing-Rendering
void Renderer::animateVolume | ( | ) | [private] |
calculates the animation for the Volume-Rendering
void Renderer::checkGLFeatures | ( | ) | [private] |
checks if all OpenGL features are present on this hardware neede to to Volume-Rendering as implemented hiere
static GLuint Renderer::createProgram | ( | const std::string & | , | |
const std::string & | ||||
) | [static, private] |
creates a Shader-Program out of two given files: the vertexprogram and the fragmentprogram
GLint Renderer::queryUniformLoc | ( | GLint | prog, | |
const GLchar * | name | |||
) | [static, private] |
queries and returns uniform locations
static bool Renderer::readShaderSource | ( | const std::string & | , | |
std::string & | ||||
) | [static, private] |
reads text from a file to load shader sourcefiles
Volume* Renderer::volume [private] |
the active volume instance, 0 when nothing loaded
bool Renderer::animationFlag [private] |
true when animation is activated, false otherwise
int Renderer::renderMode [private] |
0 for Slicing-Rendering, 1 for Volume-Rendering
float Renderer::rotationAngles[3] [private] |
stores the rotation angles of each axes
int Renderer::axisIndex [private] |
the index of the axis which is about to be changed (either through animation or manually through setAxisCoord)
float Renderer::axisCoord [private] |
stores the axisCoord during Slicing-Rendering between 0 and 1 (which in fact maps directly to the 3D texturecoordinate of the selected Axis: axisIndex)
bool Renderer::increaseSlice [private] |
true when the axisCoord should be increased during animation, false when it should be decreased during animatino
float Renderer::sampleDist [private] |
the sampledistance between each point of the volume shader
bool Renderer::useTransferfunction [private] |
a flag wheter to use a transferfunction or not
double Renderer::loopFactor [private] |
the factor how long the last rendering step took
GLuint Renderer::width [private] |
width of the viewport
GLuint Renderer::height [private] |
height of the viewport
GLuint Renderer::transferTexture [private] |
OpenGL-ID of the Transferfunction-Texture.
GLuint Renderer::volumeTexture [private] |
OpenGL-ID of the Volume-Texture.
GLuint Renderer::frontTexture [private] |
OpenGL-ID of the Frontfaces-Texture (rendered by using FBO).
GLuint Renderer::backTexture [private] |
OpenGL-ID of the Backfaces-Texture (rendered by using FBO).
GLuint Renderer::frontFBO [private] |
OpenGL-ID of the Frontfaces-Rendering FBO.
GLuint Renderer::backFBO [private] |
OpenGL-ID of the Backfaces-Rendering FBO.
GLuint Renderer::slicingProgram [private] |
OpenGL-ID of the Shaderprogram used for Slicing-Rendering.
GLuint Renderer::volumeProgram [private] |
OpenGL-ID of the Shaderprogram used for Volume-Rendering.
GLuint Renderer::slicingProgramMit [private] |
GLuint Renderer::volumeProgramMit [private] |
GLint Renderer::volumeSlicingTextureLocation [private] |
OpenGL-ID of the uniform location of the Volume-Texture in the Slicing-Rendering Shader.
GLint Renderer::volumeSlicingTransferLocation [private] |
OpenGL-ID of the uniform location of the Transferfunction-Texture in the Slicing-Rendering Shader.
GLint Renderer::transferTextureLocation [private] |
OpenGL-ID of the uniform location of the Transferfunction-Texture in the Volume-Rendering Shader.
GLint Renderer::volumeTextureLocation [private] |
OpenGL-ID of the uniform location of the Volume-Texture in the Volume-Rendering Shader.
GLint Renderer::frontTextureLocation [private] |
OpenGL-ID of the uniform location of the Frontfaces-Texture in the Volume-Rendering Shader.
GLint Renderer::backTextureLocation [private] |
OpenGL-ID of the uniform location of the Backfaces-Texture in the Volume-Rendering Shader.
GLint Renderer::lightVecLocation [private] |
OpenGL-ID of the uniform location of the Lightdirection in the Volume-Rendering Shader.
GLint Renderer::sampleDistLocation [private] |
OpenGL-ID of the uniform location of the SampleDirection in the Volume-Rendering Shader.
GLint Renderer::volumeSlicingTextureLocationMit [private] |
OpenGL-ID of the uniform location of the Volume-Texture in the MIT Slicing-Rendering Shader.
GLint Renderer::transferTextureLocationMit [private] |
OpenGL-ID of the uniform location of the Transferfunction-Texture in the MIT Slicing-Rendering Shader.
GLint Renderer::volumeTextureLocationMit [private] |
OpenGL-ID of the uniform location of the Volume-Texture in the MIT Volume-Rendering Shader.
GLint Renderer::frontTextureLocationMit [private] |
OpenGL-ID of the uniform location of the Frontfaces-Texture in the MIT Volume-Rendering Shader.
GLint Renderer::backTextureLocationMit [private] |
OpenGL-ID of the uniform location of the Backfaces-Texture in the MIT Volume-Rendering Shader.
GLint Renderer::sampleDistLocationMit [private] |
OpenGL-ID of the uniform location of the SampleDirection in the MIT Volume-Rendering Shader.