Chemical Data Processing Library Python API - Version 1.1.1
|
A common interface for data-structures that support a random access to stored Chem.Entity3D instances. More...
Public Member Functions | |
None | __init__ () |
Initializes the Entity3DContainer instance. | |
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... | |
int | getObjectID () |
Returns the numeric identifier (ID) of the wrapped C++ class instance. More... | |
Entity3D | __getitem__ (int idx) |
int | __len__ () |
Properties | |
objectID = property(getObjectID) | |
numEntities = property(getNumEntities) | |
A common interface for data-structures that support a random access to stored Chem.Entity3D instances.
Implementations have to guarantee that a given Chem.Entity3D object is stored only once and its index is unique amongst all contained Chem.Entity3D instances. Otherwise algorithms that rely on this behaviour may not work correctly!
Entity3D CDPL.Chem.Entity3DContainer.getEntity | ( | int | idx | ) |
Returns a reference to the entity at index idx.
idx | The zero-based index of the Chem.Entity3D instance to return. |
Base.IndexError | if the number of entities is zero or idx is not in the range [0, getNumEntities() - 1]. |
Reimplemented in CDPL.Pharm.Pharmacophore, CDPL.Pharm.FeatureContainer, CDPL.Chem.Molecule, CDPL.Chem.MolecularGraph, CDPL.Chem.Bond, CDPL.Chem.AtomContainer, and CDPL.Chem.Atom.
int CDPL.Chem.Entity3DContainer.getNumEntities | ( | ) |
Returns the number of stored Chem.Entity3D objects.
Reimplemented in CDPL.Pharm.Pharmacophore, CDPL.Pharm.FeatureContainer, CDPL.Chem.Molecule, CDPL.Chem.MolecularGraph, CDPL.Chem.Bond, CDPL.Chem.AtomContainer, and CDPL.Chem.Atom.
int CDPL.Chem.Entity3DContainer.getObjectID | ( | ) |
Returns the numeric identifier (ID) of the wrapped C++ class instance.
Different Python Entity3DContainer instances may reference the same underlying C++ class instance. The commonly used Python expression a is not b
thus cannot tell reliably whether the two Entity3DContainer instances a and b reference different C++ objects. The numeric identifier returned by this method allows to correctly implement such an identity test via the simple expression a.getObjectID() != b.getObjectID()
.
Reimplemented in CDPL.ConfGen.CanonicalFragment, and CDPL.Chem.ElectronSystem.
Entity3D CDPL.Chem.Entity3DContainer.__getitem__ | ( | int | idx | ) |
idx |
Reimplemented in CDPL.Pharm.Pharmacophore, CDPL.Pharm.FeatureSet, CDPL.Pharm.FeatureContainer, CDPL.Chem.ElectronSystem, CDPL.Chem.AtomContainer, CDPL.Biomol.HierarchyViewModel, and CDPL.Biomol.HierarchyViewChain.
int CDPL.Chem.Entity3DContainer.__len__ | ( | ) |
Reimplemented in CDPL.Pharm.Pharmacophore, CDPL.Pharm.FeatureSet, CDPL.Pharm.FeatureContainer, CDPL.Chem.Molecule, CDPL.Chem.MolecularGraph, CDPL.Chem.Fragment, CDPL.Chem.ElectronSystem, CDPL.Chem.Bond, CDPL.Chem.AtomContainer, CDPL.Chem.Atom, CDPL.Biomol.HierarchyViewModel, and CDPL.Biomol.HierarchyViewChain.