Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitk::IShaderRepository Struct Referenceabstract

Management class for vtkShader XML descriptions. More...

#include <mitkIShaderRepository.h>

Inheritance diagram for mitk::IShaderRepository:

Classes

class  Shader
 
class  ShaderProgram
 

Public Member Functions

virtual ~IShaderRepository ()
 
virtual std::list< Shader::PointerGetShaders () const =0
 
virtual Shader::Pointer GetShader (const std::string &name) const =0
 Return the named shader. More...
 
virtual ShaderProgram::Pointer CreateShaderProgram ()=0
 
virtual Shader::Pointer GetShader (int id) const =0
 Return the shader identified by the given id. More...
 
virtual void AddDefaultProperties (mitk::DataNode *node, mitk::BaseRenderer *renderer, bool overwrite) const =0
 Adds all parsed shader uniforms to property list of the given DataNode; used by mappers. More...
 
virtual void UpdateShaderProgram (mitk::IShaderRepository::ShaderProgram *shaderProgram, mitk::DataNode *node, mitk::BaseRenderer *renderer) const =0
 Applies shader and shader specific variables of the specified DataNode to the VTK object by updating the shader variables of its vtkProperty. More...
 
virtual int LoadShader (std::istream &stream, const std::string &name)=0
 Loads a shader from a given file. Make sure that this stream is in the XML shader format. More...
 
virtual bool UnloadShader (int id)=0
 Unload a previously loaded shader. More...
 

Detailed Description

Management class for vtkShader XML descriptions.

Loads XML shader files from std::istream objects 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 45 of file mitkIShaderRepository.h.

Constructor & Destructor Documentation

mitk::IShaderRepository::~IShaderRepository ( )
virtual

Definition at line 21 of file mitkIShaderRepository.cpp.

Member Function Documentation

virtual void mitk::IShaderRepository::AddDefaultProperties ( mitk::DataNode node,
mitk::BaseRenderer renderer,
bool  overwrite 
) const
pure virtual

Adds all parsed shader uniforms to property list of the given DataNode; used by mappers.

Implemented in mitk::VtkShaderRepository.

Referenced by mitk::FiberBundleMapper2D::SetDefaultProperties(), and mitk::SurfaceVtkMapper3D::SetDefaultPropertiesForVtkProperty().

virtual ShaderProgram::Pointer mitk::IShaderRepository::CreateShaderProgram ( )
pure virtual
virtual Shader::Pointer mitk::IShaderRepository::GetShader ( const std::string &  name) const
pure virtual

Return the named shader.

Parameters
nameThe shader name.
Returns
A Shader object.

Names might not be unique. Use the shader id to uniquely identify a shader.

Implemented in mitk::VtkShaderRepository.

virtual Shader::Pointer mitk::IShaderRepository::GetShader ( int  id) const
pure virtual

Return the shader identified by the given id.

Parameters
idThe shader id.
Returns
The shader object or null if the id is unknown.

Implemented in mitk::VtkShaderRepository.

virtual std::list<Shader::Pointer> mitk::IShaderRepository::GetShaders ( ) const
pure virtual
virtual int mitk::IShaderRepository::LoadShader ( std::istream &  stream,
const std::string &  name 
)
pure virtual

Loads a shader from a given file. Make sure that this stream is in the XML shader format.

Returns
A unique id for the loaded shader which can be used to unload it.

Implemented in mitk::VtkShaderRepository.

virtual bool mitk::IShaderRepository::UnloadShader ( int  id)
pure virtual

Unload a previously loaded shader.

Parameters
idThe unique shader id returned by LoadShader.
Returns
true if the shader id was found and the shader was successfully unloaded, false otherwise.

Implemented in mitk::VtkShaderRepository.

virtual void mitk::IShaderRepository::UpdateShaderProgram ( mitk::IShaderRepository::ShaderProgram shaderProgram,
mitk::DataNode node,
mitk::BaseRenderer renderer 
) const
pure virtual

Applies shader and shader specific variables of the specified DataNode to the VTK object by updating the shader variables of its vtkProperty.

Implemented in mitk::VtkShaderRepository.

Referenced by mitk::VtkMapper::ApplyShaderProperties().


The documentation for this struct was generated from the following files: