本文整理汇总了C++中OBAtom::HasAlphaBetaUnsat方法的典型用法代码示例。如果您正苦于以下问题:C++ OBAtom::HasAlphaBetaUnsat方法的具体用法?C++ OBAtom::HasAlphaBetaUnsat怎么用?C++ OBAtom::HasAlphaBetaUnsat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OBAtom
的用法示例。
在下文中一共展示了OBAtom::HasAlphaBetaUnsat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
int SetMM3Type(OBAtom *atom)
{
OBAtom *b; // neighbor
OBBondIterator i, j;
int countNeighborO, countNeighborS, countNeighborN, countNeighborC;
countNeighborO = countNeighborS = countNeighborN = countNeighborC = 0;
// The MM2 typing isn't very good, so we do this ourselves for the most common atom types
switch (atom->GetAtomicNum()) {
case 1: // Hydrogen
b = atom->BeginNbrAtom(j);
if (b->IsCarboxylOxygen())
return 24;
if (b->GetAtomicNum() == OBElements::Sulfur)
return 44;
if (b->GetAtomicNum() == OBElements::Nitrogen) {
if (b->IsAmideNitrogen())
return 28;
if (b->GetValence() > 3)
return 48;// ammonium
return 23; // default amine/imine
}
if (b->GetAtomicNum() == OBElements::Carbon && b->GetHyb() == 1)
return 124; // acetylene
if (b->GetAtomicNum() == OBElements::Oxygen) {
if (b->HasAlphaBetaUnsat())
return 73; // includes non-enol/phenol, but has the right spirit
return 21; // default alcohol
}
return 5; // default H
break;
case 2: // Helium
return 51; break;
case 3: // Li
return 163; break;
case 5: // B
if (atom->GetValence() >= 4)
return 27; // tetrahedral
return 26; break;
case 6: // C
if (atom->IsInRingSize(3)) { // cyclopropane / cyclopropene
if (atom->GetHyb() == 3)
return 22;
if (atom->GetHyb() == 2) {
if (atom->CountFreeOxygens() == 1) // propanone
return 67;
return 38; // propane
}
}
if (atom->IsInRingSize(4)) { // cyclobutane or cyclobutene
if (atom->GetHyb() == 3)
return 56;
if (atom->GetHyb() == 2) {
if (atom->CountFreeOxygens() == 1) // butanone
return 58;
return 57; // regular cyclobutane
}
}
if (atom->CountBondsOfOrder(2) == 2) { // allene
if (atom->CountFreeOxygens() == 1) // ketene
return 106;
return 68;
}
if (atom->GetFormalCharge() == +1)
return 30;
if (atom->GetSpinMultiplicity() == 2)
return 29;
if (atom->GetHyb() == 3)
return 1;
else if (atom->GetHyb() == 2) {
if (atom->CountFreeOxygens() >= 1)
return 3;
return 2;
}
else if (atom->GetHyb() == 1)
return 4;
break;
case 7: // N
// TODO
if (atom->IsAmideNitrogen())
return 151;
if (atom->IsAromatic()) {
if (atom->GetFormalCharge() == 1)
return 111;
if (atom->IsInRingSize(5)) // pyrrole
return 40;
if (atom->IsInRingSize(6)) // pyridine
return 37;
}
if (atom->CountFreeOxygens() == 2) // nitro
//.........这里部分代码省略.........