![]() |
Murl Engine API
Version 2018.3
|
The IInstance graph node interface. More...
#include <murl_graph_i_instance.h>
The IInstance graph node interface.
This interface provides a means to instantiate zero, one, or more sub-graphs in the current scene graph. The source object (i.e. graph template) can either be a Resource::IGraph object from the resource collection set via GetGraphResourceTarget(), or an already instantiated Graph::ITemplate node referenced via GetTemplateNodeTarget().
Public Member Functions | |
virtual INode * | GetNodeInterface ()=0 |
Get the mutable Graph::INode interface. More... | |
virtual const INode * | GetNodeInterface () const =0 |
Get the constant Graph::INode interface. More... | |
virtual IGraphResourceTarget * | GetGraphResourceTarget ()=0 |
Get a mutable Graph::IGraphResourceTarget container. More... | |
virtual const IGraphResourceTarget * | GetGraphResourceTarget () const =0 |
Get a constant Graph::IGraphResourceTarget container. More... | |
virtual ITemplateNodeTarget * | GetTemplateNodeTarget ()=0 |
Get the mutable Graph::ITemplateNodeTarget container. More... | |
virtual const ITemplateNodeTarget * | GetTemplateNodeTarget () const =0 |
Get the constant Graph::ITemplateNodeTarget container. More... | |
virtual Bool | SetNumberOfReplications (UInt32 numberOfReplications)=0 |
Set the number of replications. More... | |
virtual UInt32 | GetNumberOfReplications () const =0 |
Get the number of replications. More... | |
virtual INode * | GetReplicationNode (UInt32 index)=0 |
Return the replication at a given position. More... | |
virtual const INode * | GetReplicationNode (UInt32 index) const =0 |
Return the replication at a given position. More... | |
virtual Bool | AddParameter (const String &name, const String &value)=0 |
Add a user-defined instance parameter. More... | |
virtual UInt32 | GetNumberOfParameters () const =0 |
Get the total number of user-defined instance parameters. More... | |
virtual String | GetParameterName (UInt32 index) const =0 |
Get the name of a user-defined instance parameter at a given index. More... | |
virtual String | GetParameterValue (UInt32 index) const =0 |
Get the value of a user-defined instance parameter at a given index. More... | |
|
pure virtual |
Get the mutable Graph::INode interface.
This method returns a mutable pointer to the node's Graph::INode interface, to be able to query or modify common node properties such as active state, visibility or ID.
|
pure virtual |
Get the constant Graph::INode interface.
This method returns a constant pointer to the node's Graph::INode interface, to be able to query common node properties such as active state, visibility or ID.
|
pure virtual |
Get a mutable Graph::IGraphResourceTarget container.
This method returns a mutable pointer to a Graph::IGraphResourceTarget container, which allows to add, remove or query the graph resources referenced by a node implementing this interface.
|
pure virtual |
Get a constant Graph::IGraphResourceTarget container.
This method returns a constant pointer to a Graph::IGraphResourceTarget container, which allows to query the graph resources referenced by a node implementing this interface.
|
pure virtual |
Get the mutable Graph::ITemplateNodeTarget container.
This method returns a mutable pointer to the node's Graph::ITemplateNodeTarget container, which allows to set or query the template graph node used for instantiaton.
|
pure virtual |
Get the constant Graph::ITemplateNodeTarget container.
This method returns a constant pointer to the node's Graph::ITemplateNodeTarget container, which allows to query the template graph node used for instantiaton.
|
pure virtual |
Set the number of replications.
This method sets the number of times the referenced graph resource should be instantiated. By default, this value is set to 1; it is also possible to set it to zero to not instantiate any graphs at all, useful e.g. when the instance node itself is used from within a parameterized sub-graph.
numberOfReplications | The number of replications of the graph to create. |
|
pure virtual |
Get the number of replications.
Return the replication at a given position.
This returns a mutable pointer to this node's replication at a given index.
index | The zero-based index of the replication. |
Return the replication at a given position.
This returns a constant pointer to this node's replication at a given index.
index | The zero-based index of the replication. |
|
pure virtual |
Add a user-defined instance parameter.
It is possible to parameterize a graph instance by adding individual parameter name/value pairs, which are then evaluated during creation of the given sub-graph. If a node attribute from the given graph resource contains an identifier name enclosed in curly braces, e.g. "{myVariable}", that sequence is replaced by the value of the parameter with the given name if present, otherwise a default value is used that can be defined in the graph resource (or an empty string if that default value is also not present).
name | The parameter name. |
value | The parameter value. |
|
pure virtual |
Get the total number of user-defined instance parameters.
Get the name of a user-defined instance parameter at a given index.
index | The zero-based index of the parameter to query. |
Get the value of a user-defined instance parameter at a given index.
index | The zero-based index of the parameter to query. |