Class controlling a position sub tree for GraphInstanceObjects usage. More...

#include "murl_logic_graph_position_instance.h"

Inheritance diagram for Murl::Logic::GraphPositionInstance:

Public Member Functions

 GraphPositionInstance (SInt32 baseDepth=0)
 The default constructor. More...
 
 ~GraphPositionInstance () override
 The destructor.
 
Bool Init (INodeObserver *nodeObserver, const Graph::IRoot *root, const String &replicationIdPath, SInt32 baseDepth) override
 Initialize the object. More...
 
Bool Init (INodeObserver *nodeObserver, Graph::INode *replicationNode, SInt32 baseDepth) override
 Initialize the object. More...
 
Bool DeInit () override
 Deinitialize the object. More...
 
void SetObtained (Bool isObtained) override
 Set the obtained state. More...
 
virtual Bool Init (INodeObserver *nodeObserver, const Graph::IRoot *root, const String &nodeIdPath, SInt32 baseDepth)
 Initialize the object. More...
 
virtual Bool Init (INodeObserver *nodeObserver, Graph::INamespace *namespaceNode, const String &nodeIdPath, SInt32 baseDepth)
 Initialize the object. More...
 
- Public Member Functions inherited from Murl::Logic::BaseStepable
 BaseStepable ()
 The default constructor. More...
 
 ~BaseStepable () override
 The destructor. More...
 
 operator IStepablePtr ()
 Conversion operator. More...
 
- Public Member Functions inherited from Murl::Logic::Stepable
 ~Stepable () override
 The destructor.
 
Bool SetAppStepable (IAppStepablePtr appStepable) override
 Implementation of IStepable::SetAppStepable() method. More...
 
void SetEnabled (Bool isEnabled) override
 Implementation of IStepable::SetEnabled() method. More...
 
Bool IsEnabled () const override
 Implementation of IStepable::IsEnabled() method. More...
 
void Reset () override
 Implementation of IStepable::Reset() method.
 
void ProcessTick (const Logic::IState *state) override
 Implementation of IStepable::ProcessTick() method. More...
 
void FinishTick (const Logic::IState *state) override
 Implementation of IStepable::FinishTick() method. More...
 
- Public Member Functions inherited from Murl::Logic::GraphPositionObject
 GraphPositionObject (SInt32 baseDepth=0)
 The default constructor. More...
 
virtual ~GraphPositionObject ()
 The destructor.
 
virtual Bool Init (INodeObserver *nodeObserver, Graph::INamespace *namespaceNode, const String &nodeIdPath, SInt32 baseDepth)
 Initialize the object. More...
 
virtual const VectorGetPosition () const
 Get the position vector. More...
 
virtual void SetPosition (const Vector &position)
 Set the position vector. More...
 
virtual void SetPosition (Real x, Real y)
 Set the x/y positionr. More...
 
virtual void SetPosition (Real x, Real y, Real z)
 Set the x/y/z positionr. More...
 
virtual void AddPosition (const Vector &position)
 Add a vector to the position. More...
 
virtual void SetSortDepth (SInt32 sortDepth)
 Set the current depth sort order. More...
 
virtual SInt32 GetSortDepth () const
 Get the current depth sort order. More...
 
virtual void SetBaseSortDepth (SInt32 sortDepth)
 Set the base depth sort order. More...
 
virtual SInt32 GetBaseSortDepth () const
 Get the base depth sort order. More...
 

Protected Member Functions

void OnReset () override
 Overwrite of the BaseStepable::OnReset() method. More...
 
- Protected Member Functions inherited from Murl::Logic::BaseStepable
void OnSetEnabled (Bool isEnabled) override
 Default implementation of IAppStepable::OnSetEnabled() method, this method is empty and can be overwritten. More...
 
void OnProcessTick (const Logic::IState *state) override
 Default implementation of IAppStepable::OnProcessTick() method, this method is empty and can be overwritten. More...
 
void OnFinishTick (const Logic::IState *state) override
 Default implementation of IAppStepable::OnFinishTick() method, this method is empty and can be overwritten. More...
 
- Protected Member Functions inherited from Murl::Logic::GraphPositionObject
virtual void ApplySortDepth ()
 Apply the depth sort order to the transformation. More...
 
virtual void ApplyPosition ()
 Apply the position vector to the transformation. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Murl::Logic::Stepable
static IStepablePtr Create ()
 Create a stepable object. More...
 

Detailed Description

Class controlling a position sub tree for GraphInstanceObjects usage.

MyLogic.h

#include "murl_logic_graph_instance_objects.h"
#include "murl_logic_graph_position_instance.h"
...
Logic::GraphInstanceObjects<Logic::GraphPositionInstance> mMyInstances;

