11 #ifndef smtk_markup_SelectionFootprint_h
12 #define smtk_markup_SelectionFootprint_h
14 #include "smtk/geometry/queries/SelectionFootprint.h"
16 #include "smtk/geometry/Geometry.h"
18 #include "smtk/markup/Component.h"
20 #include <unordered_set>
31 :
public smtk::resource::query::
32 DerivedFrom<SelectionFootprint, smtk::geometry::SelectionFootprint>
44 std::unordered_set<smtk::resource::PersistentObject*>& footprint,
48 if ((hasFootprint = this->addAllComponentsIfResource(selectedObject, footprint, backend)))
62 auto& geom = resource->
geometry(backend);
63 hasFootprint |= this->addComponentFootprint(node, footprint, geom);
67 bool addComponentFootprint(
69 std::unordered_set<smtk::resource::PersistentObject*>& footprint,
70 std::unique_ptr<smtk::geometry::Geometry>& geom,
71 bool stopRecursingAtGeometry =
true)
const
73 bool hasFootprint =
false;
78 footprint.insert(node);
80 if (stopRecursingAtGeometry)
87 if (
auto* group =
dynamic_cast<Group*
>(node))
89 group->outgoing<arcs::GroupsToMembers>().visit(
90 [
this, &hasFootprint, &geom, &footprint, &stopRecursingAtGeometry](
92 hasFootprint |= this->addComponentFootprint(
96 stopRecursingAtGeometry);
99 else if (
auto* field =
dynamic_cast<Field*
>(node))
101 field->outgoing<arcs::FieldsToShapes>().visit(
102 [
this, &hasFootprint, &geom, &footprint, &stopRecursingAtGeometry](
104 hasFootprint |= this->addComponentFootprint(
108 stopRecursingAtGeometry);
111 else if (
auto* oid =
dynamic_cast<OntologyIdentifier*
>(node))
113 oid->subjects().visit([
this, &hasFootprint, &geom, &footprint, &stopRecursingAtGeometry](
115 hasFootprint |= this->addComponentFootprint(
119 stopRecursingAtGeometry);