Loading...
Searching...
No Matches
OBQueryAtom Class Reference
Substructure Searching

`#include <openbabel/query.h>`

Inheritance diagram for OBQueryAtom:
[legend]

## Public Member Functions

| OBQueryAtom (int atomicNum=6, bool isInRing=false, bool isAromatic=false)
virtual | ~OBQueryAtom ()
unsigned int | GetIndex () const
const std::vector< OBQueryBond * > & | GetBonds () const
const std::vector< OBQueryAtom * > & | GetNbrs () const
virtual bool | Matches (const OBAtom *atom) const

## Protected Attributes

unsigned int | m_index
unsigned int | m_atomicNum
bool | m_isInRing
bool | m_isAromatic
std::vector< OBQueryBond * > | m_bonds
std::vector< OBQueryAtom * > | m_nbrs

## Friends

class | OBQuery
class | OBQueryBond

## Detailed Description

Atom in an OBQuery.

The OBQueryAtom class defines an interface for query atoms. The class provides some general methods and properties to access the topology information. The Matches method can be reimplemented in subclasses to get custom matching behavior.

The default Matches implementation only checks the atomic number.

See Substructure Search for more information.

See also
  OBQuery OBQueryBond OBIsomorphismMapper

Since
  version 2.3

## Constructor & Destructor Documentation

## OBQueryAtom()

OBQueryAtom | ( | int | atomicNum = 6,
|  | bool | isInRing = false,
|  | bool | isAromatic = false )

inline

Constructor.

Parameters

  atomicNum | The atomic number for this query atom.
  isInRing | Specify whether the query atom is in a ring. Default is false.
  isAromatic | Specify whether the query atom is aromatic. Default is false.

## ~OBQueryAtom()

virtual ~OBQueryAtom | ( |  | ) |

inline virtual

## Member Function Documentation

## GetIndex()

unsigned int GetIndex | ( |  | ) | const

inline

Get the index for this query atom. Atoms are indexed starting from 0. This method is used by OBIsomorphismMapper implementations.

## GetBonds()

const std::vector< OBQueryBond * > & GetBonds | ( |  | ) | const

inline

Get the query bonds for this atom. This method is used by OBIsomorphismMapper implementations.

Referenced by OBQuery::GetBond().

## GetNbrs()

const std::vector< OBQueryAtom * > & GetNbrs | ( |  | ) | const

inline

Get the neighbor query atoms. This method is used by OBIsomorphismMapper implementations.

Referenced by OBQuery::GetBond().

## Matches()

virtual bool Matches | ( | const OBAtom * | atom | ) | const

inline virtual

This is the match method to verify if an OBQueryAtom and OBAtom class match. The default implementation only checks if the atomic numbers match. Reimplement this method in a subclass for more advances matching. This method is used by OBIsomorphismMapper implementations.

Parameters

  atom | The OBAtom object to compare this OBQueryAtom with.

## Friends And Related Symbol Documentation

## OBQuery

friend class OBQuery

friend

Referenced by OBQuery.

## OBQueryBond

friend class OBQueryBond

friend

Referenced by OBQueryBond.

## Member Data Documentation

## m_index

unsigned int m_index

protected

Referenced by OBQuery::AddAtom(), and GetIndex().

## m_atomicNum

unsigned int m_atomicNum

protected

Referenced by Matches(), and OBQueryAtom().

## m_isInRing

bool m_isInRing

protected

Referenced by Matches(), and OBQueryAtom().

## m_isAromatic

bool m_isAromatic

protected

Referenced by Matches(), and OBQueryAtom().

## m_bonds

std::vector<OBQueryBond*> m_bonds

protected

Referenced by GetBonds().

## m_nbrs

std::vector<OBQueryAtom*> m_nbrs

protected

Referenced by GetNbrs().

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

- query.h