OEGroupBase

class OEGroupBase  : public OESystem::OEBase

The OEGroupBase class is the abstract interface for representing a ‘group’ container that can store atom and bond pointers of a molecule.

The following methods are publicly inherited from OEBase:

operator= GetData IsDataType
operator+= GetDataIter SetBaseData
AddBaseData GetDataType SetBoolData
AddData GetDoubleData SetData
Clear GetFloatData SetDoubleData
CreateCopy GetIntData SetFloatData
DeleteData GetStringData SetIntData
GetBoolData HasData SetStringData

AddAtom

bool AddAtom(OEAtomBase *atom)=0

Adds an atom to the group. A group can hold only atoms that belong to the same molecule on which the group is created.

See also

AddBond

bool AddBond(OEBondBase *bond)=0

Adds a bond to the group. A group can hold only bonds that belong to the same molecule on which the group is created.

See also

Clear

void Clear()=0

This method removes all atoms (OEAtomBase) and bonds (OEBondBase) that are stored in the group.

DeleteAtom

bool DeleteAtom(OEAtomBase *atom)=0

Deletes an atom from a group. Returns true if the atom was successfully removed.

DeleteBond

bool DeleteBond(OEBondBase *bond)=0

Deletes a bond from a group. Returns true if the bond was successfully removed.

GetAtoms

OESystem::OEIterBase<OEAtomBase> *GetAtoms() const =0

Returns an iterator over all the atoms in the group.

OESystem::OEIterBase<OEAtomBase> *
  GetAtoms(const OESystem::OEUnaryPredicate<OEChem::OEAtomBase> &) const =0

Returns an iterator over all of the atoms in the group that match the specified atom predicate (OEUnaryPredicate).

GetBonds

OESystem::OEIterBase<OEBondBase> *GetBonds() const =0

Returns an iterator over all the bonds in the group.

OESystem::OEIterBase<OEBondBase> *
  GetBonds(const OESystem::OEUnaryPredicate<OEChem::OEBondBase> &) const =0

Returns an iterator over all bonds in the group that match the specified bond predicate (OEUnaryPredicate).

GetGroupDefinition

bool GetGroupDefinition(OEChem::OEAtomBondSet &) const =0

Returns the entire group definition as an OEAtomBondSet.

GetParent

const OEMolBase *GetParent() const =0

Returns the parent molecule of a group. All OEGroupBases are created as a container of an OEMolBase. This method can be used to determine the molecule of which atoms and bonds the group stores. The ‘parent molecule’ property of a group cannot be altered, as its determined at the point the group is created.

GetGroupType

unsigned int GetGroupType() const =0

Returns the type of the group.

See also

HasAtom

bool HasAtom(const OEAtomBase *atom) const =0

Returns true if the given atom belongs to the group.

HasBond

bool HasBond(const OEBondBase *bond) const =0

Returns true if the given bond belongs to the group.

IsDeleted

bool IsDeleted() const =0

Returns true if the group has been deleted or if all atom and bonds have been removed from the group i.e. if the group is empty.

IsEmpty

bool IsEmpty() const =0

Returns true if all atom and bonds have been removed from the group, i.e. if the group is empty.

NumAtoms

unsigned int NumAtoms() const =0

Returns the number of atoms in the group.

NumBonds

unsigned int NumBonds() const =0

Returns the number of bonds in the group.

SetGroupType

void SetGroupType(unsigned int)=0

Sets the type of the group.

See also

Sweep

bool Sweep()=0

Removes atoms and bonds from the group for which the OEAtomBase.IsDeleted method and the OEBondBase.IsDeleted method returns true, respectively.