Indicate atoms as aliases for larger functional groups. More...
#include <openbabel/alias.h>
Classes | |
struct | AliasItem |
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 |
Indicate atoms as aliases for larger functional groups.
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.
AliasData | ( | ) | [inline] |
virtual OBGenericData* Clone | ( | OBBase * | ) | const [inline, virtual] |
Reimplemented from OBGenericData.
void SetAlias | ( | const std::string & | alias ) | [inline] |
Add an alias.
void SetAlias | ( | const char * | alias ) | [inline] |
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().
std::string GetColor | ( | ) | const [inline] |
Return the color which has been assigned to this alias.
Referenced by OBDepict::DrawMolecule().
void SetColor | ( | std::string | color ) | [inline] |
Assign a color to this alias.
bool IsExpanded | ( | ) | const [inline] |
Referenced by OBDepict::DrawMolecule(), and AliasData::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.
bool Expand | ( | OBMol & | mol, |
const unsigned int | atomindex | ||
) |
Interprets the alias text and adds atoms as appropriate to mol.
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(), OBMol::FindLSSR(), OBMol::FindSSSR(), OBForceField::GetAtomTypes(), OBMol::GetFormula(), OBMol::GetLSSR(), OBForceField::GetPartialCharges(), OBMol::GetSSSR(), OBDescriptor::PredictAndSave(), and OBMol::SetFormula().
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(), OpenBabel::CalcSignedVolume(), OBMol::FindAngles(), OBMol::FindLSSR(), OBMol::FindSSSR(), OBMol::FindTorsions(), OBMol::GetFormula(), OBMol::GetLSSR(), OBMol::GetSSSR(), OBDescriptor::PredictAndSave(), and OBMol::SetFormula().
virtual const std::string& GetAttribute | ( | ) | const [inline, virtual, inherited] |
Referenced by OBMoleculeFormat::MakeCombinedMolecule().
unsigned int GetDataType | ( | ) | const [inline, inherited] |
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().
virtual DataOrigin GetOrigin | ( | ) | const [inline, virtual, inherited] |
std::string _alias [protected] |
std::string _right_form [protected] |
std::vector<unsigned long> _expandedatoms [protected] |
std::string _color [protected] |
std::string _attr [protected, inherited] |
attribute tag (e.g., "UnitCell", "Comment" or "Author")
Referenced by OBRotamerList::Clone(), and OBNasaThermoData::OBNasaThermoData().
unsigned int _type [protected, inherited] |
attribute type -- declared for each subclass
Referenced by OBRotamerList::Clone(), and OBNasaThermoData::OBNasaThermoData().
DataOrigin _source [protected, inherited] |
source of data for accounting
Referenced by OBChiralData::operator=(), OBTorsionData::operator=(), OBAngleData::operator=(), OBConformerData::operator=(), and OBSymmetryData::operator=().