Kanzi 4.0.0-beta2
kanzi::RenderStatePropertyNotificationHandler Class Referenceabstract

Render value updater for render state. More...

#include <kanzi/core.ui/graphics2d/render_state_property_notification_handler.hpp>

Inheritance diagram for kanzi::RenderStatePropertyNotificationHandler:
[legend]

Public Member Functions

int getHandle () const
 Access handle.
 
bool isDirty () const
 Returns whether the container is dirty.
 
void setDirty (bool enabled)
 Sets the dirty flag state.
 
void update (GlRenderState &renderState, PropertyObject *object, Material &material)
 Update render state with new values acquirable from this.
 
- Public Member Functions inherited from kanzi::NodePropertyNotificationHandler
NodegetNode () const
 Access the node.
 
void invalidate ()
 Invalidates the state of the notification handler.
 
bool isValid () const
 Tell if this notification handler is valid.
 
- Public Member Functions inherited from kanzi::AbstractPropertyNotificationHandler
AbstractPropertyType getPropertyType () const
 Get the property type this handler is listening.
 

Protected Member Functions

ShaderProgram::UniformTransformation getTransformation () const
 Gets the uniform transformation.
 
void onPropertyChanged (PropertyNotificationReason) override
 AbstractPropertyNotificationHandler::onPropertyChanged() implementation.
 
 RenderStatePropertyNotificationHandler (AbstractPropertyType propertyType, Node *node)
 Constructor Has no handle.
 
 RenderStatePropertyNotificationHandler (AbstractPropertyType propertyType, Node *node, GlRenderState::HandleType handle, ShaderProgram::UniformTransformation transformation)
 Constructor.
 
virtual void updateOverride (GlRenderState &renderState, PropertyObject *object, Material &material)=0
 Perform type-specific update.
 
- Protected Member Functions inherited from kanzi::NodePropertyNotificationHandler
void attach ()
 Attach to node.
 
void detach ()
 Detach from node.
 
 NodePropertyNotificationHandler (AbstractPropertyType propertyType, Node *node)
 Constructor.
 
 NodePropertyNotificationHandler (NodePropertyNotificationHandler &&other) noexcept
 Move constructor.
 
NodePropertyNotificationHandleroperator= (NodePropertyNotificationHandler &&other) noexcept
 Move operator.
 
template<typename T >
void toggleNotificationHandler (bool add)
 
 ~NodePropertyNotificationHandler () override
 Destructor.
 
- Protected Member Functions inherited from kanzi::AbstractPropertyNotificationHandler
 AbstractPropertyNotificationHandler ()=default
 Default constructor.
 
 AbstractPropertyNotificationHandler (AbstractPropertyNotificationHandler &&other) noexcept
 Move constructor.
 
 AbstractPropertyNotificationHandler (AbstractPropertyType propertyType)
 Constructor.
 
 AbstractPropertyNotificationHandler (const AbstractPropertyNotificationHandler &)=delete
 Deleted copy constructor.
 
AbstractPropertyNotificationHandleroperator= (AbstractPropertyNotificationHandler &&other) noexcept
 Move operator.
 
AbstractPropertyNotificationHandleroperator= (const AbstractPropertyNotificationHandler &)=delete
 Deleted copy operator.
 
virtual ~AbstractPropertyNotificationHandler ()
 Destructor.
 

Protected Attributes

bool m_dirty
 Indicates whether this property is dirty and needs updating.
 
GlRenderState::HandleType m_handle
 Handle into the render state.
 
ShaderProgram::UniformTransformation m_transformation
 Shader transformation.
 
- Protected Attributes inherited from kanzi::NodePropertyNotificationHandler
Nodem_node
 Node attached to.
 

Additional Inherited Members

- Static Protected Member Functions inherited from kanzi::NodePropertyNotificationHandler
template<typename T >
static void notificationHandler (PropertyObject &, const typename PropertyType< T >::Traits::StorageType &, PropertyNotificationReason reason, void *data)
 Notification handler function.
 

