当前位置: 首页>>代码示例>>C++>>正文


C++ AtomList::begin方法代码示例

本文整理汇总了C++中AtomList::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ AtomList::begin方法的具体用法?C++ AtomList::begin怎么用?C++ AtomList::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AtomList的用法示例。


在下文中一共展示了AtomList::begin方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

void
MP4::Tag::updateParents(const AtomList &path, long delta, int ignore)
{
  if(static_cast<int>(path.size()) <= ignore)
    return;

  AtomList::ConstIterator itEnd = path.end();
  std::advance(itEnd, 0 - ignore);

  for(AtomList::ConstIterator it = path.begin(); it != itEnd; ++it) {
    d->file->seek((*it)->offset);
    long size = d->file->readBlock(4).toUInt();
    // 64-bit
    if (size == 1) {
      d->file->seek(4, File::Current); // Skip name
      long long longSize = d->file->readBlock(8).toLongLong();
      // Seek the offset of the 64-bit size
      d->file->seek((*it)->offset + 8);
      d->file->writeBlock(ByteVector::fromLongLong(longSize + delta));
    }
    // 32-bit
    else {
      d->file->seek((*it)->offset);
      d->file->writeBlock(ByteVector::fromUInt(size + delta));
    }
  }
}
开发者ID:Atrament666,项目名称:Clementine,代码行数:27,代码来源:mp4tag.cpp

示例2: drawLabels

void Viewer::drawLabels(GLObjectList const& objects)
{
   AtomList atomList;
   Layer::Atom* atom;
   Layer::Charge* charge;
   bool selectedOnly = (m_selectedObjects.count() > 0);

   GLObjectList::const_iterator object;
   for (object = objects.begin(); object!= objects.end(); ++object) {
       if ( (atom = qobject_cast<Layer::Atom*>(*object)) ) {
          atom->drawLabel(*this, m_labelType, s_labelFontMetrics);
          if ( !selectedOnly || atom->isSelected() ) atomList.append(atom);
       }else if ( (m_labelType == Layer::Atom::Charge) && 
                  (charge = qobject_cast<Layer::Charge*>(*object)) ) {
          charge->drawLabel(*this, s_labelFontMetrics);
       }
   }

   glDisable(GL_LIGHTING);
   qglColor(foregroundColor());

   QString mesg = selectedOnly ? "Selection " : "Total ";
   AtomList::const_iterator iter;
   double value(0.0);

   if (m_labelType == Layer::Atom::Mass) {
      for (iter= atomList.begin(); iter != atomList.end(); ++iter) {
          value += (*iter)->getMass();
      }
      mesg += "mass: " + QString::number(value,'f', 3);
      drawText(width()-s_labelFontMetrics.width(mesg), height()-10, mesg);
   }else if (m_labelType == Layer::Atom::Charge) {
      for (iter = atomList.begin(); iter != atomList.end(); ++iter) {
          value += (*iter)->getCharge();
      }
      mesg += "charge: " + QString::number(value,'f', 2);
      drawText(width()-s_labelFontMetrics.width(mesg), height()-10, mesg);
   }else if (m_labelType == Layer::Atom::Spin) {
      for (iter = atomList.begin(); iter != atomList.end(); ++iter) {
          value += (*iter)->getSpin();
      }
      mesg += "spin: " + QString::number(value,'f', 2);
      drawText(width()-s_labelFontMetrics.width(mesg), height()-10, mesg);
   }

   glEnable(GL_LIGHTING);
}
开发者ID:baneofblabs,项目名称:IQmol,代码行数:47,代码来源:Viewer.C

示例3: addAtoms

void Group::addAtoms(AtomList const& atoms)
{
   AtomList::const_iterator atom;
   for (atom = atoms.begin(); atom != atoms.end(); ++atom) {
       (*atom)->setReferenceFrame(&m_frame);
       m_atoms.append(*atom);
   }
}
开发者ID:epifanovsky,项目名称:IQmol,代码行数:8,代码来源:GroupLayer.C

示例4: atoms

	AtomList atoms(const AtomList& atom_list, const String& expression)
	{
		AtomList result;

    // iterate over all atoms
		AtomList::const_iterator it = atom_list.begin();

    Expression match(expression);
    for (; it != atom_list.end(); ++it)
    {
      if (match(**it))
      {
        // store the atom pointer in the list
        result.push_back(const_cast<Atom*>(*it));
			}
		}
		return result;
	}
开发者ID:HeyJJ,项目名称:ball,代码行数:18,代码来源:extractors.C


注:本文中的AtomList::begin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。