Kanzi  3.9.5
Kanzi Engine API
kanzi::NodeEffectTemplate2D Class Reference

Use NodeEffectTemplate2D to instantiate a node effect. More...

#include <kanzi/core.ui/template/node_effect_template2d.hpp>

Public Types

using ConstPropertyIterator = PropertyContainer::const_iterator
 Iterator type for container of property values. More...
 
using PropertyContainer = vector< PropertyEntry >
 Container type for property values. More...
 
using PropertyEntry = pair< AbstractPropertyType, Variant >
 Type for property value. More...
 

Public Member Functions

void addPropertyValue (AbstractPropertyType propertyType, Variant value)
 Adds a property to set when instantiating the template. More...
 
ConstPropertyIterator beginProperties () const
 Gets iterator to the beginning of properties container of the template. More...
 
ConstPropertyIterator endProperties () const
 Gets iterator to the end of properties container of the template. More...
 
string getMetaclassName () const
 Gets the metaclass name of the template. More...
 
string getName () const
 Gets the name of the template. More...
 
NodeEffect2DSharedPtr instantiate (Domain *domain)
 Instantiates the template. More...
 
void setMetaclassName (string_view name)
 Sets the metaclass name of the template. More...
 
void setName (string_view name)
 Sets the name of the template. More...
 
virtual ~NodeEffectTemplate2D ()
 Destructor. More...
 

Static Public Member Functions

static NodeEffectTemplate2DSharedPtr create (string_view metaclassName, string_view name)
 Creates a node effect template. More...
 
static NodeEffectTemplate2DSharedPtr create (string_view metaclassName)
 Creates a node effect template. More...
 
static NodeEffectTemplate2DSharedPtr create ()
 Creates a node effect template and sets the mataclass name to empty. More...
 
static NodeEffectTemplate2DSharedPtr createFromKZB (Domain *domain, KzbFile &kzbFile, ReadOnlyMemoryFile &file, KzbMemoryParser &parser)
 Creates a template instance and loads it from a file. More...
 

Protected Member Functions

void loadFromKZB (Domain *domain, KzbFile &kzbFile, ReadOnlyMemoryFile &file, KzbMemoryParser &parser)
 Loads a node effect template from a file. More...
 
 NodeEffectTemplate2D (string_view metaclassName, string_view name)
 Constructor. More...
 

Detailed Description

Use NodeEffectTemplate2D to instantiate a node effect.

NodeEffectTemplate2D contains the type of the NodeEffect2D to instantiate and all property values that belong to the NodeEffect2D.

See also
NodeEffect2D, NodeEffectPrefab2D
Since
Kanzi 3.9.0

Member Typedef Documentation

◆ PropertyEntry

◆ PropertyContainer

Container type for property values.

◆ ConstPropertyIterator

using kanzi::NodeEffectTemplate2D::ConstPropertyIterator = PropertyContainer::const_iterator

Iterator type for container of property values.

Constructor & Destructor Documentation

◆ ~NodeEffectTemplate2D()

virtual kanzi::NodeEffectTemplate2D::~NodeEffectTemplate2D ( )
virtual

Destructor.

◆ NodeEffectTemplate2D()

kanzi::NodeEffectTemplate2D::NodeEffectTemplate2D ( string_view  metaclassName,
string_view  name 
)
explicitprotected

Constructor.

Parameters
metaclassNameName of the metaclass to use.
nameName of the node effect to create.

Member Function Documentation

◆ create() [1/3]

static NodeEffectTemplate2DSharedPtr kanzi::NodeEffectTemplate2D::create ( string_view  metaclassName,
string_view  name 
)
static

Creates a node effect template.

Parameters
metaclassNameName of the metaclass to use.
nameName of the node effect to create.
Returns
The node effect template.

◆ create() [2/3]

static NodeEffectTemplate2DSharedPtr kanzi::NodeEffectTemplate2D::create ( string_view  metaclassName)
inlinestatic

Creates a node effect template.

Parameters
metaclassNameName of the metaclass to use.
Returns
The node effect template.

◆ create() [3/3]

static NodeEffectTemplate2DSharedPtr kanzi::NodeEffectTemplate2D::create ( )
inlinestatic

Creates a node effect template and sets the mataclass name to empty.

Returns
The node effect template.

◆ getName()

string kanzi::NodeEffectTemplate2D::getName ( ) const
inline

Gets the name of the template.

Returns
Name of the template.

◆ setName()

void kanzi::NodeEffectTemplate2D::setName ( string_view  name)
inline

Sets the name of the template.

Parameters
nameName to use.

◆ getMetaclassName()

string kanzi::NodeEffectTemplate2D::getMetaclassName ( ) const
inline

Gets the metaclass name of the template.

Returns
Name of the metaclass.

◆ setMetaclassName()

void kanzi::NodeEffectTemplate2D::setMetaclassName ( string_view  name)
inline

Sets the metaclass name of the template.

Parameters
nameName of the metaclass.

◆ addPropertyValue()

void kanzi::NodeEffectTemplate2D::addPropertyValue ( AbstractPropertyType  propertyType,
Variant  value 
)
inline

Adds a property to set when instantiating the template.

Parameters
propertyTypeProperty type.
valueProperty value.

◆ beginProperties()

ConstPropertyIterator kanzi::NodeEffectTemplate2D::beginProperties ( ) const
inline

Gets iterator to the beginning of properties container of the template.

Returns
Const iterator to the beginning of properties container.

◆ endProperties()

ConstPropertyIterator kanzi::NodeEffectTemplate2D::endProperties ( ) const
inline

Gets iterator to the end of properties container of the template.

Returns
Const iterator to the end of properties container.

◆ instantiate()

NodeEffect2DSharedPtr kanzi::NodeEffectTemplate2D::instantiate ( Domain domain)

Instantiates the template.

Parameters
domainDomain to use.
Returns
Instantiated node effect.

◆ createFromKZB()

static NodeEffectTemplate2DSharedPtr kanzi::NodeEffectTemplate2D::createFromKZB ( Domain domain,
KzbFile kzbFile,
ReadOnlyMemoryFile file,
KzbMemoryParser parser 
)
static

Creates a template instance and loads it from a file.

Parameters
domainDomain
kzbFileThe kzb file from which to load the template instance.
fileThe template instance file in the kzb file.
parserFile memory parser.
Returns
Created node effect template.

◆ loadFromKZB()

void kanzi::NodeEffectTemplate2D::loadFromKZB ( Domain domain,
KzbFile kzbFile,
ReadOnlyMemoryFile file,
KzbMemoryParser parser 
)
protected

Loads a node effect template from a file.

Parameters
domainDomain
kzbFileKZB file where to load from.
fileEffect preafb file inside KZB file where to load from.
parserFile memory parser.

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