Open Babel  3.0
Classes | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
AliasData Class Reference

#include <openbabel/alias.h>

Inheritance diagram for AliasData:
OBGenericData

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

AliasData ( )
inline

Member Function Documentation

◆ Clone()

virtual OBGenericData* Clone ( OBBase ) const
inlinevirtual

Reimplemented from OBGenericData.

◆ SetAlias() [1/2]

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

Add an alias.

Referenced by AliasData::RevertToAliasForm().

◆ 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

◆ 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)
inlineinherited

◆ SetOrigin()

void SetOrigin ( const DataOrigin  s)
inlineinherited

◆ GetAttribute()

virtual const std::string& GetAttribute ( ) const
inlinevirtualinherited
Returns
The attribute (key), which can be used to retrieve this data

Referenced by OpenBabel::extract_thermochemistry(), and OBMoleculeFormat::MakeCombinedMolecule().

◆ GetDataType()

unsigned int GetDataType ( ) const
inlineinherited
Returns
the data type for this object as defined in OBGenericDataType

◆ GetValue()

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

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

Reimplemented in OBPairData, and OBCommentData.

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

◆ GetOrigin()

virtual DataOrigin GetOrigin ( ) const
inlinevirtualinherited

Member Data Documentation

◆ _alias

std::string _alias
protected

◆ _right_form

std::string _right_form
protected

◆ _expandedatoms

std::vector<unsigned long> _expandedatoms
protected

◆ _color

std::string _color
protected

◆ _attr

std::string _attr
protectedinherited

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

Referenced by OBRotamerList::Clone(), and OBNasaThermoData::OBNasaThermoData().

◆ _type

unsigned int _type
protectedinherited

attribute type – declared for each subclass

Referenced by OBRotamerList::Clone(), and OBNasaThermoData::OBNasaThermoData().

◆ _source

DataOrigin _source
protectedinherited

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