The hierarchy class is identified by the passed string so two hierarchies created with the same initialization string will be the same.
This example shows how to make and use a custom hierarchy:
tr= IMP.core.HierarchyTraits("my hierarchy")
pd= IMP.core.Hierarchy.setup_particle(parent_particle, tr)
for p in children_particles:
cd= IMP.core.Hierarchy.setup_particle(p, tr)
pd.add_child(cd)
pd.show()
Public Member Functions | |
| std::string | get_name () const |
| Get the name used to identify this traits. | |
| HierarchyTraits (std::string name) | |
| Create a HierarchyTraits with the given name. | |
| bool | operator== (const HierarchyTraits &o) const |
Package Functions | |
| template<class T > | |
| void | audit_value (T t) const |
| template<class HD > | |
| unsigned int | get_index (Particle *, HD d) |
| template<class HD > | |
| Particle * | get_value (HD d) const |
| template<class HD > | |
| void | on_add (Particle *p, HD d, unsigned int i) |
| void | on_change (Particle *, Particle *p, unsigned int oi, unsigned int ni) |
| template<class HD > | |
| void | on_remove (Particle *, HD d) |
| const Hierarchy | wrap (Particle *p) const |
Package Attributes | |
| __pad0__:ArrayOnAttributesHelper<ParticleKey | |
| Particle internal::HierarchyData | P |