Detailed Description

Render value updater for render state.

This is an abstract class that is inherited and specialized by property value type.

Constructor & Destructor Documentation

◆ RenderStatePropertyNotificationHandler() [1/2]

kanzi::RenderStatePropertyNotificationHandler::RenderStatePropertyNotificationHandler ( AbstractPropertyType propertyType,
Node * node )
inlineexplicitprotected

Constructor Has no handle.

Should only used for blend mode.

Parameters
propertyTypeProperty type to listen on.
nodeNode to listen for changes on.

◆ RenderStatePropertyNotificationHandler() [2/2]

kanzi::RenderStatePropertyNotificationHandler::RenderStatePropertyNotificationHandler ( AbstractPropertyType propertyType,
Node * node,
GlRenderState::HandleType handle,
ShaderProgram::UniformTransformation transformation )
inlineexplicitprotected

Constructor.

Parameters
propertyTypeProperty type to listen on.
nodeNode to listen for changes on.
handleHandle into the render state.
transformationUniform transformation.

Member Function Documentation

◆ update()

void kanzi::RenderStatePropertyNotificationHandler::update ( GlRenderState & renderState,
PropertyObject * object,
Material & material )

Update render state with new values acquirable from this.

Do not update if dirty flag has not been set (property is not marked as dirty).

Parameters
renderStateRender state to update.
objectFallback object for property value. Can be 0.
materialFallback material for property value.
Since
Kanzi 3.9.1 data type of object parameter changed from Object* to PropertyObject*.

◆ getHandle()

int kanzi::RenderStatePropertyNotificationHandler::getHandle ( ) const
inline

Access handle.

Returns
Handle.

◆ isDirty()

bool kanzi::RenderStatePropertyNotificationHandler::isDirty ( ) const
inline

Returns whether the container is dirty.

Returns
If the container is dirty, true, otherwise false.
Since
Kanzi 3.9.7

◆ setDirty()

void kanzi::RenderStatePropertyNotificationHandler::setDirty ( bool enabled)
inline

Sets the dirty flag state.

Parameters
enabledThe state of the dirty flag.

◆ getTransformation()

ShaderProgram::UniformTransformation kanzi::RenderStatePropertyNotificationHandler::getTransformation ( ) const
inlineprotected

Gets the uniform transformation.

Returns
Uniform transformation for the render value.
Since
Kanzi 3.9.7 moved from RenderValuePropertyNotificationHandlerBase.

◆ updateOverride()

virtual void kanzi::RenderStatePropertyNotificationHandler::updateOverride ( GlRenderState & renderState,
PropertyObject * object,
Material & material )
protectedpure virtual

Perform type-specific update.

Parameters
renderStateRender state to update.
objectFallback object for property value, may be 0 for no object.
materialFallback material for property value.
Since
Kanzi 3.9.1 data type of object parameter changed from Object* to PropertyObject*.

Implemented in kanzi::TypedRenderStatePropertyNotificationHandler< T >, kanzi::BlendModeRenderStatePropertyNotificationHandler, and kanzi::TypedRenderStateRangePropertyNotificationHandler< T >.

◆ onPropertyChanged()

void kanzi::RenderStatePropertyNotificationHandler::onPropertyChanged ( PropertyNotificationReason )
overrideprotectedvirtual

Member Data Documentation

◆ m_handle

GlRenderState::HandleType kanzi::RenderStatePropertyNotificationHandler::m_handle
protected

Handle into the render state.

◆ m_transformation

ShaderProgram::UniformTransformation kanzi::RenderStatePropertyNotificationHandler::m_transformation
protected

Shader transformation.

◆ m_dirty

bool kanzi::RenderStatePropertyNotificationHandler::m_dirty
protected

Indicates whether this property is dirty and needs updating.


The documentation for this class was generated from the following file: