AliasData Class Reference

Indicate atoms as aliases for larger functional groups. More...

#include <openbabel/alias.h>

Inheritance diagram for AliasData:
OBGenericData

List of all members.

Classes

struct  AliasItem

Public Member Functions

 AliasData ()
virtual OBGenericDataClone (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 (  ) [inline]

Member Function Documentation

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

unsigned int GetDataType (  ) const [inline, inherited]
Returns:
the data type for this object as defined in OBGenericDataType
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]

Member Data Documentation

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


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines