caps_TreeTemplateTools.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. diff -pruN orig/Phyl/TreeTemplateTools.h new/Phyl/TreeTemplateTools.h
  2. --- orig/Phyl/TreeTemplateTools.h 2010-04-01 16:37:04.000000000 +0300
  3. +++ new/Phyl/TreeTemplateTools.h 2017-02-03 14:33:11.000000000 +0200
  4. @@ -191,7 +191,7 @@ class TreeTemplateTools
  5. static void dropLeaf(TreeTemplate<N>& tree, const std::string& leafName) throw (NodeNotFoundException, Exception)
  6. {
  7. N* leaf = tree.getNode(leafName);
  8. - if (!leaf->hasfather())
  9. + if (!leaf->hasFather())
  10. throw Exception("TreeTemplateTools::dropLeaf(). Leaf is the only node in the tree, can't remove it.");
  11. N* parent = leaf->getFather();
  12. if (parent->getNumberOfSons() > 2)
  13. @@ -203,7 +203,7 @@ class TreeTemplateTools
  14. else if (parent->getNumberOfSons() == 2)
  15. {
  16. //We have to delete the parent node as well:
  17. - N* brother = parent->getson(0);
  18. + N* brother = parent->getSon(0);
  19. if (brother == leaf) brother = parent->getSon(1);
  20. if (!parent->hasFather())
  21. {
  22. @@ -212,7 +212,7 @@ class TreeTemplateTools
  23. {
  24. brother->setDistanceToFather(brother->getDistanceToFather() + leaf->getDistanceToFather());
  25. }
  26. - tree->setRootNode(brother);
  27. + tree.setRootNode(brother);
  28. delete parent;
  29. delete leaf;
  30. }
  31. @@ -223,7 +223,7 @@ class TreeTemplateTools
  32. {
  33. brother->setDistanceToFather(brother->getDistanceToFather() + parent->getDistanceToFather());
  34. }
  35. - unsigned int pos = gParent->getsonPosition(parent);
  36. + unsigned int pos = gParent->getSonPosition(parent);
  37. gParent->setSon(pos, brother);
  38. delete parent;
  39. delete leaf;