X-Git-Url: https://ruin.nu/git/?p=germs.git;a=blobdiff_plain;f=src%2Fcomponenttree.h;h=212b4d8edc0a03fee77b4c9143adced17cbb8cec;hp=7a99c91614f6baa6f1f65b0642e923965e6d24b8;hb=b0334271ff31ca880f1d481665284a6d3b057162;hpb=6ba92ada02bfbb04abb8a0c7a039ec63c7c9921e diff --git a/src/componenttree.h b/src/componenttree.h index 7a99c91..212b4d8 100644 --- a/src/componenttree.h +++ b/src/componenttree.h @@ -24,8 +24,6 @@ #include #include "misc.h" -class ComponentTreeTest; - class ComponentTree { public: struct Node { @@ -36,16 +34,29 @@ class ComponentTree { Component _comp; std::vector _children; }; + + /** + * Creates a component tree from a list of components. + */ ComponentTree(const std::vector& components); ~ComponentTree(); + /** + * Transforms the tree into the minimal tree containing all unoriented componentes. + * \todo come up with a better name + */ + void makeUnoriented(); + private: //Disable these, at least for now. void operator=(const ComponentTree&){}; ComponentTree(const ComponentTree&): _root(0,Component()){}; + void removeOriented(Node* n); + Node _root; + friend class ComponentTreeTest; };