本文整理汇总了C++中AtomIterator::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ AtomIterator::getName方法的具体用法?C++ AtomIterator::getName怎么用?C++ AtomIterator::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AtomIterator
的用法示例。
在下文中一共展示了AtomIterator::getName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: optimizeCapPosition
void PeptideCapProcessor::optimizeCapPosition(Chain& chain, bool start)
{
Vector3 translation;
Atom* axis = NULL;
Residue* cap = NULL;
std::vector<Atom*> a;
std::vector<Atom*> b;
Size nr = chain.countResidues();
// cap at the beginning of a peptide
if (start)
{
// put ACE-C to the center
for (AtomIterator it = chain.getResidue(1)->beginAtom(); +it; ++it)
{
if (it->getName() == "N")
{
translation = it->getPosition();
}
b.push_back(&*it);
}
cap = chain.getResidue(0);
for (AtomIterator it = cap->beginAtom(); +it; ++it)
{
a.push_back(&*it);
if (it->getName() == "C")
{
axis = &*it;
}
}
}
//cap at the end of a peptide
else
{
for (AtomIterator it = chain.getResidue(nr-2)->beginAtom(); +it; ++it)
{
if (it->getName() == "C")
{
translation = it->getPosition();
}
b.push_back(&*it);
}
cap = chain.getResidue(nr-1);
for (AtomIterator it = cap->beginAtom(); +it; ++it)
{
a.push_back(&*it);
if (it->getName() == "N")
{
axis = &*it;
}
}
}
//translate the anchor to origin
TranslationProcessor tlp;
tlp.setTranslation(translation*-1.0);
chain.apply(tlp);
//try all torsions
float largest_distance = 0.0;
float tmp_distance = 0.0;
float torsion = 0.0;
float step = 2.0;
TransformationProcessor tfp;
Matrix4x4 m;
m.setRotation( Angle(step, false), axis->getPosition());
tfp.setTransformation(m);
for (Position r = step; r <= 360; r+=step)
{
cap->apply(tfp);
tmp_distance = computeDistance(a,b);
if (largest_distance < tmp_distance)
{
largest_distance = tmp_distance;
torsion = r;
}
}
//apply best rotation angle
m.setRotation( Angle(torsion, false), axis->getPosition());
tfp.setTransformation(m);
cap->apply(tfp);
//now translate the protein back
tlp.setTranslation(translation);
chain.apply(tlp);
}