void TravelTree(HL_IRDTreeNode* pNewRoot) { std::queue<HL_IRDTreeNode*> nodeQueue; if (pNewRoot == NULL) { return; } nodeQueue.push(pNewRoot); while (!nodeQueue.empty()) { HL_IRDTreeNode* pNode = nodeQueue.front(); nodeQueue.pop(); HL_IRDTreeNode* firstChild = pNode->Get_FirstChild(); if (firstChild != NULL) { nodeQueue.push(firstChild); int nChildCount = pNode->Get_ChildNodeCount(); for (int i = 0; i < nChildCount; i++) { firstChild = firstChild->Get_NextSibling(); if (firstChild != NULL) { nodeQueue.push(firstChild); } } } } }