mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 18:16:40 +00:00
#1531 Breadth-first search and maintain insertion order on remove_deep()
This commit is contained in:
+18
-1
@@ -24,6 +24,10 @@
|
||||
#include <set>
|
||||
#include <iterator>
|
||||
#include <boost/unordered_map.hpp>
|
||||
#include <boost/multi_index_container.hpp>
|
||||
#include <boost/multi_index/sequenced_index.hpp>
|
||||
#include <boost/multi_index/ordered_index.hpp>
|
||||
#include <boost/multi_index/random_access_index.hpp>
|
||||
|
||||
#include "ifc_parse_api.h"
|
||||
|
||||
@@ -132,7 +136,16 @@ private:
|
||||
|
||||
void build_inverses_(IfcUtil::IfcBaseClass*);
|
||||
|
||||
std::set<int> batch_deletion_ids_;
|
||||
typedef boost::multi_index_container<
|
||||
int,
|
||||
boost::multi_index::indexed_by<
|
||||
boost::multi_index::sequenced<>,
|
||||
boost::multi_index::ordered_unique<
|
||||
boost::multi_index::identity<int>
|
||||
>
|
||||
>
|
||||
> batch_deletion_ids_t;
|
||||
batch_deletion_ids_t batch_deletion_ids_;
|
||||
bool batch_mode_ = false;
|
||||
void process_deletion_();
|
||||
|
||||
@@ -220,6 +233,10 @@ public:
|
||||
/// in the first function argument.
|
||||
IfcEntityList::ptr traverse(IfcUtil::IfcBaseClass* instance, int max_level=-1);
|
||||
|
||||
/// Same as traverse() but maintains topological order by using a
|
||||
/// breadth-first search
|
||||
IfcEntityList::ptr traverse_breadth_first(IfcUtil::IfcBaseClass* instance, int max_level = -1);
|
||||
|
||||
IfcEntityList::ptr getInverse(int instance_id, const IfcParse::declaration* type, int attribute_index);
|
||||
|
||||
/// Marks entity as modified so that potential cache for it is invalidated.
|
||||
|
||||
Reference in New Issue
Block a user