MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / traverse_breadth_first

Method traverse_breadth_first

src/ifcparse/IfcParse.cpp:1833–1838  ·  view source on GitHub ↗

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?

Source from the content-addressed store, hash-verified

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?
1833aggregate_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
1841aggregate_of_instance::ptr IfcFile::traverse(IfcUtil::IfcBaseClass* instance, int max_level) {

Callers

nothing calls this directly

Calls 2

traverse_Function · 0.85
get_listMethod · 0.80

Tested by

no test coverage detected