11 #ifndef smtk_model_SelectionFootprint_h
12 #define smtk_model_SelectionFootprint_h
14 #include "smtk/geometry/queries/SelectionFootprint.h"
16 #include "smtk/geometry/Geometry.h"
18 #include "smtk/model/CellEntity.h"
19 #include "smtk/model/Entity.h"
20 #include "smtk/model/Group.h"
21 #include "smtk/model/Model.h"
23 #include <unordered_set>
34 :
public smtk::resource::query::
35 DerivedFrom<SelectionFootprint, smtk::geometry::SelectionFootprint>
49 std::unordered_set<smtk::resource::PersistentObject*>& footprint,
53 if ((hasFootprint = this->addAllComponentsIfResource(selectedObject, footprint, backend)))
67 auto& geom = resource->
geometry(backend);
68 hasFootprint |= this->addComponentFootprint(ent, footprint, geom);
72 bool addComponentFootprint(
74 std::unordered_set<smtk::resource::PersistentObject*>& footprint,
75 std::unique_ptr<smtk::geometry::Geometry>& geom,
76 bool stopRecursingAtGeometry =
true)
const
78 bool hasFootprint =
false;
83 footprint.insert(ent);
85 if (stopRecursingAtGeometry)
95 for (
const auto& member : members)
97 hasFootprint |= this->addComponentFootprint(member.entityRecord().get(), footprint, geom);
100 else if (ent->isModel())
104 for (
const auto& cell : cells)
107 this->addComponentFootprint(cell.entityRecord().get(), footprint, geom,
false);
111 auto groups = model.groups();
112 for (
const auto& group : groups)
114 hasFootprint |= this->addComponentFootprint(group.entityRecord().get(), footprint, geom);
119 auto auxGeoms = model.auxiliaryGeometry();
122 for (
const auto& auxGeom : auxGeoms)
125 this->addComponentFootprint(auxGeom.entityRecord().get(), footprint, geom);
128 else if (ent->isCellEntity())
132 for (
const auto& bdy : bdys)
134 hasFootprint |= this->addComponentFootprint(bdy.entityRecord().get(), footprint, geom);