IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
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:

## \example core/custom_hierarchy.py
# This example shows how to create and use a custom hierarchy of particles.
import IMP
import IMP.core
import sys
IMP.setup_from_argv(sys.argv, "custom hierarchy")
def custom_hierarchy(parent_particle, children_particles):
tr = IMP.core.HierarchyTraits("my hierarchy")
pd = IMP.core.Hierarchy.setup_particle(parent_particle, tr)
for p in children_particles:
pd.add_child(cd)
pd.show()
m = IMP.Model()
p1 = IMP.Particle(m)
p2 = IMP.Particle(m)
p3 = IMP.Particle(m)
custom_hierarchy(p1, (p2, p3))
Class for storing model, its restraints, constraints, and particles.
Definition Model.h:111
Class to handle individual particles of a Model object.
Definition Particle.h:45
Define the type for a type of hierarchy.
static Hierarchy setup_particle(Model *m, ParticleIndex pi, DecoratorTraits tr=get_default_decorator_traits())
Basic functionality that is expected to be used by a wide variety of IMP users.
void setup_from_argv(int argc, char **argv, std::string description)
Parse the command line flags and return the positional arguments.
custom_hierarchy
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.
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

◆ HierarchyTraits() [1/2]

IMP::core::HierarchyTraits::HierarchyTraits ( )

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

◆ HierarchyTraits() [2/2]

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

Create a HierarchyTraits with the given name.

Member Function Documentation

◆ get_children_key()

ParticleIndexesKey IMP::core::HierarchyTraits::get_children_key ( ) const

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

◆ get_parent_key()

ParticleIndexKey IMP::core::HierarchyTraits::get_parent_key ( ) const

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

◆ operator==()

bool IMP::core::HierarchyTraits::operator== ( const HierarchyTraits & o) const

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


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