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

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

+ Inheritance diagram for CDPL.Chem.Entity3DContainer:

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)
 

Detailed Description

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!

Member Function Documentation

◆ getEntity()

Entity3D CDPL.Chem.Entity3DContainer.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 in CDPL.Pharm.Pharmacophore, CDPL.Pharm.FeatureContainer, CDPL.Chem.Molecule, CDPL.Chem.MolecularGraph, CDPL.Chem.Bond, CDPL.Chem.AtomContainer, and CDPL.Chem.Atom.

◆ getNumEntities()

int CDPL.Chem.Entity3DContainer.getNumEntities ( )

◆ getObjectID()

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().

Returns
The numeric ID of the internally referenced C++ class instance.

Reimplemented in CDPL.ConfGen.CanonicalFragment, and CDPL.Chem.ElectronSystem.

◆ __getitem__()

Entity3D CDPL.Chem.Entity3DContainer.__getitem__ ( int  idx)

◆ __len__()

int CDPL.Chem.Entity3DContainer.__len__ ( )