Salut Frederic,
I suggest you look at the logic in the TNode constructor to understand
the current logic. In your case, if you want to set the hierarchy only
once you have defined all the nodes, I suggest;
//disable current node in geometry
gGeometry->setCurrentNode(0);
//define your nodes
TNode *node = new TNode(...)
......
//clear the list of nodes in the geometry
gGeometry->GetListOfNodes()->Clear();
//now start creating your hierarchy
//if a node has descendants, do:
node->BuildListOfNodes();
//to insert a node in its parent node, do
node->SetParent(parentNode);
parentNode->GetListOfNodes()->Add(node);
Let me know if you still have problems.
I am curious to know why you can only build the hierarchy at the end.
This is may be an interesting case.
Rene Brun