本文整理汇总了C++中openbabel::OBAtom::x方法的典型用法代码示例。如果您正苦于以下问题:C++ OBAtom::x方法的具体用法?C++ OBAtom::x怎么用?C++ OBAtom::x使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openbabel::OBAtom
的用法示例。
在下文中一共展示了OBAtom::x方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parent
std::list<OpenBabel::OBAtom*>
_hAccGetNeighbors(OpenBabel::OBAtom* a)
{
std::list<OpenBabel::OBAtom*> aList;
OpenBabel::OBMol* parent(a->GetParent());
double r;
OpenBabel::OBElementTable et;
std::vector<OpenBabel::OBAtom*>::iterator ai;
for (OpenBabel::OBAtom* aa = parent->BeginAtom(ai); aa; aa = parent->NextAtom(ai))
{
if (*aa == a)
{
continue;
}
r = et.GetVdwRad(aa->GetAtomicNum());
double delta(H_BOND_DIST + H_RADIUS + r);
double maxDistSq(delta*delta);
double distSq((a->x() - aa->x()) * (a->x() - aa->x()) +
(a->y() - aa->y()) * (a->y() - aa->y()) +
(a->z() - aa->z()) * (a->z() - aa->z()));
if (distSq <= maxDistSq)
{
aList.push_back(aa);
}
}
return aList;
}
示例2: nbrBonds
Coordinate
_hDonCalcNormal(OpenBabel::OBAtom* a)
{
int nbrBonds(0);
Coordinate normal;
std::vector<OpenBabel::OBBond*>::iterator bi;
for (OpenBabel::OBBond* b = a->BeginBond(bi); b; b = a->NextBond(bi))
{
OpenBabel::OBAtom* aa = b->GetNbrAtom(a);
if (aa->GetAtomicNum() == 1)
{
continue;
}
++nbrBonds;
normal.x += (aa->x() - a->x());
normal.y += (aa->y() - a->y());
normal.z += (aa->z() - a->z());
}
double length(sqrt(normal.x*normal.x + normal.y*normal.y + normal.z*normal.z));
normal.x /= length;
normal.y /= length;
normal.z /= length;
normal.x = -normal.x;
normal.y = -normal.y;
normal.z = -normal.z;
normal.x += a->x();
normal.y += a->y();
normal.z += a->z();
return normal;
}
示例3:
void
hAccFuncCalc(OpenBabel::OBMol* mol, Pharmacophore* pharmacophore)
{
// Create for every hydrogen acceptor a pharmacophore point
std::vector<OpenBabel::OBAtom*>::iterator ai;
for (OpenBabel::OBAtom* atom = mol->BeginAtom(ai); atom; atom = mol->NextAtom(ai))
{
if (atom->GetAtomicNum() == 7 || atom->GetAtomicNum() == 8)
{
if (atom->GetFormalCharge() <= 0)
{
if(_hAccDelocalized(atom) || (_hAccCalcAccSurf(atom) < 0.02))
{
continue;
}
PharmacophorePoint p;
p.func = HACC;
p.point.x = atom->x();
p.point.y = atom->y();
p.point.z = atom->z();
p.hasNormal = true;
p.alpha = funcSigma[HACC];
p.normal = _hAccCalcNormal(atom);
pharmacophore->push_back(p);
}
}
}
}
示例4:
void
hDonFuncCalc(OpenBabel::OBMol* mol, Pharmacophore* pharmacophore)
{
// Create for every hydrogen donor a pharmacophore point
std::vector<OpenBabel::OBAtom*>::iterator ai;
for (OpenBabel::OBAtom* a = mol->BeginAtom(ai); a; a = mol->NextAtom(ai))
{
if (a->GetAtomicNum() == 7 || a->GetAtomicNum() == 8)
{
if (a->GetFormalCharge() >= 0 && ((a->GetImplicitValence() - a->GetHvyValence()) !=0))
{
PharmacophorePoint p;
p.func = HDON;
p.point.x = a->x();
p.point.y = a->y();
p.point.z = a->z();
p.hasNormal = true;
p.alpha = funcSigma[HDON];
p.normal = _hDonCalcNormal(a);
pharmacophore->push_back(p);
}
}
}
}