add the segment direction information in the tree.x