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


C++ PDB::clear方法代码示例

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


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

示例1: parsePDBstream

void PDB::parsePDBstream(istream& PDBfile, float resolution)
{
  string line; // this is a temp var to hold the current line from the file
  int count = 0;
  bool rflag = false;
  PDB model;
  int modelnum=1;

  // For each line in the file
  while( getline(PDBfile, line) && !failure)
    {
      count++;

      // Check to see if there are more than one model
      // If there is, we will just skip the file altogether because
      // it is less of a hassle to deal with.
      // So here, we check the model number, if it is greater
      // than 1, we will just break from this loop and print
      // a note
      int found = line.find("MODEL");
      if( found == 0 )
        {
          int model_number;
          if(line.substr(10,4) == "    ")
            {
              continue;
            }
          else if( !from_string<int>(model_number, line.substr(10,4), dec) )
            {
              failure = true;
              failflag = MODEL_TO_NUMBER_FAILED;
              continue;
            }
          else if( model_number > 1 )
            {
              model.model_number = modelnum;
              models.push_back(model);
              model.clear();
              modelnum++;
            }
        }

      // Check the resolution of the PDB
      found = line.find("REMARK   2 RESOLUTION.");
      if( found == 0 )
        {
          this->resolution = 0;
          if(line.substr(23, 7) == "NOT APP")
            {
              //failure = true;
              //failflag = RESOLUTION_NOT_APPLICABLE;
              this->resolution = -1;
            }
          else if(line.substr(23, 7) == "       ")
            {
              failure = true;
              failflag = RESOLUTION_BLANK;
            }
          else
            {
              if(!from_string<float>(this->resolution, line.substr(23,7), dec))
                {
                  failure = true;
                  failflag = RESOLUTION_TO_NUMBER_FAILED;
                }
              if(this->resolution > resolution)
                {
                  failure = true;
                  failflag  = RESOLUTION_TOO_HIGH;
                }
            }
          continue;
        }

      // Parse the line if we are on an ATOM line
      found = line.find("ATOM");
      if( found == 0 )
        {
          Atom a(line, count);
          failure = a.fail();
          atoms.push_back(a);
          model.atoms.push_back(a);
          continue;
        }

      // Parse the line if we are on a HETATM line
      // Used to find ligands
      found = line.find("HETATM");
      if( found == 0 )
        {
          Atom h(line, count);
          failure = h.fail();
          hetatms.push_back(h);
          model.hetatms.push_back(h);
          continue;
        }

      // Parse the line if we are on a CONECT line
      // Used to find ligands
      found = line.find("CONECT");
//.........这里部分代码省略.........
开发者ID:daviddjenkins,项目名称:STAAR,代码行数:101,代码来源:PDB.cpp


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