IMP logo
IMP Reference Guide  2.22.0
The Integrative Modeling Platform
IMP::core::HierarchyTraits Class Reference

Define the type for a type of hierarchy. More...

#include <IMP/core/Hierarchy.h>

Detailed Description

Define the type for a type of hierarchy.

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:

1 ## \example core/custom_hierarchy.py
2 # This example shows how to create and use a custom hierarchy of particles.
3 
4 import IMP
5 import IMP.core
6 import sys
7 
8 IMP.setup_from_argv(sys.argv, "custom hierarchy")
9 
10 
11 def custom_hierarchy(parent_particle, children_particles):
12  tr = IMP.core.HierarchyTraits("my hierarchy")
13  pd = IMP.core.Hierarchy.setup_particle(parent_particle, tr)
14  for p in children_particles:
16  pd.add_child(cd)
17  pd.show()
18 
19 
20 m = IMP.Model()
21 p1 = IMP.Particle(m)
22 p2 = IMP.Particle(m)
23 p3 = IMP.Particle(m)
24 custom_hierarchy(p1, (p2, p3))
See Also
Hierarchy

Definition at line 50 of file core/Hierarchy.h.

Public Member Functions

 HierarchyTraits (std::string name)
 Create a HierarchyTraits with the given name. More...
 
ParticleIndexesKey get_children_key () const
 
ParticleIndexKey get_parent_key () const
 
bool operator== (const HierarchyTraits &o) const
 
void show (std::ostream &out=std::cout) const
 

Constructor & Destructor Documentation

IMP::core::HierarchyTraits::HierarchyTraits ( std::string  name)

Create a HierarchyTraits with the given name.


The documentation for this class was generated from the following file: