本文整理汇总了C++中OBMol::UnsetFlag方法的典型用法代码示例。如果您正苦于以下问题:C++ OBMol::UnsetFlag方法的具体用法?C++ OBMol::UnsetFlag怎么用?C++ OBMol::UnsetFlag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OBMol
的用法示例。
在下文中一共展示了OBMol::UnsetFlag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getIdRingPaths
std::vector< std::vector<unsigned long> > getIdRingPaths(OBMol &mol)
{
mol.UnsetFlag(OB_LSSR_MOL);
mol.DeleteData("LSSR");
std::vector<OBRing*> lssr = mol.GetLSSR();
std::vector< std::vector<unsigned long> > idPaths;
for (unsigned int i = 0; i < lssr.size(); ++i) {
OBRing *ring = lssr[i];
std::vector<unsigned long> idPath;
for (unsigned int j = 0; j < ring->_path.size(); ++j) {
idPath.push_back(mol.GetAtom(ring->_path[j])->GetId());
}
std::sort(idPath.begin(), idPath.end());
idPaths.push_back(idPath);
}
/*
cout << "# idPaths = " << idPaths.size() << endl;
for (unsigned int i = 0; i < idPaths.size(); ++i) {
cout << " ring: ";
for (unsigned int j = 0; j < idPaths[i].size(); ++j) {
cout << idPaths[i][j] << " ";
}
cout << endl;
}
*/
return idPaths;
}
示例2: redo
void HydrogensCommand::redo()
{
if (m_SelectedList.size() == 0) {
switch(m_action) {
case AddHydrogens:
m_molecule->addHydrogens();
break;
case AddHydrogensPH:
{
OBMol obmol = m_molecule->OBMol();
obmol.UnsetFlag(OB_PH_CORRECTED_MOL);
FOR_ATOMS_OF_MOL (a, obmol)
a->SetFormalCharge(0.0);
obmol.SetAutomaticFormalCharge(true);
obmol.AddHydrogens(false, true, m_pH);
m_molecule->setOBMol(&obmol);
break;
}
case RemoveHydrogens:
m_molecule->removeHydrogens();
break;
}
}
else { // user selected some atoms, only operate on those
foreach(unsigned long id, m_SelectedList.subList(Primitive::AtomType))
{
Atom *atom = m_molecule->atomById(id);
if(atom)
{
switch(m_action) {
case AddHydrogens:
m_molecule->addHydrogens(atom);
break;
case RemoveHydrogens:
m_molecule->removeHydrogens(atom);
break;
default:
break;
}
}
}
} // end adding to selected atoms
m_molecule->update();
}