Loading...
Searching...
No Matches
AliasData Class Reference

`#include <openbabel/alias.h>`

Inheritance diagram for AliasData:
[legend]

## Public Member Functions

| AliasData ()
virtual OBGenericData * | Clone (OBBase *) const
void | SetAlias (const std::string &alias)
void | SetAlias (const char *alias)
std::string | GetAlias (bool rightAligned=false) const
std::string | GetColor () const
void | SetColor (std::string color)
bool | IsExpanded () const
bool | Expand (OBMol &mol, const unsigned int atomindex)
void | SetAttribute (const std::string &v)
void | SetOrigin (const DataOrigin s)
virtual const std::string & | GetAttribute () const
unsigned int | GetDataType () const
virtual const std::string & | GetValue () const
virtual DataOrigin | GetOrigin () const

## Static Public Member Functions

static void | RevertToAliasForm (OBMol &mol)

## Protected Attributes

std::string | _alias
std::string | _right_form
std::vector< unsigned long > | _expandedatoms
std::string | _color
std::string | _attr
unsigned int | _type
DataOrigin | _source

## Detailed Description

Indicate atoms as aliases for larger functional groups.

Since
  version 2.2

An object of this class can be attached to an OBAtom if it is considered to be a placeholder for an alias, such as Ph, COOH, etc.

If the alias has not been interpreted chemically (expanded), the element type of the placeholder atom should be set to Xx so that the molecule is not interpreted incorrectly by formats which do not consider this class.

If the alias has been interpreted chemically (which formats, etc. should normally do immediately), the alias may remain as extra information or as a hint for an alternative representation, for example to a chemical drawing program. The _expandedatoms vector would then contains the ids of the atoms to which the alias is an alternative.

## Constructor & Destructor Documentation

## AliasData()

AliasData | ( |  | ) |

inline

Referenced by Clone(), and RevertToAliasForm().

## Member Function Documentation

## Clone()

virtual OBGenericData * Clone | ( | OBBase * |  | ) | const

inline virtual

Reimplemented from OBGenericData.

## SetAlias() [1/2]

void SetAlias | ( | const std::string & | alias | ) |

inline

Add an alias.

## SetAlias() [2/2]

void SetAlias | ( | const char * | alias | ) |

inline

## GetAlias()

std::string GetAlias | ( | bool | rightAligned = false | ) | const

/return value of alias or its version intended to be connected at its right hand end.

Referenced by OBDepict::DrawMolecule().

## GetColor()

std::string GetColor | ( |  | ) | const

inline

Return the color which has been assigned to this alias.

Referenced by OBDepict::DrawMolecule().

## SetColor()

void SetColor | ( | std::string | color | ) |

inline

Assign a color to this alias.

## IsExpanded()

bool IsExpanded | ( |  | ) | const

inline

Referenced by OBDepict::DrawMolecule(), and RevertToAliasForm().

## RevertToAliasForm()

void RevertToAliasForm | ( | OBMol & | mol | ) |

static

Converts all the expanded aliases in a molecule to the alias form. Note that this deletes atoms and bonds. Use only as a preparation for display.

## Expand()

bool Expand | ( | OBMol & | mol,
|  | const unsigned int | atomindex )

Interprets the alias text and adds atoms as appropriate to mol.

## SetAttribute()

void SetAttribute | ( | const std::string & | v | ) |

inline inherited

Set the attribute (key), which can be used to retrieve this data.

Referenced by OBGastChrg::AssignPartialCharges(), OBMol::DoTransformations(), AliasData::Expand(), OBMol::FindLSSR(), OBMol::FindSSSR(), OBForceField::GetAtomTypes(), OBMol::GetFormula(), OBMol::GetLSSR(), OBForceField::GetPartialCharges(), OBMol::GetSSSR(), OBDescriptor::PredictAndSave(), and OBMol::SetFormula().

## SetOrigin()

void SetOrigin | ( | const DataOrigin | s | ) |

inline inherited

Set the origin of this data, which can be used to filter the data.

Referenced by OBGastChrg::AssignPartialCharges(), OBMol::DoTransformations(), OBMol::FindAngles(), OBMol::FindLSSR(), OBMol::FindSSSR(), OBMol::FindTorsions(), OBMol::GetFormula(), OBMol::GetLSSR(), OBMol::GetSSSR(), OBDescriptor::PredictAndSave(), and OBMol::SetFormula().

## GetAttribute()

virtual const std::string & GetAttribute | ( |  | ) | const

inline virtual inherited

Returns
  The attribute (key), which can be used to retrieve this data

Referenced by OBMoleculeFormat::MakeCombinedMolecule().

## GetDataType()

unsigned int GetDataType | ( |  | ) | const

inline inherited

Returns
  the data type for this object as defined in OBGenericDataType

## GetValue()

virtual const std::string & GetValue | ( |  | ) | const

inline virtual inherited

Base class returns a default value (the attribute type) but should never be called.

Reimplemented in OBCommentData, and OBPairData.

Referenced by OBDepict::DrawMolecule(), OBDescriptor::FilterCompare(), and OBDescriptor::GetValues().

## GetOrigin()

virtual DataOrigin GetOrigin | ( |  | ) | const

inline virtual inherited

## Member Data Documentation

## _alias

std::string _alias

protected

Referenced by Expand(), GetAlias(), SetAlias(), and SetAlias().

## _right_form

std::string _right_form

protected

Referenced by Expand(), and GetAlias().

## _expandedatoms

std::vector<unsigned long> _expandedatoms

protected

Referenced by IsExpanded().

## _color

std::string _color

protected

Referenced by GetColor(), and SetColor().

## _attr

std::string _attr

protected inherited

attribute tag (e.g., "UnitCell", "Comment" or "Author")

Referenced by OBRotamerList::Clone(), GetAttribute(), GetValue(), OBGenericData(), OBNasaThermoData::OBNasaThermoData(), OBRotamerList::OBRotamerList(), OBSymmetryData::OBSymmetryData(), and SetAttribute().

## _type

unsigned int _type

protected inherited

attribute type – declared for each subclass

Referenced by OBRotamerList::Clone(), GetDataType(), OBGenericData(), OBNasaThermoData::OBNasaThermoData(), OBRotamerList::OBRotamerList(), and OBSymmetryData::OBSymmetryData().

## _source

DataOrigin _source

protected inherited

source of data for accounting

Referenced by GetOrigin(), OBGenericData(), OBSymmetryData::OBSymmetryData(), OBAngleData::operator=(), OBConformerData::operator=(), OBSymmetryData::operator=(), OBTorsionData::operator=(), and SetOrigin().

The documentation for this class was generated from the following files:

- alias.h
- alias.cpp