I'm cheating this isn't breadth-first, but rather we record visited instances keeping track of their rank and return a list ordered by rank. Is this equivalent?
| 1831 | // I'm cheating this isn't breadth-first, but rather we record visited instances |
| 1832 | // keeping track of their rank and return a list ordered by rank. Is this equivalent? |
| 1833 | aggregate_of_instance::ptr IfcParse::traverse_breadth_first(IfcUtil::IfcBaseClass* instance, int max_level) { |
| 1834 | std::set<IfcUtil::IfcBaseClass*> visited; |
| 1835 | traversal_recorder recorder(1); |
| 1836 | traverse_(instance, visited, recorder, 0, max_level); |
| 1837 | return recorder.get_list(); |
| 1838 | } |
| 1839 | |
| 1840 | /// @note: for backwards compatibility |
| 1841 | aggregate_of_instance::ptr IfcFile::traverse(IfcUtil::IfcBaseClass* instance, int max_level) { |