AllView#
- class blueprints.AllView[source]#
Bases:
AllViewType,ViewThe AllView is analogous to the
Viewfor all descendants instead of children. Attribute getting and setting is handeled for all valid descendants. A ThingsType attribute is then converted back to a normal view.XML Structure:#<body name="A"> <body name="B" /> <geom mass="42.0" type="sphere" name="C" /> </body>
Children and Descendants View Comparison:#>>> world.bodies View[1|anonymous_model.bodies] >>> world.bodies.name ['A'] >>> world.all View[3|anonymous_model.all] >>> world.all.name ['A', 'B', 'C'] >>> world.all.bodies View[2|anonymous_model.all.bodies] >>> world.bodies.name ['A', 'B']
If only some descendants have a certain attribute, the view restricts to this valid subset. For example, only
Geomshave mass, so retrievingall.massexcludes all non-Geoms.Children and Descendants View Comparison:#>>> world.all.mass [42.0]
- __init__(descendants, parent)[source]#
- Parameters:
descendants (
dict) – The descendants property invoked onparentparent (
blue.ThingType) – The parent Thing from which.allwas retrieved.
- Return type:
None
- classmethod __new__(*args, **kwargs)#