本文整理汇总了C++中PDBFile::Molecules方法的典型用法代码示例。如果您正苦于以下问题:C++ PDBFile::Molecules方法的具体用法?C++ PDBFile::Molecules怎么用?C++ PDBFile::Molecules使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PDBFile
的用法示例。
在下文中一共展示了PDBFile::Molecules方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main () {
//PDBFile pdb ("quartz_100_short.pdb");
PDBFile pdb ("beta-cristobalite.pdb");
// create the quartz unitcell
Molecule * uc = pdb.Molecules(0);
//make copies of the quartz unitcell and shift them around
//VecR x_shift (4.91, 0.0, 0.0);
VecR x_shift (10.0, 0.0, 0.0);
VecR y_shift (0.0, 10.0, 0.0);
VecR z_shift (0.0, 0.0, 0.0);
// Create the slab by creating and shifting copies of the unit cell
Mol_ptr_vec mols = UnitCellToSlab(uc, x_shift, y_shift, z_shift);
Molecule * mol = MakeSingleMolecule (mols);
//AddDanglingHydrogens (mol);
// Take care of renaming the atoms and the residue before printing it out
FixSingleMoleculeNaming (mol);
PrintMoleculePDB (mol);
return 0;
}
示例2: main
int main () {
PDBFile pdb ("temp.pdb");
Molecule * mol = pdb.Molecules(0);
mol->Name("qtz");
std::vector<Atom *> atoms = mol->Atoms();
/* cycle through each atom in order of the pdb file */
RUN (atoms)
{
Atom * atom = atoms[i];
atom->Residue("qtz");
VecR pos = atom->Position();
/* find the surface Oxygens */
if (atom->Name().find("O") != string::npos && pos[z] > -7.9)
{
/* add H's to the surface */
Atom * h = new Atom ("H", pos + VecR (0.0, 0.0, 1.1));
mol->AddAtom(h);
}
}
std::vector<Molecule *> mols;
mols.push_back(mol);
PDBFile::WritePDB(mols);
}
示例3: main
int main () {
// The unitcell's PDB file - must have a "TER" after the residue
PDBFile pdb ("octadecane.pdb");
string name = "odn";
double spacing = 5.528; // inter-chain spacing
GridParams params (pdb.Molecules(0), name, spacing, 7, 1, 6);
// Create the slab by creating and shifting copies of the unit cell
Mol_ptr_vec mols = UnitCellToSlab(params);
//Molecule * mol = MakeSingleMolecule (params);
//AddDanglingHydrogens (params);
// Take care of renaming the atoms and the residue before printing it out
//FixSingleMoleculeNaming (params);
PrintMoleculesPDB (mols);
return 0;
}