12 #ifndef hifi_DeleteEntityOperator_h
13 #define hifi_DeleteEntityOperator_h
19 #include "EntityItem.h"
21 class EntityToDeleteDetails {
23 EntityItemPointer entity;
25 EntityTreeElementPointer containingElement;
28 typedef QSet<EntityToDeleteDetails> RemovedEntities;
30 inline uint qHash(
const EntityToDeleteDetails& a, uint seed) {
31 return qHash(a.entity->getEntityItemID(), seed);
34 inline bool operator==(
const EntityToDeleteDetails& a,
const EntityToDeleteDetails& b) {
35 return a.entity->getEntityItemID() == b.entity->getEntityItemID();
40 DeleteEntityOperator(EntityTreePointer tree);
41 DeleteEntityOperator(EntityTreePointer tree,
const EntityItemID& searchEntityID);
42 ~DeleteEntityOperator();
44 void addEntityIDToDeleteList(
const EntityItemID& searchEntityID);
45 void addEntityToDeleteList(
const EntityItemPointer& entity);
46 virtual bool preRecursion(
const OctreeElementPointer& element)
override;
47 virtual bool postRecursion(
const OctreeElementPointer& element)
override;
49 const RemovedEntities& getEntities()
const {
return _entitiesToDelete; }
51 EntityTreePointer _tree;
52 RemovedEntities _entitiesToDelete;
56 bool subTreeContainsSomeEntitiesToDelete(
const OctreeElementPointer& element);
Abstract ID for editing model items. Used in EntityItem JS API.
Definition: EntityItemID.h:28
derive from this class to use the Octree::recurseTreeWithOperator() method
Definition: Octree.h:43