NuriKit v0.1.0b2
Loading...
Searching...
No Matches
nuri::AtomData Class Reference

#include <nuri/core/molecule.h>

Public Member Functions

 AtomData ()
 Creates a dummy atom with unknown hybridization.
 AtomData (const Element &element, int implicit_hydrogens=0, int formal_charge=0, constants::Hybridization hyb=constants::kOtherHyb, double partial_charge=0.0, int mass_number=-1, bool is_aromatic=false, bool is_in_ring=false, bool is_chiral=false, bool is_clockwise=false)
int atomic_number () const
 Get the atomic number of the atom.
double atomic_weight () const
 Get the atomic weight of the atom.
std::string_view element_symbol () const
 Get the element symbol of the atom.
std::string_view element_name () const
 Get the element name of the atom.
AtomDataset_element (const Element &element)
 Change the element of the atom.
AtomDataset_element (int atomic_number)
 Set the element of the atom by atomic number.
const Elementelement () const noexcept
 Get the element data of the atom.
const Isotopeisotope () const
 Get the isotope of the atom.
AtomDataset_isotope (const Isotope &isotope)
 Set explicit isotope of the atom.
AtomDataset_isotope (int mass_number)
 Set explicit isotope of the atom by mass number.
internal::Nullable< const Isotope * > explicit_isotope () const
 Get the explicitly set isotope of the atom.
AtomDataset_hybridization (constants::Hybridization hyb)
constants::Hybridization hybridization () const
AtomDataset_implicit_hydrogens (int implicit_hydrogens)
 Set the number of implicit hydrogen atoms.
int implicit_hydrogens () const
 Get the number of implicit hydrogen atoms.
AtomDataset_aromatic (bool is_aromatic)
bool is_aromatic () const
AtomDataset_conjugated (bool is_conjugated)
bool is_conjugated () const
AtomDataset_ring_atom (bool is_ring_atom)
bool is_ring_atom () const
AtomDataset_chiral (bool is_chiral)
bool is_chiral () const
AtomDataset_clockwise (bool is_clockwise)
bool is_clockwise () const
 Get handedness of a chiral atom.
AtomFlags flags () const
AtomDataadd_flags (AtomFlags flags)
AtomDatadel_flags (AtomFlags flags)
AtomDatareset_flags ()
AtomDataset_partial_charge (double charge)
double partial_charge () const
AtomDataset_formal_charge (int charge)
int formal_charge () const
std::string_view get_name () const
template<class ST>
AtomDataset_name (ST &&name)
template<class KT, class VT>
AtomDataadd_prop (KT &&key, VT &&val)
internal::PropertyMap & props ()
const internal::PropertyMap & props () const

Friends

bool operator== (const AtomData &lhs, const AtomData &rhs)

Constructor & Destructor Documentation

◆ AtomData() [1/2]

nuri::AtomData::AtomData ( )
inline

Creates a dummy atom with unknown hybridization.

◆ AtomData() [2/2]

nuri::AtomData::AtomData ( const Element & element,
int implicit_hydrogens = 0,
int formal_charge = 0,
constants::Hybridization hyb = constants::kOtherHyb,
double partial_charge = 0.0,
int mass_number = -1,
bool is_aromatic = false,
bool is_in_ring = false,
bool is_chiral = false,
bool is_clockwise = false )

Member Function Documentation

◆ add_flags()

AtomData & nuri::AtomData::add_flags ( AtomFlags flags)
inline

◆ add_prop()

template<class KT, class VT>
AtomData & nuri::AtomData::add_prop ( KT && key,
VT && val )
inline

◆ atomic_number()

int nuri::AtomData::atomic_number ( ) const
inline

Get the atomic number of the atom.

Note
This is equivalent to element().Element::atomic_number(), provided for convenience.
Returns
The atomic number of the element.

◆ atomic_weight()

double nuri::AtomData::atomic_weight ( ) const
inline

Get the atomic weight of the atom.

Note
This is equivalent to element().Element::atomic_weight(), provided for convenience.
Returns
The atomic weight of the element.

◆ del_flags()

AtomData & nuri::AtomData::del_flags ( AtomFlags flags)
inline

◆ element()

const Element & nuri::AtomData::element ( ) const
inlinenoexcept

Get the element data of the atom.

Returns
Immutable reference to the element object.

◆ element_name()

std::string_view nuri::AtomData::element_name ( ) const
inline

Get the element name of the atom.

Note
This is equivalent to element().Element::name(), provided for convenience.
Returns
The name of the element.

◆ element_symbol()

std::string_view nuri::AtomData::element_symbol ( ) const
inline

Get the element symbol of the atom.

Note
This is equivalent to element().Element::symbol(), provided for convenience.
Returns
The symbol of the element.

◆ explicit_isotope()

internal::Nullable< const Isotope * > nuri::AtomData::explicit_isotope ( ) const
inline

Get the explicitly set isotope of the atom.

