Open Babel
3.0
|
#include <openbabel/bond.h>
Public Types | |
enum | Flag { Aromatic = (1<<1), Ring = (1<<4), Closure = (1<<10) } |
enum | StereoFlag { Wedge = (1<<2), Hash = (1<<3), WedgeOrHash = (1<<11), CisOrTrans = (1<<12) } |
Public Member Functions | |
OBBond () | |
virtual | ~OBBond () |
virtual bool | Clear () |
virtual OBBase * | DoTransformations (const std::map< std::string, std::string > *, OBConversion *) |
template<class T > | |
T * | CastAndClear (bool clear=true) |
virtual const char * | GetTitle (bool replaceNewlines=true) const |
virtual void | SetTitle (const char *) |
Bond modification methods | |
void | SetIdx (int idx) |
void | SetId (unsigned long id) |
void | SetBondOrder (int order) |
void | SetBegin (OBAtom *begin) |
void | SetEnd (OBAtom *end) |
void | SetParent (OBMol *ptr) |
void | SetLength (OBAtom *fixed, double length) |
void | SetLength (double length) |
void | Set (int index, OBAtom *begin, OBAtom *end, int order, int flags) |
void | SetAromatic (bool value=true) |
void | SetWedge (bool value=true) |
void | SetHash (bool value=true) |
void | SetWedgeOrHash (bool value=true) |
void | SetInRing (bool value=true) |
void | SetClosure (bool value=true) |
Bond data request methods | |
unsigned int | GetIdx () const |
unsigned long | GetId () const |
unsigned int | GetBondOrder () const |
unsigned int | GetFlags () const |
unsigned int | GetBeginAtomIdx () const |
unsigned int | GetEndAtomIdx () const |
OBAtom * | GetBeginAtom () |
const OBAtom * | GetBeginAtom () const |
OBAtom * | GetEndAtom () |
const OBAtom * | GetEndAtom () const |
OBAtom * | GetNbrAtom (OBAtom *ptr) |
OBMol * | GetParent () |
double | GetEquibLength () const |
double | GetLength () const |
unsigned int | GetNbrAtomIdx (OBAtom *ptr) |
OBRing * | FindSmallestRing () const |
property request methods | |
bool | IsAromatic () const |
bool | IsInRing () const |
bool | IsRotor (bool includeRingBonds=false) |
bool | IsAmide () |
bool | IsPrimaryAmide () |
bool | IsSecondaryAmide () |
bool | IsTertiaryAmide () |
bool | IsEster () |
bool | IsCarbonyl () |
bool | IsClosure () |
bool | IsWedge () |
bool | IsHash () |
bool | IsWedgeOrHash () const |
bool | IsCisOrTrans () const |
bool | IsDoubleBondGeometry () |
Generic data handling methods (via OBGenericData) | |
bool | HasData (const std::string &) |
bool | HasData (const char *) |
bool | HasData (const unsigned int type) |
void | DeleteData (unsigned int type) |
void | DeleteData (OBGenericData *) |
void | DeleteData (std::vector< OBGenericData *> &) |
bool | DeleteData (const std::string &s) |
void | SetData (OBGenericData *d) |
void | CloneData (OBGenericData *d) |
size_t | DataSize () const |
OBGenericData * | GetData (const unsigned int type) |
OBGenericData * | GetData (const std::string &) |
OBGenericData * | GetData (const char *) |
std::vector< OBGenericData * > & | GetData () |
std::vector< OBGenericData * > | GetData (DataOrigin source) |
std::vector< OBGenericData * > | GetAllData (const unsigned int type) |
OBDataIterator | BeginData () |
OBDataIterator | EndData () |
Static Public Member Functions | |
static const char * | ClassDescription () |
Public Attributes | |
bool | Visit |
Protected Member Functions | |
bool | HasFlag (int flag) const |
void | SetFlag (int flag) |
void | UnsetFlag (int flag) |
Protected Attributes | |
unsigned int | _idx |
OBMol * | _parent |
OBAtom * | _bgn |
OBAtom * | _end |
char | _order |
unsigned short int | _flags |
unsigned long | _id |
std::vector< OBGenericData * > | _vdata |
Bond class.
The OBBond class is straightforward in its data access and modification methods. OBBonds store pointers to the atoms on each end of the bond. In storing pointers to atoms instead of integer indices, the necessity of having to reorder bonds when atoms are shuffled, added, or delete is obviated.
While methods indicate "begin" and "end" atoms in the bond, all methods are designed to be independent of atom ordering, with the exception of stereochemically aware properties such as IsUp(), IsDown(), IsWedge, or IsHash().
enum Flag |
enum StereoFlag |
OBBond | ( | ) |
Constructor.
|
virtual |
Destructor.
|
inlineprotected |
flag
is set.
|
inlineprotected |
Sets the bitwise flag
|
inlineprotected |
Unsets the bitwise flag
|
inline |
Set the internal bond index.
Referenced by OBMol::DeleteBond(), and OBMol::NewBond().
|
inline |
Referenced by OBMol::AddBond(), OBMol::NewBond(), and OBMol::operator+=().
void SetBondOrder | ( | int | order | ) |
Set the bond order to order
(i.e., 1 = single, 2 = double, 5 = aromatic)
Referenced by OpenBabel::alternate(), OBChemTsfm::Apply(), OBBondTyper::AssignFunctionalGroupBonds(), OBBuilder::Connect(), OBMol::ConvertDativeBonds(), OBMol::ConvertZeroBonds(), and OBMol::MakeDativeBonds().
|
inline |
Set the beginning atom of this bond to begin
. Does not update begin
.
Referenced by OBBuilder::Connect().
|
inline |
Set the ending atom of this bond to end
. Does not update end
.
Referenced by OBBuilder::Connect().
|
inline |
Set the parent molecule to ptr
. Does not update parent.
Referenced by OBMol::AddBond(), and OBMol::NewBond().
void SetLength | ( | OBAtom * | fixed, |
double | length | ||
) |
Change the bond length to length
, while keeping fixed
stationary.
Referenced by OBAtom::HtoMethyl().
void SetLength | ( | double | length | ) |
Change the bond length to length
, moving both atoms halfway
Set the main bond information (i.e., when creating a bond)
Mark the main information for a bond
idx | The unique bond index for this bond (inside an OBMol) |
begin | The 'beginning' atom for the bond |
end | The 'end' atom for the bond |
order | The bond order (i.e., 1 = single, 2 = double... 5 = aromatic) |
flags | Any initial property flags |
Referenced by OBMol::AddBond().
|
inline |
Mark that this bond is aromatic. Does not update atoms or validate.
Referenced by OpenBabel::AssignOBAromaticityModel().
|
inline |
Mark that this bond has 2D "wedge" notation (i.e., goes in a positive Z direction from the beginning to end atoms)
Referenced by OBDepict::DrawMolecule().
|
inline |
Mark that this bond has 2D "hash" notation (i.e., goes in a negative Z direction from the beginning to end atoms)
Referenced by OBDepict::DrawMolecule().
|
inline |
Set the WedgeOrHash flag on a bond (??)
|
inline |
Mark that this bond is in a ring. Primarily for internal use.
Referenced by OpenBabel::FindRings().
|
inline |
Mark that this bond indicates a ring closure when walking the molecule.
Referenced by OpenBabel::FindRings().
|
inline |
Referenced by OpenBabel::atomRingToBondRing(), OBMolBondBFSIter::CurrentDepth(), OBMol::DeleteBond(), OpenBabel::FindRings(), OBResidue::GetBonds(), OBRotorList::IsFixedBond(), OpenBabel::NeedsDoubleBond(), OBMolBondBFSIter::OBMolBondBFSIter(), OBMolBondBFSIter::operator++(), and OBChainsParser::PerceiveChains().
|
inline |
|
inline |
Referenced by OBDepict::AddAtomLabels(), OBMol::AddBond(), OBChemTsfm::Apply(), OBResidueData::AssignBonds(), OBBuilder::Build(), OpenBabel::ComparePairSecond(), OBBuilder::Connect(), OBMol::ConvertDativeBonds(), OBBuilder::CorrectStereoAtoms(), OBAtom::CountBondsOfOrder(), OBSmartsMatcher::EvalBondExpr(), AliasData::Expand(), OpenBabel::findMetalloceneBonds(), OBAtom::HasBondOfOrder(), OBAtom::HasNonSingleBond(), OBAtom::HighestBondOrder(), OpenBabel::intToStr(), OBAtom::IsAmideNitrogen(), OpenBabel::isFerroceneBond(), OBMol::MakeDativeBonds(), OBQueryBond::Matches(), OBMol::operator+=(), and OBBuilder::Swap().
|
inline |
Referenced by OBMol::AddBond(), AliasData::Expand(), and OBMol::operator+=().
|
inline |
Referenced by OBMol::AddBond(), OBRingSearch::AddRingFromClosure(), OpenBabel::alternate(), OBAromaticTyper::AssignAromaticFlags(), OBBuilder::CorrectStereoAtoms(), OBRotorRules::GetRotorIncrements(), OpenBabel::intToStr(), OBRing::IsMember(), OBMol::operator+=(), OBChainsParser::PerceiveChains(), OBRotorList::SetEvalAtoms(), and OBConformerSearch::Setup().
|
inline |
Referenced by OBMol::AddBond(), OBRingSearch::AddRingFromClosure(), OpenBabel::alternate(), OBBuilder::CorrectStereoAtoms(), OBRotorRules::GetRotorIncrements(), OpenBabel::intToStr(), OBRing::IsMember(), OBMol::operator+=(), OBChainsParser::PerceiveChains(), OBRotorList::SetEvalAtoms(), and OBConformerSearch::Setup().
|
inline |
Referenced by OBRingSearch::AddRingFromClosure(), OBChemTsfm::Apply(), OBGastChrg::AssignPartialCharges(), OBMol::ConvertZeroBonds(), OBMol::DeleteBond(), OpenBabel::findMetalloceneBonds(), OBMol::FindTorsions(), OBBuilder::GetNewBondVector(), OBRotorRules::GetRotorIncrements(), OBAtom::IsConnected(), OpenBabel::isFerroceneBond(), OBRotorList::IsFixedBond(), OpenBabel::OBBondGetSmallestRingSize(), OBMolBondBFSIter::OBMolBondBFSIter(), OBMolBondBFSIter::operator++(), and OBRotorList::RemoveSymVals().
|
inline |
|
inline |
Referenced by OBRingSearch::AddRingFromClosure(), OBChemTsfm::Apply(), OBGastChrg::AssignPartialCharges(), OBMol::ConvertZeroBonds(), OBMol::DeleteBond(), OpenBabel::findMetalloceneBonds(), OBMol::FindTorsions(), OBRotorRules::GetRotorIncrements(), OBAtom::IsConnected(), OpenBabel::isFerroceneBond(), OBRotorList::IsFixedBond(), OpenBabel::OBBondGetSmallestRingSize(), OBMolBondBFSIter::OBMolBondBFSIter(), OBMolBondBFSIter::operator++(), and OBRotorList::RemoveSymVals().
|
inline |
ptr
(i.e., the end if ptr
is the start) ptr
is not part of the bond, the beginning atom will always be returned Referenced by OpenBabel::ComparePairSecond(), OBMol::ConnectTheDots(), OBMol::ConvertDativeBonds(), OBAtom::CountFreeOxygens(), OBAtom::CountFreeSulfurs(), OpenBabel::FindRings(), OBAtom::GetBond(), OBResidue::GetBonds(), OpenBabel::GetDFFVector(), OBMol::GetGTDVector(), OBAtom::GetHeteroDegree(), OBAtom::GetHvyDegree(), OBBuilder::GetNewBondVector(), OBAtom::IsAmideNitrogen(), OBAtom::IsCarboxylOxygen(), OBAtom::IsHbondDonorH(), OBAtom::IsNitroOxygen(), OBAtom::IsNonPolarHydrogen(), OBAtom::IsOneFour(), OBAtom::IsOneThree(), OBAtom::IsPhosphateOxygen(), OBAtom::IsPolarHydrogen(), OBAtom::IsSulfateOxygen(), OpenBabel::IsSulfoneOxygen(), and OBMol::MakeDativeBonds().
|
inline |
Referenced by OpenBabel::OBBondGetSmallestRingSize().
double GetEquibLength | ( | ) | const |
double GetLength | ( | ) | const |
Referenced by OBMol::ConnectTheDots(), and OBBuilder::CorrectStereoAtoms().
|
inline |
ptr
(i.e., the end if ptr
is the start) ptr
is not part of the bond, the beginning atom index will always be returned Referenced by OpenBabel::ComparePairSecond(), OBMol::ContigFragList(), OBMol::FindLargestFragment(), OpenBabel::GetDFFVector(), and OBMol::GetGTDVector().
OBRing * FindSmallestRing | ( | ) | const |
Find the smallest ring containing this bond (returns a NULL pointer if none exists)
bool IsAromatic | ( | ) | const |
Referenced by OpenBabel::ComparePairSecond(), OBSmartsMatcher::EvalBondExpr(), OpenBabel::findMetalloceneBonds(), and OBQueryBond::Matches().
bool IsInRing | ( | ) | const |
Referenced by OBAromaticTyper::AssignAromaticFlags(), OBBuilder::Connect(), OBBuilder::CorrectStereoAtoms(), OBAtom::CountRingBonds(), OBSmartsMatcher::EvalBondExpr(), OpenBabel::OBBondGetSmallestRingSize(), and OBBuilder::Swap().
bool IsRotor | ( | bool | includeRingBonds = false | ) |
bool IsAmide | ( | ) |
bool IsPrimaryAmide | ( | ) |
bool IsSecondaryAmide | ( | ) |
bool IsTertiaryAmide | ( | ) |
bool IsEster | ( | ) |
Referenced by OBAtom::IsHbondAcceptor().
bool IsCarbonyl | ( | ) |
Referenced by OBBond::IsAmide(), OBBond::IsEster(), OBBond::IsPrimaryAmide(), OBBond::IsSecondaryAmide(), and OBBond::IsTertiaryAmide().
bool IsClosure | ( | ) |
Referenced by OBAromaticTyper::AssignAromaticFlags(), OpenBabel::DetermineFRJ(), OBMol::FindLSSR(), and OBMol::FindSSSR().
|
inline |
Referenced by OBBuilder::GetNewBondVector(), and OpenBabel::intToStr().
|
inline |
Referenced by OBBuilder::GetNewBondVector(), and OpenBabel::intToStr().
|
inline |
|
inline |
bool IsDoubleBondGeometry | ( | ) |
This method checks if the geometry around this bond looks unsaturated by measuring the torsion angles formed by all connected atoms X-start=end-Y and checking that they are close to 0 or 180 degrees
|
virtualinherited |
Clear any and all data associated with this object.
This method can be called by OBConversion::Read() before reading data. Derived classes should be sure to call OBBase::Clear() to remove inherited generic data.
Reimplemented in OBMol, OBAtom, OBReaction, and OBResidue.
Referenced by OBResidue::Clear().
|
inlinevirtualinherited |
Perform a set of transformations specified by the user
Typically these are program options to filter or modify an object For example, see OBMol::DoTransformations() and OBMol::ClassDescription() Base type does nothing
Reimplemented in OBMol.
|
inlinestaticinherited |
|
inlineinherited |
By default clears the object. Called from ReadMolecule of most format classes.
|
inlinevirtualinherited |
Base type does nothing Made virtual around r3535 to simplify code which passes around OBBase*.
Reimplemented in OBMol.
Referenced by OBMoleculeFormat::DoOutputOptions().
|
inlinevirtualinherited |
Reimplemented in OBMol.
Referenced by OBMoleculeFormat::DoOutputOptions().
|
inherited |
Referenced by OBDepict::AddAtomLabels(), OBDepict::DrawMolecule(), AliasData::Expand(), OBForceField::GetAtomTypes(), OBForceField::GetConformers(), OBForceField::GetCoordinates(), OBMol::GetEnergies(), OBMol::GetEnergy(), OBForceField::GetPartialCharges(), OBDescriptor::MatchPairData(), OBMoleculeFormat::ReadChemObjectImpl(), and OBMol::SetEnergies().
|
inherited |
|
inherited |
|
inherited |
Delete any data matching the given OBGenericDataType.
Referenced by OpenBabel::CanonicalLabels(), OBDescriptor::DeleteProperties(), OpenBabel::DeleteStereoOnAtom(), and OBMol::RenumberAtoms().
|
inherited |
Delete the given generic data from this object.
|
inherited |
Delete all of the given generic data from this object.
|
inherited |
Deletes the generic data with the specified attribute, returning false if not found.
|
inlineinherited |
Adds a data object; does nothing if d==NULL.
Referenced by OBGastChrg::AssignPartialCharges(), OBMol::CopySubstructure(), AliasData::Expand(), OBForceField::GetAtomTypes(), OBForceField::GetConformers(), OBForceField::GetCoordinates(), OBMol::GetEnergies(), OBMol::GetEnergy(), OBForceField::GetPartialCharges(), OBMoleculeFormat::MakeCombinedMolecule(), OBDescriptor::PredictAndSave(), AliasData::RevertToAliasForm(), and OBMol::SetEnergies().
|
inherited |
Adds a copy of a data object; does nothing if d == NULL
Referenced by AliasData::Expand().
|
inlineinherited |
|
inherited |
Referenced by OBDepict::AddAtomLabels(), OBDepict::DrawMolecule(), OpenBabel::extract_thermochemistry(), OBDescriptor::FilterCompare(), OpenBabel::GetAtomSymClass(), OBForceField::GetAtomTypes(), OBForceField::GetConformers(), OBForceField::GetCoordinates(), OBForceField::GetPartialCharges(), OBDescriptor::GetValues(), OpenBabel::IsSuppressibleHydrogen(), OBMoleculeFormat::MakeCombinedMolecule(), OBMolAngleIter::OBMolAngleIter(), OBMolRingIter::OBMolRingIter(), OBMolTorsionIter::OBMolTorsionIter(), and OBDescriptor::PredictAndSave().
|
inherited |
|
inherited |
|
inlineinherited |
Referenced by OBMol::GetEnergies(), OBMol::GetEnergy(), and OBMol::SetEnergies().
|
inherited |
|
inherited |
Referenced by OpenBabel::CanonicalLabels(), OBMol::CopySubstructure(), OBBuilder::CorrectStereoAtoms(), OBBuilder::CorrectStereoBonds(), OpenBabel::DeleteStereoOnAtom(), and OBMol::operator+=().
|
inlineinherited |
Referenced by OBMol::AddBond(), OBAtom::Duplicate(), OBMoleculeFormat::MakeCombinedMolecule(), and OBMol::operator=().
|
inlineinherited |
Referenced by OBMol::AddBond(), OBAtom::Duplicate(), OBMoleculeFormat::MakeCombinedMolecule(), and OBMol::operator=().
|
protected |
The molecule which contains me (if any)
|
protected |
I connect one node.
|
protected |
to another node
|
protected |
Bond order (1, 2, 3, 5=aromatic)
|
protected |
Any flags for this bond.
|
protected |
unique id
bool Visit |
Whether this bond has been visited by a graph algorithm.
|
protectedinherited |
Custom data.
Referenced by OBMol::OBMol().