Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
Management class for vtkShader XML descriptions. More...
#include <mitkVtkShaderRepository.h>
Classes | |
class | Shader |
Public Member Functions | |
VtkShaderRepository () | |
~VtkShaderRepository () | |
ShaderProgram::Pointer | CreateShaderProgram () override |
std::list< IShaderRepository::Shader::Pointer > | GetShaders () const override |
IShaderRepository::Shader::Pointer | GetShader (const std::string &name) const override |
Return the named shader. More... | |
IShaderRepository::Shader::Pointer | GetShader (int id) const override |
Return the shader identified by the given id. More... | |
void | AddDefaultProperties (mitk::DataNode *node, mitk::BaseRenderer *renderer, bool overwrite) const override |
Adds all parsed shader uniforms to property list of the given DataNode; used by mappers. More... | |
int | LoadShader (std::istream &stream, const std::string &name) override |
Applies shader and shader specific variables of the specified DataNode to the VTK object by updating the shader variables of its vtkProperty. More... | |
bool | UnloadShader (int id) override |
Unload a previously loaded shader. More... | |
void | UpdateShaderProgram (mitk::IShaderRepository::ShaderProgram *shaderProgram, DataNode *node, BaseRenderer *renderer) const override |
Applies shader and shader specific variables of the specified DataNode to the VTK object by updating the shader variables of its vtkProperty. More... | |
Public Member Functions inherited from mitk::IShaderRepository | |
virtual | ~IShaderRepository () |
Protected Member Functions | |
void | LoadShaders () |
Shader::Pointer | GetShaderImpl (const std::string &name) const |
Management class for vtkShader XML descriptions.
Looks for all XML shader files in a given directory and adds default properties for each shader object (shader uniforms) to the specified mitk::DataNode.
Additionally, it provides a utility function for applying properties for shaders in mappers.
Definition at line 39 of file mitkVtkShaderRepository.h.
mitk::VtkShaderRepository::VtkShaderRepository | ( | ) |
mitk::VtkShaderRepository::~VtkShaderRepository | ( | ) |
Destructor
Definition at line 53 of file mitkVtkShaderRepository.cpp.
|
overridevirtual |
Adds all parsed shader uniforms to property list of the given DataNode; used by mappers.
Implements mitk::IShaderRepository.
Definition at line 352 of file mitkVtkShaderRepository.cpp.
References mitk::DataNode::AddProperty(), mitk::IntProperty::New(), mitk::FloatProperty::New(), and mitk::ShaderProperty::New().
|
overridevirtual |
Implements mitk::IShaderRepository.
Definition at line 57 of file mitkVtkShaderRepository.cpp.
References mitk::New().
|
overridevirtual |
Return the named shader.
name | The shader name. |
Names might not be unique. Use the shader id to uniquely identify a shader.
Implements mitk::IShaderRepository.
Definition at line 457 of file mitkVtkShaderRepository.cpp.
|
overridevirtual |
Return the shader identified by the given id.
id | The shader id. |
Implements mitk::IShaderRepository.
Definition at line 467 of file mitkVtkShaderRepository.cpp.
|
protected |
Definition at line 96 of file mitkVtkShaderRepository.cpp.
|
overridevirtual |
Implements mitk::IShaderRepository.
Definition at line 447 of file mitkVtkShaderRepository.cpp.
|
overridevirtual |
Applies shader and shader specific variables of the specified DataNode to the VTK object by updating the shader variables of its vtkProperty.
Implements mitk::IShaderRepository.
Definition at line 111 of file mitkVtkShaderRepository.cpp.
References mitk::New(), and SR_INFO.
|
protected |
Definition at line 63 of file mitkVtkShaderRepository.cpp.
References filename, mitk::New(), and SR_INFO.
Referenced by VtkShaderRepository().
|
overridevirtual |
Unload a previously loaded shader.
id | The unique shader id returned by LoadShader. |
true
if the shader id was found and the shader was successfully unloaded, false
otherwise. Implements mitk::IShaderRepository.
Definition at line 122 of file mitkVtkShaderRepository.cpp.
|
overridevirtual |
Applies shader and shader specific variables of the specified DataNode to the VTK object by updating the shader variables of its vtkProperty.
Implements mitk::IShaderRepository.
Definition at line 477 of file mitkVtkShaderRepository.cpp.
References mitk::DataNode::GetFloatProperty(), mitk::DataNode::GetIntProperty(), mitk::DataNode::GetProperty(), mitk::BaseRenderer::GetRenderWindow(), mitk::VtkShaderProgram::GetShaderTimestampUpdate(), mitk::EnumerationProperty::GetValueAsString(), mitk::VtkShaderProgram::GetVtkShaderProgram(), mitk::New(), and mitk::VtkShaderProgram::SetVtkShaderProgram().