Returns
A pointer to the explicitly set isotope object. If none was explicitly given, returns nullptr. Normally isotope() would be the preferred method to get the isotope, which returns the representative isotope of the element if none was explicitly given.
See also
isotope()

◆ flags()

AtomFlags nuri::AtomData::flags ( ) const
inline

◆ formal_charge()

int nuri::AtomData::formal_charge ( ) const
inline

◆ get_name()

std::string_view nuri::AtomData::get_name ( ) const
inline

◆ hybridization()

constants::Hybridization nuri::AtomData::hybridization ( ) const
inline

◆ implicit_hydrogens()

int nuri::AtomData::implicit_hydrogens ( ) const
inline

Get the number of implicit hydrogen atoms.

Returns
The number of implicit hydrogen atoms.
Note
The number of implicit hydrogen atoms is always non-negative.

◆ is_aromatic()

bool nuri::AtomData::is_aromatic ( ) const
inline

◆ is_chiral()

bool nuri::AtomData::is_chiral ( ) const
inline

◆ is_clockwise()

bool nuri::AtomData::is_clockwise ( ) const
inline

Get handedness of a chiral atom.

Precondition
is_chiral() == true, otherwise return value would be meaningless.
Returns
Whether the chiral atom is "clockwise." See stereochemistry definition of SMILES for more information.
Note
Unlike the SMILES convention, implicit hydrogen is placed at the end of the neighbor list. This is to ensure that the chirality of the atom is unchanged when the hydrogen is removed or added.

◆ is_conjugated()

bool nuri::AtomData::is_conjugated ( ) const
inline

◆ is_ring_atom()

bool nuri::AtomData::is_ring_atom ( ) const
inline

◆ isotope()

const Isotope & nuri::AtomData::isotope ( ) const
inline

Get the isotope of the atom.

Returns
A const reference to the isotope object. If any isotope was explicitly given, returns that isotope. Otherwise, returns the representative isotope of the element.
See also
explicit_isotope()

◆ partial_charge()

double nuri::AtomData::partial_charge ( ) const
inline

◆ props() [1/2]

internal::PropertyMap & nuri::AtomData::props ( )
inline

◆ props() [2/2]

const internal::PropertyMap & nuri::AtomData::props ( ) const
inline

◆ reset_flags()

AtomData & nuri::AtomData::reset_flags ( )
inline

◆ set_aromatic()

AtomData & nuri::AtomData::set_aromatic ( bool is_aromatic)
inline

◆ set_chiral()

AtomData & nuri::AtomData::set_chiral ( bool is_chiral)
inline

◆ set_clockwise()

AtomData & nuri::AtomData::set_clockwise ( bool is_clockwise)
inline

◆ set_conjugated()

AtomData & nuri::AtomData::set_conjugated ( bool is_conjugated)
inline

◆ set_element() [1/2]

AtomData & nuri::AtomData::set_element ( const Element & element)
inline

Change the element of the atom.

Parameters
elementA reference to the new element object.
Returns
*this.

◆ set_element() [2/2]

AtomData & nuri::AtomData::set_element ( int atomic_number)
inline

Set the element of the atom by atomic number.

Parameters
atomic_numberThe atomic number of the new element.
Returns
*this.
Note
When the atomic number is out of range, the behavior is undefined.

◆ set_formal_charge()

AtomData & nuri::AtomData::set_formal_charge ( int charge)
inline

◆ set_hybridization()

AtomData & nuri::AtomData::set_hybridization ( constants::Hybridization hyb)
inline

◆ set_implicit_hydrogens()

AtomData & nuri::AtomData::set_implicit_hydrogens ( int implicit_hydrogens)
inline

Set the number of implicit hydrogen atoms.

Parameters
implicit_hydrogensThe new number of implicit hydrogen atoms.
Returns
*this.
Note
If the number of implicit hydrogen atoms is negative, the behavior is undefined.

◆ set_isotope() [1/2]

AtomData & nuri::AtomData::set_isotope ( const Isotope & isotope)
inline

Set explicit isotope of the atom.

Parameters
isotopeA reference to the new isotope object.
Returns
*this.
Note
If the isotope object references an element different from the element of the atom, the behavior is undefined.

◆ set_isotope() [2/2]

AtomData & nuri::AtomData::set_isotope ( int mass_number)
inline

Set explicit isotope of the atom by mass number.

Parameters
mass_numberThe mass number of the new isotope.
Returns
*this.
Note
If no isotope with the given mass number is known, explicitly-set isotope of this atom will be cleared.

◆ set_name()

template<class ST>
AtomData & nuri::AtomData::set_name ( ST && name)
inline

◆ set_partial_charge()

AtomData & nuri::AtomData::set_partial_charge ( double charge)
inline

◆ set_ring_atom()

AtomData & nuri::AtomData::set_ring_atom ( bool is_ring_atom)
inline

◆ operator==

bool operator== ( const AtomData & lhs,
const AtomData & rhs )
friend

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