本文整理汇总了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");
//.........这里部分代码省略.........