本文整理汇总了C++中rdgeom::Point3D::signedAngleTo方法的典型用法代码示例。如果您正苦于以下问题:C++ Point3D::signedAngleTo方法的具体用法?C++ Point3D::signedAngleTo怎么用?C++ Point3D::signedAngleTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rdgeom::Point3D
的用法示例。
在下文中一共展示了Point3D::signedAngleTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DetermineBondWedgeState
//
// Determine bond wedge state
///
Bond::BondDir DetermineBondWedgeState(const Bond *bond,
const INT_MAP_INT &wedgeBonds,
const Conformer *conf) {
PRECONDITION(bond, "no bond");
PRECONDITION(bond->getBondType() == Bond::SINGLE,
"bad bond order for wedging");
const ROMol *mol = &(bond->getOwningMol());
PRECONDITION(mol, "no mol");
Bond::BondDir res = bond->getBondDir();
if (!conf) {
return res;
}
int bid = bond->getIdx();
INT_MAP_INT_CI wbi = wedgeBonds.find(bid);
if (wbi == wedgeBonds.end()) {
return res;
}
unsigned int waid = wbi->second;
Atom *atom, *bondAtom; // = bond->getBeginAtom();
if (bond->getBeginAtom()->getIdx() == waid) {
atom = bond->getBeginAtom();
bondAtom = bond->getEndAtom();
} else {
atom = bond->getEndAtom();
bondAtom = bond->getBeginAtom();
}
Atom::ChiralType chiralType = atom->getChiralTag();
CHECK_INVARIANT(chiralType == Atom::CHI_TETRAHEDRAL_CW ||
chiralType == Atom::CHI_TETRAHEDRAL_CCW,
"");
// if we got this far, we really need to think about it:
INT_LIST neighborBondIndices;
DOUBLE_LIST neighborBondAngles;
RDGeom::Point3D centerLoc, tmpPt;
centerLoc = conf->getAtomPos(atom->getIdx());
tmpPt = conf->getAtomPos(bondAtom->getIdx());
centerLoc.z = 0.0;
tmpPt.z = 0.0;
RDGeom::Point3D refVect = centerLoc.directionVector(tmpPt);
neighborBondIndices.push_back(bond->getIdx());
neighborBondAngles.push_back(0.0);
ROMol::OEDGE_ITER beg, end;
boost::tie(beg, end) = mol->getAtomBonds(atom);
while (beg != end) {
Bond *nbrBond = (*mol)[*beg].get();
Atom *otherAtom = nbrBond->getOtherAtom(atom);
if (nbrBond != bond) {
tmpPt = conf->getAtomPos(otherAtom->getIdx());
tmpPt.z = 0.0;
RDGeom::Point3D tmpVect = centerLoc.directionVector(tmpPt);
double angle = refVect.signedAngleTo(tmpVect);
if (angle < 0.0) angle += 2. * M_PI;
INT_LIST::iterator nbrIt = neighborBondIndices.begin();
DOUBLE_LIST::iterator angleIt = neighborBondAngles.begin();
// find the location of this neighbor in our angle-sorted list
// of neighbors:
while (angleIt != neighborBondAngles.end() && angle > (*angleIt)) {
++angleIt;
++nbrIt;
}
neighborBondAngles.insert(angleIt, angle);
neighborBondIndices.insert(nbrIt, nbrBond->getIdx());
}
++beg;
}
// at this point, neighborBondIndices contains a list of bond
// indices from the central atom. They are arranged starting
// at the reference bond in CCW order (based on the current
// depiction).
int nSwaps = atom->getPerturbationOrder(neighborBondIndices);
// in the case of three-coordinated atoms we may have to worry about
// the location of the implicit hydrogen - Issue 209
// Check if we have one of these situation
//
// 0 1 0 2
// * \*/
// 1 - C - 2 C
//
// here the hydrogen will be between 1 and 2 and we need to add an additional
// swap
if (neighborBondAngles.size() == 3) {
// three coordinated
DOUBLE_LIST::iterator angleIt = neighborBondAngles.begin();
++angleIt; // the first is the 0 (or reference bond - we will ignoire that
double angle1 = (*angleIt);
++angleIt;
double angle2 = (*angleIt);
//.........这里部分代码省略.........