/////////////////////////////////////////////////////////////////////////////// // NAME // CalculateMaxHeight // ARGUMENTS // pTree - pointer to tree this node is in // pDC - pointer to the device context // DESCRIPTION // Determine the maximum height at each level in the tree // It assumes that the height of this and all other nodes hav already been established // RETURN VALUE // none // public void CalculateMaxHeight(LingTreeTree Tree, Graphics grfx) { LingTreeNode Node; // Determine the height for this node CalculateHeight(Tree, grfx); // calculate max height of all daughters Node = Daughter; while (Node != null) { Node.CalculateMaxHeight(Tree, grfx); Node = Node.Sister; } // set tree's maximum height at this node's level if (Tree.GetMaxLevelHeight(Level) < Height) { Tree.SetMaxLevelHeight(Level, Height); } }
/////////////////////////////////////////////////////////////////////////////// // NAME // CalculateMaxHeight // ARGUMENTS // pTree - pointer to tree this node is in // pDC - pointer to the device context // DESCRIPTION // Determine the maximum height at each level in the tree // It assumes that the height of this and all other nodes hav already been established // RETURN VALUE // none // public void CalculateMaxHeight(LingTreeTree Tree, Graphics grfx) { LingTreeNode Node; // Determine the height for this node CalculateHeight(Tree, grfx); // calculate max height of all daughters Node = Daughter; while (Node != null) { Node.CalculateMaxHeight(Tree, grfx); Node = Node.Sister; } // set tree's maximum height at this node's level if (Tree.GetMaxLevelHeight(Level) < Height) Tree.SetMaxLevelHeight(Level , Height); }