本文整理汇总了C++中MolAtomPtr::getID方法的典型用法代码示例。如果您正苦于以下问题:C++ MolAtomPtr::getID方法的具体用法?C++ MolAtomPtr::getID怎么用?C++ MolAtomPtr::getID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MolAtomPtr
的用法示例。
在下文中一共展示了MolAtomPtr::getID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
bool MolSurfBuilder::init(MolCoordPtr pmol)
{
AtomIterator aiter(pmol);
int i, natoms=0;
// count atom number
for (aiter.first(); aiter.hasMore(); aiter.next()) {
MolAtomPtr pAtom = aiter.get();
MB_ASSERT(!pAtom.isnull());
++natoms;
}
// copy to the m_data
m_data.resize(natoms);
m_tree.alloc(natoms);
for (i=0,aiter.first(); aiter.hasMore()&&i<natoms; aiter.next(),++i) {
MolAtomPtr pAtom = aiter.get();
m_data[i].pos = pAtom->getPos();
m_data[i].rad = 1.5;
m_data[i].aid = pAtom->getID();
m_tree.setAt(i, m_data[i].pos, i);
}
// build BSP tree
m_tree.build();
m_rmax = 1.5;
m_rprobe = 1.2;
return true;
}
示例2: rendAtom
void BallStickRenderer::rendAtom(DisplayContext *pdl, MolAtomPtr pAtom, bool)
{
if (m_sphr>0.0) {
pdl->color(ColSchmHolder::getColor(pAtom));
pdl->sphere(m_sphr, pAtom->getPos());
}
checkRing(pAtom->getID());
}
示例3: fromStrAID
/// Convert from (persistent) string representation to aid
int MolCoord::fromStrAID(const LString &strid) const
{
if (!m_reAid.match(strid)) {
LOG_DPRINTLN("MolCoord> Invalid aid strid=%s (re match failed)", strid.c_str());
return -1;
}
// text type aid
int nsc = m_reAid.getSubstrCount();
if (nsc<4) {
LOG_DPRINTLN("MolCoord> Invalid aid strid=%s", strid.c_str());
return -1;
}
//elem.setAtomID(-1);
LString sChainName = m_reAid.getSubstr(1);
LString sResInd = m_reAid.getSubstr(2);
ResidIndex nResInd;
if (!sResInd.toInt(&nResInd.first)) {
LOG_DPRINTLN("MolCoord> Invalid aid resid value=%s", sResInd.c_str());
return -1;
}
LString sInsCode = m_reAid.getSubstr(3);
if (sInsCode.isEmpty())
nResInd.second = '\0';
else
nResInd.second = sInsCode.getAt(0);
LString sAtomName = m_reAid.getSubstr(4);
char cAltLoc = '\0';
if (nsc>6) {
LString sAltLoc = m_reAid.getSubstr(6);
if (!sAltLoc.isEmpty())
cAltLoc = sAltLoc.getAt(0);
}
MolAtomPtr pAtom = getAtom(sChainName, nResInd, sAtomName, cAltLoc);
if (pAtom.isnull()) {
LOG_DPRINTLN("MolCoord> fromStrAID/ atom <%s %s %s %c> not found in %s",
sChainName.c_str(), nResInd.toString().c_str(), sAtomName.c_str(),
cAltLoc=='\0'?' ':cAltLoc,
getName().c_str());
return -1;
}
return pAtom->getID();
}