objects: Manage objects in selection

The objects module keeps track of collections of objects. The most common use is for parsing atom specifiers and tracking what atoms and bonds match.

class Objects(atoms=None, bonds=None, pseudobonds=None, models=None)

Bases: object

Objects is a collection of models and subparts of models such as atoms. They are produced by evaluating command specifiers.

Objects also can include model instances. Currently models and model instances are independent parts of the collection. Probably models and model instances should always contain exactly the same models. But the current semantics are unclear. Models with atoms appear in the models set even if not all the atoms are in the Objects collection. This needs more thought.

Parameters:
atoms : Atoms object
bonds : Bonds object
pseudobonds : Pseudobonds object
models : readonly list of chimerax.core.models.Model
add_atoms(atoms, bonds=False)

Experimental API . Add atoms to collection. If bonds is true also add bonds between specified atoms.

add_bonds(bonds)

Experimental API . Add bonds to collection.

add_model(m)

Experimental API . Add model to collection.

add_model_instances(m, imask)

Experimental API . Add model instances to collection.

add_pseudobonds(pbonds)

Experimental API . Add pseudobonds to collection.

bounds()

Experimental API . Bounds of objects including undisplayed ones in scene coordinates.

displayed()

Experimental API . Return Objects containing only displayed atoms, bonds, pseudobonds and models.

refresh(session)

Experimental API . Remove atoms/bonds/pseudobonds of deleted model.

Returns True if something changed during refresh; False otherwise.