All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
kanzi::MaterialBrush Class Reference

Freeform shader brush. More...

#include <kanzi/graphics_2d/material_brush.hpp>

Inheritance diagram for kanzi::MaterialBrush:
kanzi::Brush kanzi::Object

Public Member Functions

virtual BrushSharedPtr clone () KZ_OVERRIDE
 Brush::clone() implementation. More...
 
virtual BrushRendererSharedPtr createBrushRenderer (Node *node) KZ_OVERRIDE
 Brush::createBrushRenderer() implementation. More...
 
virtual void load (ResourceManager *resourceManager) KZ_OVERRIDE
 Brush::load() implementation. More...
 
MaterialSharedPtr getMaterial () const
 Get current material. More...
 
- Public Member Functions inherited from kanzi::Brush
unsigned int getPropertyChangeCounter () const
 Access property change counter. More...
 
void updatePropertyChangeCounter ()
 Update property change counter. More...
 
TextureSharedPtr getContentTexture () const
 Access content texture. More...
 
void setContentTexture (TextureSharedPtr texture)
 Set content texture. More...
 
string getName () const
 Get name of this brush. More...
 
void setName (string_view name)
 Set name of this brush. More...
 
Vector2 getTiling () const
 Get tiling vector. More...
 
bool isRenderable () const
 Tell whether or not the brush needs rendering. More...
 
bool isOpaque () const
 Tell if the brush is opaque. More...
 
ColorRGBA getModulateColor () const
 Gets the value of ModulateColorProperty. More...
 
void setModulateColor (ColorRGBA value)
 Sets the value of ModulateColorProperty. More...
 
float getHorizontalTiling () const
 Gets the value of HorizontalTilingProperty. More...
 
void setHorizontalTiling (float value)
 Sets the value of HorizontalTilingProperty. More...
 
float getVerticalTiling () const
 Gets the value of VerticalTilingProperty. More...
 
void setVerticalTiling (float value)
 Sets the value of VerticalTilingProperty. More...
 
- Public Member Functions inherited from kanzi::Object
 Object (Domain *domain)
 
virtual ~Object ()
 
DomaingetDomain () const
 Returns the domain the object belongs to. More...
 
KzuPropertyManager * getPropertyManager () const
 Returns the property manager of the object. More...
 
KzuTaskSchedulergetTaskScheduler () const
 Returns the task scheduler of the object. More...
 
KzuMessageDispatchergetMessageDispatcher () const
 Returns the message dispatcher of the object. More...
 
ResourceManagergetResourceManager () const
 Returns the resource manager of the object. More...
 
virtual const MetaclassgetDynamicMetaclass () const
 Returns the metaclass of the dynamic type of the object. More...
 
bool isTypeOf (const Metaclass *objectType) const
 Determines if the type of this object is the given type or derived from it. More...
 
template<typename DataType >
void setProperty (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::DataType value)
 Sets the local value of a property. More...
 
void setProperty (const PropertyType< ResourceID > &propertyType, ResourceSharedPtr value)
 Sets the local value of a resource id property with a resource pointer. More...
 
template<typename DataType >
DataType getProperty (const PropertyType< DataType > &propertyType) const
 Returns the current value of a property. More...
 
template<typename DataType >
bool getProperty (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::DataType &value) const
 Evaluates the property value in the same way as the overload above but does not default to the value in property metadata if there are no inputs to the property value. More...
 
template<typename DataType >
void setAbstractProperty (AbstractPropertyType abstractPropertyType, typename PropertyType< DataType >::DataType value)
 
void setAbstractProperty (AbstractPropertyType abstractPropertyType, ResourceSharedPtr value)
 
template<typename DataType >
DataType getAbstractProperty (AbstractPropertyType abstractPropertyType) const
 
template<typename DataType >
bool getAbstractProperty (AbstractPropertyType abstractPropertyType, typename PropertyType< DataType >::DataType &value) const
 
bool hasValue (AbstractPropertyType propertyType) const
 Evaluates whether there are any inputs into the property value. More...
 
bool hasLocalValue (AbstractPropertyType propertyType) const
 Evaluates whether there is a local value set for the property. More...
 
void removeLocalValue (AbstractPropertyType propertyType)
 Removes the local value associated with the property. More...
 
void copyLocalValues (const Object &other)
 Copies all local values from another object. More...
 
AppliedStyleEntryapplyObjectStyle (kanzi::StyleSharedPtr style)
 Applies a style to an object. More...
 
void unapplyObjectStyle (AppliedStyleEntry *appliedStyleEntry)
 
void applyObjectStyles ()
 Apply all styles for an object node. More...
 
void unapplyObjectStyles ()
 Unapplies and removes all applied styles. More...
 

Static Public Member Functions

static MaterialBrushSharedPtr create (Domain *domain, string_view name)
 Create a new shader brush. More...
 
static MaterialBrushSharedPtr create (Domain *domain, string_view name, MaterialSharedPtr material)
 Create a new shader brush. More...
 
- Static Public Member Functions inherited from kanzi::Brush
static
PropertyTypeEditorInfoSharedPtr 
makeEditorInfo ()
 
