Chemical Data Processing Library Python API - Version 1.1.1
Public Member Functions | Properties | List of all members
CDPL.Chem.AtomContainer Class Reference

A common interface for data-structures that support a random access to stored Chem.Atom instances. More...

+ Inheritance diagram for CDPL.Chem.AtomContainer:

Public Member Functions

None __init__ ()
 Initializes the AtomContainer instance.
 
Atom getAtom (int idx)
 Returns a reference to the atom at index idx. More...
 
bool containsAtom (Atom atom)
 Tells whether the specified Chem.Atom instance is stored in this container. More...
 
int getAtomIndex (Atom atom)
 Returns the index of the specified Chem.Atom instance in this container. More...
 
int getNumAtoms ()
 Returns the number of stored Chem.Atom objects. More...
 
None orderAtoms (ForceField.InteractionFilterFunction2 func)
 Orders the stored atoms according to criteria implemented by the provided atom comparison function. More...
 
Entity3D getEntity (int idx)
 Returns a reference to the entity at index idx. More...
 
int getNumEntities ()
 Returns the number of stored Chem.Entity3D objects. More...
 
bool __contains__ (Atom atom)
 Returns the result of the membership test operation atom in self. More...
 
Atom __getitem__ (int idx)
 
int __len__ ()
 
- Public Member Functions inherited from CDPL.Chem.Entity3DContainer
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 

Properties

 numAtoms = property(getNumAtoms)
 
- Properties inherited from CDPL.Chem.Entity3DContainer
 objectID = property(getObjectID)
 
 numEntities = property(getNumEntities)
 

Detailed Description

A common interface for data-structures that support a random access to stored Chem.Atom instances.

Implementations have to guarantee that a given Chem.Atom object is stored only once and its index is unique amongst all contained Chem.Atom instances. Otherwise algorithms that rely on this behaviour may not work correctly!

Member Function Documentation

◆ getAtom()

Atom CDPL.Chem.AtomContainer.getAtom ( int  idx)

Returns a reference to the atom at index idx.

Parameters
idxThe zero-based index of the Chem.Atom instance to return.
Returns
A reference to the atom at the specified index.
Exceptions
Base.IndexErrorif the number of atoms is zero or idx is not in the range [0, getNumAtoms() - 1].

Reimplemented in CDPL.Chem.Molecule, CDPL.Chem.MolecularGraph, CDPL.Chem.Bond, and CDPL.Chem.Atom.

◆ containsAtom()

bool CDPL.Chem.AtomContainer.containsAtom ( Atom  atom)

Tells whether the specified Chem.Atom instance is stored in this container.

Parameters
atomThe Chem.Atom instance to look for.
Returns
True if atom is stored in the container, and False otherwise.

Reimplemented in CDPL.Chem.Molecule, CDPL.Chem.MolecularGraph, CDPL.Chem.Bond, and CDPL.Chem.Atom.

◆ getAtomIndex()

int CDPL.Chem.AtomContainer.getAtomIndex ( Atom  atom)

Returns the index of the specified Chem.Atom instance in this container.

Parameters
atomThe Chem.Atom instance for which to return the index.
Returns
The zero-based index of the specified Chem.Atom instance.
Exceptions
Base.ItemNotFoundif the specified Chem.Atom instance could not be found.

Reimplemented in CDPL.Chem.Molecule, CDPL.Chem.MolecularGraph, CDPL.Chem.Bond, and CDPL.Chem.Atom.

◆ getNumAtoms()

int CDPL.Chem.AtomContainer.getNumAtoms ( )

Returns the number of stored Chem.Atom objects.

Returns
The number of stored Chem.Atom objects.

Reimplemented in CDPL.Chem.Molecule, CDPL.Chem.MolecularGraph, CDPL.Chem.Bond, and CDPL.Chem.Atom.

◆ orderAtoms()

None CDPL.Chem.AtomContainer.orderAtoms ( ForceField.InteractionFilterFunction2  func)

Orders the stored atoms according to criteria implemented by the provided atom comparison function.

Parameters
funcThe atom comparison function implementing the applied ordering criteria.

Reimplemented in CDPL.Chem.Molecule, CDPL.Chem.MolecularGraph, CDPL.Chem.Bond, and CDPL.Chem.Atom.

◆ getEntity()

Entity3D CDPL.Chem.AtomContainer.getEntity ( int  idx)

Returns a reference to the entity at index idx.

Parameters
idxThe zero-based index of the Chem.Entity3D instance to return.
Returns
A reference to the entity at the specified index.
Exceptions
Base.IndexErrorif the number of entities is zero or idx is not in the range [0, getNumEntities() - 1].

Reimplemented from CDPL.Chem.Entity3DContainer.

Reimplemented in CDPL.Chem.Molecule, CDPL.Chem.MolecularGraph, CDPL.Chem.Bond, and CDPL.Chem.Atom.

◆ getNumEntities()

int CDPL.Chem.AtomContainer.getNumEntities ( )

Returns the number of stored Chem.Entity3D objects.

Returns
The number of stored Chem.Entity3D objects.

Reimplemented from CDPL.Chem.Entity3DContainer.

Reimplemented in CDPL.Chem.Molecule, CDPL.Chem.MolecularGraph, CDPL.Chem.Bond, and CDPL.Chem.Atom.

◆ __contains__()

bool CDPL.Chem.AtomContainer.__contains__ ( Atom  atom)

Returns the result of the membership test operation atom in self.

Parameters
atomThe value to test for membership.
Returns
The result of the membership test operation.

Reimplemented in CDPL.Chem.Molecule, CDPL.Chem.MolecularGraph, CDPL.Chem.Fragment, CDPL.Chem.ElectronSystem, CDPL.Chem.Bond, and CDPL.Chem.Atom.

◆ __getitem__()

Atom CDPL.Chem.AtomContainer.__getitem__ ( int  idx)

◆ __len__()

int CDPL.Chem.AtomContainer.__len__ ( )