MyLogic.cpp

Bool App::MyLogic::OnInit(const Logic::IState* state)
{
const Graph::IRoot* root = state->GetGraphRoot();
if (!mMyInstances.Init(root, "/MY_LOCATION", "/MY_INSTANCE_NODE", "/MY_INSTANCE"))
{
return false;
}
// other stuff
return true;
}
Bool App::MyLogic::OnDeInit(const Logic::IState* state)
{
Bool ret = true;
// other stuff
if (!mMyInstances.DeInit())
{
ret = false;
}
return ret;
}
bool Bool
Boolean data type This typedef represents a boolean value (true or false).
Definition: murl_types.h:158

MyGraph.xml

<Namespace id="MY_LOCATION">
<Instance id="MY_INSTANCE_NODE" graphResourceId="MyInstanceXml" replications="10"
</Namespace>

MyInstance.xml

<Graph>
<Namespace id="MY_INSTANCE{replication}" activeAndVisible="no">
<Transform id="position">
<!-- my nodes -->
</Transform>
</Namespace>
</Graph>


Alternatively a replication with anonymous namespace can be accessed as follows.

Bool App::MyLogic::OnInit(const Logic::IState* state)
{
if (!mMyInstances.Init(root->GetRootNamespace(), "/MY_LOCATION/MY_INSTANCE_NODE"))
{
return false;
}
// other stuff
return true;
}

MyInstance.xml

<Graph>
<Namespace activeAndVisible="no">
<Transform id="position">
<!-- my nodes -->
</Transform>
</Namespace>
</Graph>

Constructor & Destructor Documentation

◆ GraphPositionInstance()

Murl::Logic::GraphPositionInstance::GraphPositionInstance ( SInt32  baseDepth = 0)
inline

The default constructor.

Parameters
baseDepthThe base depth order.

Member Function Documentation

◆ Init() [1/4]

Bool Murl::Logic::GraphPositionInstance::Init ( INodeObserver nodeObserver,
const Graph::IRoot root,
const String replicationIdPath,
SInt32  baseDepth 
)
inlineoverridevirtual

Initialize the object.

Parameters
nodeObserverThe INodeObserver object.
rootThe graph root node.
replicationIdPathThe full path to the replication's graph namespace node.
baseDepthThe base depth order.
Returns
true if successful.

Reimplemented from Murl::Logic::GraphPositionObject.

References Murl::Graph::IRoot::FindNode(), and Init().

◆ Init() [2/4]

Bool Murl::Logic::GraphPositionInstance::Init ( INodeObserver nodeObserver,
Graph::INode replicationNode,
SInt32  baseDepth 
)
inlineoverridevirtual

Initialize the object.

Parameters
nodeObserverThe INodeObserver object.
replicationNodeThe replication's graph namespace node.
baseDepthThe base depth order.
Returns
true if successful.

Implements Murl::Logic::GraphReplication.

References Murl::Logic::INodeObserver::Add(), Murl::Logic::GraphNodeT< NodeType >::GetNode(), Murl::Logic::GraphNodeT< NodeType >::GetReference(), and Murl::Logic::GraphPositionObject::Init().

◆ DeInit()

Bool Murl::Logic::GraphPositionInstance::DeInit ( )
inlineoverridevirtual

Deinitialize the object.

Returns
true if successful.

Reimplemented from Murl::Logic::GraphPositionObject.

References Murl::Logic::GraphPositionObject::DeInit().

◆ SetObtained()

void Murl::Logic::GraphPositionInstance::SetObtained ( Bool  isObtained)
inlineoverridevirtual

Set the obtained state.

Parameters
isObtainedThe obtained state.

Implements Murl::Logic::GraphReplication.

References Murl::Logic::GraphNodeT< NodeType >::SetActiveAndVisible().

◆ OnReset()

void Murl::Logic::GraphPositionInstance::OnReset ( )
inlineoverrideprotectedvirtual

◆ Init() [3/4]

virtual Bool Murl::Logic::GraphPositionObject::Init
inline

Initialize the object.

Parameters
nodeObserverThe INodeObserver object.
rootThe graph root node.
nodeIdPathThe full path to the graph transform node instance.
baseDepthThe base depth order.
Returns
true if successful.

Referenced by Init().

◆ Init() [4/4]

virtual Bool Murl::Logic::GraphPositionObject::Init
inline

Initialize the object.

Parameters
nodeObserverThe INodeObserver object.
namespaceNodeThe graph namespace node.
nodeIdPathThe relative path to the graph transform node instance.
baseDepthThe base depth order.
Returns
true if successful.

The documentation for this class was generated from the following file:
  • murl_logic_graph_position_instance.h


Copyright © 2011-2024 Spraylight GmbH.