Kanzi  3.9.9
Kanzi Engine C++ 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 BindingContainer = vector< BindingLoadInfo >
 Container type for bindings. More...
 
using ChildContainer = vector< NodeEffectTemplate2DSharedPtr >
 Container type for children. More...
 
using ConstBindingIterator = BindingContainer::const_iterator
 Iterator type for container of bindings. More...
 
using ConstChildIterator = ChildContainer::const_iterator
 Iterator type for children. More...
 
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 addBinding (BindingLoadInfo binding)
 Adds a binding to add when instantiating the template. More...
 
void addChild (NodeEffectTemplate2DSharedPtr child)
 Adds a child to the template. More...
 
void addPropertyValue (AbstractPropertyType propertyType, Variant value)
 Adds a property to set when instantiating the template. More...
 
ConstChildIterator beginChildren () const
 Gets iterator to the beginning of children container of the template. More...
 
ConstPropertyIterator beginProperties () const
 Gets iterator to the beginning of properties container of the template. More...
 
ConstChildIterator endChildren () const
 Gets iterator to the end of children 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...
 
NodeEffect2DSharedPtr instantiate (Domain *domain, NodeEffect2DSharedPtr root)
 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

Container type for children.

using kanzi::NodeEffectTemplate2D::ConstChildIterator = ChildContainer::const_iterator

Iterator type for children.

Container type for bindings.

using kanzi::NodeEffectTemplate2D::ConstBindingIterator = BindingContainer::const_iterator

Iterator type for container of bindings.

Container type for property values.

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

Iterator type for container of property values.

Constructor & Destructor Documentation

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

Destructor.

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

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.
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.
static NodeEffectTemplate2DSharedPtr kanzi::NodeEffectTemplate2D::create ( )
inlinestatic

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

Returns
The node effect template.
string kanzi::NodeEffectTemplate2D::getName ( ) const
inline

Gets the name of the template.

Returns
Name of the template.
void kanzi::NodeEffectTemplate2D::setName ( string_view  name)
inline

Sets the name of the template.

Parameters
nameName to use.
string kanzi::NodeEffectTemplate2D::getMetaclassName ( ) const
inline

Gets the metaclass name of the template.

Returns
Name of the metaclass.
void kanzi::NodeEffectTemplate2D::setMetaclassName ( string_view  name)
inline

Sets the metaclass name of the template.

Parameters
nameName of the metaclass.
void kanzi::NodeEffectTemplate2D::addChild ( NodeEffectTemplate2DSharedPtr  child)
inline

Adds a child to the template.

Parameters
childChild to add.
Since
Kanzi 3.9.8.
void kanzi::NodeEffectTemplate2D::addBinding ( BindingLoadInfo  binding)
inline

Adds a binding to add when instantiating the template.

Parameters
bindingThe binding to add.
Since
Kanzi 3.9.8.
void kanzi::NodeEffectTemplate2D::addPropertyValue ( AbstractPropertyType  propertyType,
Variant  value 
)
inline

Adds a property to set when instantiating the template.

Parameters
propertyTypeProperty type.
valueProperty value.
ConstChildIterator kanzi::NodeEffectTemplate2D::beginChildren ( ) const
inline

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

Returns
Const iterator to the beginning of children container.
Since
Kanzi 3.9.8.
ConstChildIterator kanzi::NodeEffectTemplate2D::endChildren ( ) const
inline

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

Returns
Const iterator to the end of children container.
Since
Kanzi 3.9.8.
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.
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.
NodeEffect2DSharedPtr kanzi::NodeEffectTemplate2D::instantiate ( Domain domain)

Instantiates the template.

Parameters
domainDomain to use.
Returns
Instantiated node effect.
NodeEffect2DSharedPtr kanzi::NodeEffectTemplate2D::instantiate ( Domain domain,
NodeEffect2DSharedPtr  root 
)

Instantiates the template.

Parameters
domainDomain to use.
rootRoot effect instance associated with the instantiated effect. Must be non-null.
Returns
Instantiated node effect.
Since
Kanzi 3.9.8.
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.
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: