+/**
+ * Helper class to create sorted depth index
+ */
+class ActorDepthTreeNode
+{
+public:
+ ActorDepthTreeNode()
+ : mParentNode(NULL),
+ mNextSiblingNode(NULL),
+ mFirstChildNode(NULL),
+ mSiblingOrder( 0 )
+ {
+ }
+
+ ActorDepthTreeNode( Actor* actor, uint16_t siblingOrder )
+ : mParentNode(NULL),
+ mNextSiblingNode(NULL),
+ mFirstChildNode(NULL),
+ mSiblingOrder( siblingOrder )
+ {
+ mActors.push_back( actor );
+ }
+
+ ~ActorDepthTreeNode()
+ {
+ if( mFirstChildNode )
+ {
+ delete mFirstChildNode;
+ mFirstChildNode = NULL;
+ }
+ if( mNextSiblingNode )
+ {
+ delete mNextSiblingNode;
+ mNextSiblingNode = NULL;
+ }
+ mParentNode = NULL;
+ }
+
+ uint16_t GetSiblingOrder()
+ {
+ return mSiblingOrder;
+ }
+
+ void AddActor( Actor* actor )
+ {
+ mActors.push_back( actor );
+ }
+
+public:
+ std::vector<Actor*> mActors; // Array of actors with the same sibling order and same ancestor sibling orders
+ ActorDepthTreeNode* mParentNode;
+ ActorDepthTreeNode* mNextSiblingNode;
+ ActorDepthTreeNode* mFirstChildNode;
+ uint16_t mSiblingOrder;
+
+private:
+ ActorDepthTreeNode( ActorDepthTreeNode& );
+ ActorDepthTreeNode& operator=(const ActorDepthTreeNode& );
+};
+
+