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


C++ BaseMolecule::getBondOrder方法代码示例

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


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

示例1: matchBonds

bool MoleculeExactMatcher::matchBonds (BaseMolecule& query, BaseMolecule& target, int sub_idx, int super_idx, int flags)
{
   if (flags & CONDITION_ELECTRONS)
      if (query.getBondOrder(sub_idx) != target.getBondOrder(super_idx))
         return false;

   return true;
}
开发者ID:Lucas-Gluchowski,项目名称:Indigo,代码行数:8,代码来源:molecule_exact_matcher.cpp

示例2: _bondCode

int MoleculeFingerprintBuilder::_bondCode (BaseMolecule &mol, int edge_idx)
{
   //MoleculeFingerprintBuilder *self = (MoleculeFingerprintBuilder *)context;
   //if (self->query && mol.asQueryMolecule().aromaticity.canBeAromatic(edge_idx))
   //  throw Error("internal: _edge_code for possibly aromatic bond");
   
   return mol.getBondOrder(edge_idx);
}
开发者ID:Rillke,项目名称:indigo,代码行数:8,代码来源:molecule_fingerprint.cpp

示例3: matchQueryBond

bool MoleculeSubstructureMatcher::matchQueryBond (QueryMolecule::Bond *query,
             BaseMolecule &target, int sub_idx, int super_idx, AromaticityMatcher *am, dword flags)
{
   int i;

   // MR TODO: match topology. Query bond in ring cannot match 
   // target bond that is not in ring. But R-groups should be 
   // handled carefully

   switch (query->type)
   {
      case QueryMolecule::OP_NONE:
         return true;
      case QueryMolecule::OP_AND:
         for (i = 0; i < query->children.size(); i++)
            if (!matchQueryBond(query->child(i), target, sub_idx, super_idx, am, flags))
               return false;
         return true;
      case QueryMolecule::OP_OR:
         for (i = 0; i < query->children.size(); i++)
            if (matchQueryBond(query->child(i), target, sub_idx, super_idx, am, flags))
               return true;
         return false;
      case QueryMolecule::OP_NOT:
         return !matchQueryBond(query->child(0), target, sub_idx, super_idx, am, 
            flags ^ MATCH_DISABLED_AS_TRUE);

      case QueryMolecule::BOND_ORDER:
      {
         if (flags & MATCH_BOND_TYPE)
         {
            if (am != 0)
            {
               if (target.getBondOrder(super_idx) == BOND_AROMATIC)
                  return am->canFixQueryBond(sub_idx, true);
               else 
               {
                  if (!am->canFixQueryBond(sub_idx, false))
                     return false;
               }
            }
            return target.possibleBondOrder(super_idx, query->value);
         }
         return (flags & MATCH_DISABLED_AS_TRUE) != 0;
      }
      case QueryMolecule::BOND_TOPOLOGY:
         return target.getEdgeTopology(super_idx) == query->value;
      case QueryMolecule::HIGHLIGHTING:
         return query->value == (int)target.isAtomHighlighted(super_idx);
      default:
         throw Error("bad query bond type: %d", query->type);
   }
}
开发者ID:mojca,项目名称:indigo,代码行数:53,代码来源:molecule_substructure_matcher.cpp


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