- Static Public Member Functions inherited from kanzi::Object
static const MetaclassgetStaticMetaclass ()
 Returns the metaclass of Object class. More...
 
static
PropertyTypeEditorInfoSharedPtr 
makeEditorInfo ()
 Default implementation that returns empty editor info. More...
 

Protected Member Functions

 MaterialBrush (Domain *domain, string_view name)
 Constructor. More...
 
 MaterialBrush (Domain *domain, string_view name, MaterialSharedPtr material)
 Constructor. More...
 
virtual void onPropertyChanged (AbstractPropertyType propertyType, KzuPropertyNotificationReason reason) KZ_OVERRIDE
 Object::onPropertyChanged() implementation. More...
 
void acquireMaterialResource (ResourceManager *resourceManager)
 Refresh material. More...
 
void calculateRenderingProperties ()
 Recalculate rendering properties. More...
 
- Protected Member Functions inherited from kanzi::Brush
 Brush (Domain *domain, string_view name)
 Constructor. More...
 
virtual ~Brush ()
 Destructor. More...
 
void setRenderable (bool renderable)
 Set renderable status. More...
 
void setOpaque (bool opaque)
 Set opaqueness status. More...
 
- Protected Member Functions inherited from kanzi::Object
void initialize ()
 
void onCopy (const Object &other)
 

Properties

static PropertyType< ResourceIDMaterialProperty
 Material property. More...
 
ResourceID getMaterialResourceID () const
 Gets the value of MaterialProperty. More...
 
void setMaterialResourceID (ResourceID value)
 Sets the value of MaterialProperty. More...
 

Additional Inherited Members

- Static Public Attributes inherited from kanzi::Brush
static PropertyType< ColorRGBAModulateColorProperty
 ModulateColor property. More...
 
static PropertyType< float > HorizontalTilingProperty
 HorizontalTiling property. More...
 
static PropertyType< float > VerticalTilingProperty
 VerticalTiling property. More...
 
- Protected Types inherited from kanzi::Object
typedef vector
< AppliedStyleEntry * > 
AppliedStyleContainer
 Applied style container. More...
 
- Protected Attributes inherited from kanzi::Object
AppliedStyleContainer m_appliedStyles
 Listing of applied styles applied to this object. More...
 

Detailed Description

Freeform shader brush.

Constructor & Destructor Documentation

kanzi::MaterialBrush::MaterialBrush ( Domain domain,
string_view  name 
)
inlineexplicitprotected

Constructor.

Leaves all properties unset.

Parameters
domaindomain the brush belongs to.
nameName of the brush.
kanzi::MaterialBrush::MaterialBrush ( Domain domain,
string_view  name,
MaterialSharedPtr  material 
)
inlineexplicitprotected

Constructor.

Parameters
domaindomain the brush belongs to.
nameName of the brush.
materialMaterial to use.

Member Function Documentation

ResourceID kanzi::MaterialBrush::getMaterialResourceID ( ) const
inline

Gets the value of MaterialProperty.

See also
setMaterialResourceID()
void kanzi::MaterialBrush::setMaterialResourceID ( ResourceID  value)
inline

Sets the value of MaterialProperty.

See also
getMaterialResourceID()
static MaterialBrushSharedPtr kanzi::MaterialBrush::create ( Domain domain,
string_view  name 
)
static

Create a new shader brush.

Leaves all properties unset.

Parameters
domainuiDomain the brush belongs to.
nameof this texture brush.
static MaterialBrushSharedPtr kanzi::MaterialBrush::create ( Domain domain,
string_view  name,
MaterialSharedPtr  material 
)
static

Create a new shader brush.

Leaves all properties unset.

Parameters
domainuiDomain the brush belongs to.
nameof this texture brush.
materialMaterial to use.
virtual BrushSharedPtr kanzi::MaterialBrush::clone ( )
virtual

Brush::clone() implementation.

Implements kanzi::Brush.

virtual BrushRendererSharedPtr kanzi::MaterialBrush::createBrushRenderer ( Node node)
virtual

Brush::createBrushRenderer() implementation.

Implements kanzi::Brush.

virtual void kanzi::MaterialBrush::load ( ResourceManager resourceManager)
virtual

Brush::load() implementation.

Reimplemented from kanzi::Brush.

MaterialSharedPtr kanzi::MaterialBrush::getMaterial ( ) const
inline

Get current material.

Returns
Resource shared pointer containing material.
virtual void kanzi::MaterialBrush::onPropertyChanged ( AbstractPropertyType  propertyType,
KzuPropertyNotificationReason  reason 
)
protectedvirtual

Object::onPropertyChanged() implementation.

Reimplemented from kanzi::Brush.

void kanzi::MaterialBrush::acquireMaterialResource ( ResourceManager resourceManager)
protected

Refresh material.

Re-acquires material resource from resource ID.

Parameters
resourceManagerResource manager to use for acquiring.
void kanzi::MaterialBrush::calculateRenderingProperties ( )
protected

Recalculate rendering properties.

Must be called when a relevant property has been reassigned.

Member Data Documentation

PropertyType<ResourceID> kanzi::MaterialBrush::MaterialProperty
static

Material property.

The default value is ResourceID().

See also
setMaterialResourceID(), getMaterialResourceID()

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