Workspace 6.21.5
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
TypedShader< Derived > Class Template Referenceabstract

Template shader class that manages the mapping between a shader type and the its renderer-specific implementations. More...

#include <Rendering/SceneComponents/Shaders/typedshader.h>

Inheritance diagram for TypedShader< Derived >:
[legend]

Public Member Functions

 ~TypedShader () override=default
 
- Public Member Functions inherited from Shader
 ~Shader () override
 
bool activate (SceneRenderer &renderer)
 Activates the shader on the target WSGLRenderer in preparation for drawing an object.
 
virtual bool appliesScreenSpaceAmbientOcclusion ()
 
virtual bool appliesSpecular ()
 
virtual bool appliesTransparency () const =0
 
Shaderclone () const override=0
 
bool deactivate (SceneRenderer &renderer)
 Deactivates the shader on the target WSGLRenderer, setting it back to the state it was in before the shader was bound.
 
int getId () const
 
Mesh::MeshModelSource::MeshModelInterfaceLockedPtr getMeshModelInterface (const QString &modelId, Mesh::MeshModelLibrary &modelLib)
 
bool getModelSourceUpdateRequested () const
 
bool getOptimizeOutInternalVolumeElements () const
 
double getSegmentLineWidth () const
 
virtual TexturizergetTexturizer ()
 
virtual const TexturizergetTexturizer () const
 
bool renderCurrentModel (SceneRenderer &renderer)
 Renders the model currently being processed by the specified renderer.s.
 
bool renderCurrentModelGlyphs (SceneRenderer &renderer)
 
void setOptimizeOutInternalVolumeElements (bool val)
 
void setSegmentLineWidth (double width)
 
- Public Member Functions inherited from Clonable
virtual ~Clonable ()=default
 
virtual Clonableclone () const =0
 

Static Public Member Functions

static void registerImplementation (const SceneRendererTypeId &rendererId, const ShaderImplementationFactory &factory)
 

Protected Member Functions

 TypedShader ()
 
 TypedShader (const TypedShader &shader)
 
TypedShaderclone () const override=0
 
- Protected Member Functions inherited from Shader
 Shader ()
 
 Shader (const Shader &shader)
 
void addImplementation (const SceneRendererContext &context, ShaderImplementation &impl)
 
void setId (int id)
 

Detailed Description

template<typename Derived>
class CSIRO::Rendering::TypedShader< Derived >

Each TypedShader provides a function to register a given ShaderImplementation type as the implementation of this shader for a specific renderer. It is recommended that all shader types derive from this class.

Template Parameters
DerivedThe specific typedshader derived class. This class will contain the members required by all implementations of the shader.

Constructor & Destructor Documentation

◆ TypedShader() [1/2]

TypedShader ( )
inlineprotected

◆ TypedShader() [2/2]

TypedShader ( const TypedShader< Derived > &  shader)
inlineprotected

◆ ~TypedShader()

~TypedShader ( )
overridedefault

Member Function Documentation

◆ clone()

TypedShader * clone ( ) const
overrideprotectedpure virtual
Returns
A clone of this object.
Note
Subclasses would normally return their own type rather than the Clonable type. The C++ language rules allow a more derived type to be returned from a virtual function and the compiler will still treat it as a valid override.

Implements Shader.

Implemented in BillboardImageShader, BlinnPhongShader, ColorStateShader, DepthShader, ElementColoringShader, HighlightElementShader, HighlightNodeShader, LambertShader, LineOfSightShader, NodeColoringShader, NormalShader, OctreeShader, SymbolShader, TextureCoordShader, TextureProjectionShader, and VolumeShader.

◆ registerImplementation()

void registerImplementation ( const SceneRendererTypeId rendererId,
const ShaderImplementationFactory factory 
)
static

Registers the specific implementation factory with the target renderer type; meaning that whenever this renderer activates the shader, a ShaderImplementation of the type generated by the factory will be used.

Parameters
rendererIdThe type id of the renderer that this implementation will be used for.
factoryThe factory that will be used to create implementations for the target renderer if / when needed.