class TransformGraph
Defined at line 24 of file ../../src/ui/scenic/lib/flatland/transform_graph.h
Represents a set of transforms within the scope of a single Flatland instance.
This class is intended to be used as a helper class for the Flatland protocol. As an internal
implementation detail, it does not perform many error checks on its own. For example,
cycles are allowed between any two transforms, and child transforms do not have to be constructed
from this graph. Some invariants are enforced only by DCHECK. Do not give clients direct access
to this class without first filtering inputs and outputs.
Public Methods
void TransformGraph ()
For testing, equivalent to calling TransformGraph(0).
Defined at line 14 of file ../../src/ui/scenic/lib/flatland/transform_graph.cc
void TransformGraph (TransformHandle::InstanceId instance_id)
Defined at line 16 of file ../../src/ui/scenic/lib/flatland/transform_graph.cc
TransformHandle CreateTransform ()
Creates a new transform for use with this graph, and adds it to the graph's internal working
set of transforms. Released descendants of this transform will be kept alive until this
transform is released, or until the edges to the descendants are removed.
Defined at line 19 of file ../../src/ui/scenic/lib/flatland/transform_graph.cc
bool ReleaseTransform (TransformHandle handle)
Releases a transform. If no other transforms reference this transform through an edge, this
transform will appear in the dead_transforms list the next time ComputeAndCleanup() is called.
Returns false if the transform was not created by CreateTransform(), or if the transform has
already been released.
Defined at line 28 of file ../../src/ui/scenic/lib/flatland/transform_graph.cc
bool HasChildren (TransformHandle parent)
Checks to see if the current transform has and child transform handles.
Defined at line 39 of file ../../src/ui/scenic/lib/flatland/transform_graph.cc
bool AddChild (TransformHandle parent, TransformHandle child)
Creates a directed edge from the parent to the child transform. Children are kept alive by
unreleased parents. The parent transform should be an unreleased transform created by calling
CreateTransform() on this object, but this is only enforced by DCHECK. Returns false if the
child transform is already a child of the parent transform.
Defined at line 49 of file ../../src/ui/scenic/lib/flatland/transform_graph.cc
void ~TransformGraph ()
Defined at line 53 of file ../../src/ui/scenic/lib/flatland/transform_graph.h
bool RemoveChild (TransformHandle parent, TransformHandle child)
Removes a directed edge from the parent and child transform. This may result in one or more
transforms being added to the dead_transforms list the next time ComputeAndCleanup() is called.
The parent transform should be an unreleased transform created by calling CreateTransform() on
this object, but this is only enforced by DCHECK. Returns false if the child transform was not
previously a child of the parent transform. This function does not remove priority children.
Defined at line 69 of file ../../src/ui/scenic/lib/flatland/transform_graph.cc
bool ReplaceChildren (TransformHandle parent, std::span<const TransformHandle> new_children)
Removes all child edges from the parent transform, replacing them with transforms from
new_children. The parent transform should be an unreleased transform created by calling
CreateTransform() on this object, but this is only enforced by DCHECK.
Defined at line 90 of file ../../src/ui/scenic/lib/flatland/transform_graph.cc
void ClearChildren (TransformHandle parent)
Removes all child edges from the parent transform. This function does not remove priority
children.
Defined at line 43 of file ../../src/ui/scenic/lib/flatland/transform_graph.cc
void SetPriorityChild (TransformHandle parent, TransformHandle child)
Specifies a directed edge from the parent to the child transform that will always be traversed
first for the parent transform. The TransformGraph does not prevent the new priority child
from being in the normal child set as well. The parent transform should be an unreleased
transform created by calling CreateTransform() on this object, but this is only enforced by
DCHECK.
Defined at line 116 of file ../../src/ui/scenic/lib/flatland/transform_graph.cc
void ClearPriorityChild (TransformHandle parent)
Clears the priority child of a specific parent transform. This may result in one or more
transforms being added to the dead_transforms list the next time ComputeAndCleanup() is
called. The parent transform should be an unreleased transform created by calling
CreateTransform() on this object, but this is only enforced by DCHECK.
Defined at line 124 of file ../../src/ui/scenic/lib/flatland/transform_graph.cc
void ResetGraph (TransformHandle exception)
Clears all data from this entire graph, with one exception. The passed in handle is maintained
as a member of the working set, but with all existing children removed.
This operation results in all handles other than |exception| showing up in dead_transforms on
the next call to ComputeAndCleanup().
Defined at line 131 of file ../../src/ui/scenic/lib/flatland/transform_graph.cc
TopologyData ComputeAndCleanup (TransformHandle start, uint64_t max_iterations)
Generates a topology vector rooted at the "start" transform, as well as additional data
involving dead transforms, cycles, and iterations. See the TopologyData struct for more
information.
If max_iterations is reached, the transform graph will be in an invalid state, and should be
reset before any further methods are called.
Defined at line 139 of file ../../src/ui/scenic/lib/flatland/transform_graph.cc