class Snapshot
Defined at line 83 of file ../../src/ui/scenic/lib/view_tree/snapshot_types.h
Output of ViewTreeSnapshotter.
Snapshot of a ViewTree
Public Members
zx_koid_t root
unordered_map view_tree
unordered_set unconnected_views
vector hit_testers
Public Methods
std::vector<zx_koid_t> HitTest (zx_koid_t start_node, glm::vec2 world_space_point, bool is_semantic)
Perform a hit test on |snapshot| starting from |start_node|.
Returns a list of hit views in order of increasing distance.
Recursively called on each tree boundary, so that the result is a full traversal of the tree.
|start_node| defines the root of the hit testing tree walk. It can be any arbitrary node.
|world_space_point| defines the hit point in the coordinate space of the injector's |target|,
which is a descendant of the |context|. |target| and |start_node| should refer to the same
view.
|is_semantic| defines if this is a semantic hit test, and this if it should follow the special
accessibility hit testing rules or not.
Complexity is O(number of subtrees * O(hit_testers))
Defined at line 13 of file ../../src/ui/scenic/lib/view_tree/snapshot_types.cc
bool IsDescendant (zx_koid_t descendant_koid, zx_koid_t ancestor_koid)
Given a node's KOID, return true if it transitively connects to node with |ancestor_koid| via
parent references.
- This operation is O(N) in the depth of the view tree.
Defined at line 52 of file ../../src/ui/scenic/lib/view_tree/snapshot_types.cc
std::vector<zx_koid_t> GetAncestorsOf (zx_koid_t koid)
Given a node's koid, return the list of all ancestors, ordered from closest to most distant.
Precondition: |koid| must exist in the |view_tree|.
Defined at line 69 of file ../../src/ui/scenic/lib/view_tree/snapshot_types.cc
std::optional<glm::mat4> GetViewFromWorldTransform (zx_koid_t view_ref_koid)
Returns the transform from world space to view space.
Defined at line 88 of file ../../src/ui/scenic/lib/view_tree/snapshot_types.cc
std::optional<glm::mat4> GetWorldFromViewTransform (zx_koid_t view_ref_koid)
Returns the transform from view space to world space.
Defined at line 95 of file ../../src/ui/scenic/lib/view_tree/snapshot_types.cc
std::optional<glm::mat4> GetDestinationViewFromSourceViewTransform (zx_koid_t source, zx_koid_t destination)
Returns the transform from source view space to destination view space.
Defined at line 104 of file ../../src/ui/scenic/lib/view_tree/snapshot_types.cc
bool operator== (const Snapshot & other)
Defined at line 125 of file ../../src/ui/scenic/lib/view_tree/snapshot_types.h