The IInstance graph node interface. More...

#include "murl_graph_i_instance.h"

Inheritance diagram for Murl::Graph::IInstance:

Public Member Functions

virtual INodeGetNodeInterface ()=0
 Get the mutable Graph::INode interface. More...
 
virtual const INodeGetNodeInterface () const =0
 Get the constant Graph::INode interface. More...
 
virtual IGraphResourceTargetGetGraphResourceTarget ()=0
 Get a mutable Graph::IGraphResourceTarget container. More...
 
virtual const IGraphResourceTargetGetGraphResourceTarget () const =0
 Get a constant Graph::IGraphResourceTarget container. More...
 
virtual ITemplateNodeTargetGetTemplateNodeTarget ()=0
 Get the mutable Graph::ITemplateNodeTarget container. More...
 
virtual const ITemplateNodeTargetGetTemplateNodeTarget () 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 INodeGetReplicationNode (UInt32 index)=0
 Return the replication at a given position. More...
 
virtual const INodeGetReplicationNode (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...
 

Detailed Description

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().

Member Function Documentation

◆ GetNodeInterface() [1/2]

virtual INode* Murl::Graph::IInstance::GetNodeInterface ( )
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.

Returns
The mutable Graph::INode interface, or null if not available

◆ GetNodeInterface() [2/2]

virtual const INode* Murl::Graph::IInstance::GetNodeInterface ( ) const
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.

Returns
The constant Graph::INode interface, or null if not available

◆ GetGraphResourceTarget() [1/2]

virtual IGraphResourceTarget* Murl::Graph::IInstance::GetGraphResourceTarget ( )
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.

Returns
The mutable Graph::IGraphResourceTarget container, or null if not available

◆ GetGraphResourceTarget() [2/2]

virtual const IGraphResourceTarget* Murl::Graph::IInstance::GetGraphResourceTarget ( ) const
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.

Returns
The constant Graph::IGraphResourceTarget container, or null if not available

◆ GetTemplateNodeTarget() [1/2]

virtual ITemplateNodeTarget* Murl::Graph::IInstance::GetTemplateNodeTarget ( )
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.

Returns
The mutable Graph::ITemplateNodeTarget container, or null if not available.

◆ GetTemplateNodeTarget() [2/2]

virtual const ITemplateNodeTarget* Murl::Graph::IInstance::GetTemplateNodeTarget ( ) const
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.

Returns
The mutable Graph::ITemplateNodeTarget container, or null if not available.

◆ SetNumberOfReplications()

virtual Bool Murl::Graph::IInstance::SetNumberOfReplications ( UInt32  numberOfReplications)
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.

Parameters
numberOfReplicationsThe number of replications of the graph to create.
Returns
true if successful.

◆ GetNumberOfReplications()

virtual UInt32 Murl::Graph::IInstance::GetNumberOfReplications ( ) const
pure virtual

Get the number of replications.

Returns
The number of replications of the graph to create.

Referenced by Murl::Logic::GraphInstanceObjects< InstanceObjectType >::Init().

◆ GetReplicationNode() [1/2]

virtual INode* Murl::Graph::IInstance::GetReplicationNode ( UInt32  index)
pure virtual

Return the replication at a given position.

This returns a mutable pointer to this node's replication at a given index.

Parameters
indexThe zero-based index of the replication.
Returns
A pointer to the replication node, or null if the index was out of range.

Referenced by Murl::Logic::GraphInstanceObjects< InstanceObjectType >::Init().

◆ GetReplicationNode() [2/2]

virtual const INode* Murl::Graph::IInstance::GetReplicationNode ( UInt32  index) const
pure virtual

Return the replication at a given position.

This returns a constant pointer to this node's replication at a given index.

Parameters
indexThe zero-based index of the replication.
Returns
A pointer to the replication node, or null if the index was out of range.

◆ AddParameter()

virtual Bool Murl::Graph::IInstance::AddParameter ( const String name,
const String value 
)
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).

Parameters
nameThe parameter name.
valueThe parameter value.
Returns
true if successful.

◆ GetNumberOfParameters()

virtual UInt32 Murl::Graph::IInstance::GetNumberOfParameters ( ) const
pure virtual

Get the total number of user-defined instance parameters.

Returns
The number of parameters.

◆ GetParameterName()

virtual String Murl::Graph::IInstance::GetParameterName ( UInt32  index) const
pure virtual

Get the name of a user-defined instance parameter at a given index.

Parameters
indexThe zero-based index of the parameter to query.
Returns
The parameter name at the given index.

◆ GetParameterValue()

virtual String Murl::Graph::IInstance::GetParameterValue ( UInt32  index) const
pure virtual

Get the value of a user-defined instance parameter at a given index.

Parameters
indexThe zero-based index of the parameter to query.
Returns
The parameter value at the given index.

The documentation for this interface was generated from the following file:
  • murl_graph_i_instance.h


Copyright © 2011-2024 Spraylight GmbH.