Logo Search packages:      
Sourcecode: cdk version File versions  Download package

static QueryAtomContainer org::openscience::cdk::isomorphism::matchers::QueryAtomContainerCreator::createSymbolAndBondOrderQueryContainer ( IAtomContainer  container ) [inline, static]

Creates a QueryAtomContainer with SymbolQueryAtom's and OrderQueryBond's. Unlike createBasicQueryContainer, it disregards aromaticity flags.

Parameters:
containerThe AtomContainer that stands as model
Returns:
The new QueryAtomContainer created from container.

Definition at line 81 of file QueryAtomContainerCreator.java.

References org::openscience::cdk::isomorphism::matchers::QueryAtomContainer::addAtom(), org::openscience::cdk::isomorphism::matchers::QueryAtomContainer::addBond(), org::openscience::cdk::interfaces::IAtomContainer::bonds(), org::openscience::cdk::AtomContainer::getAtom(), org::openscience::cdk::interfaces::IBond::getAtom(), org::openscience::cdk::interfaces::IAtomContainer::getAtom(), org::openscience::cdk::interfaces::IAtomContainer::getAtomCount(), org::openscience::cdk::interfaces::IAtomContainer::getAtomNumber(), and org::openscience::cdk::interfaces::IBond::getOrder().

Referenced by org::openscience::cdk::tools::StructureResonanceGenerator::existAC().

                                                                                                      {
        QueryAtomContainer queryContainer = new QueryAtomContainer();
        for (int i = 0; i < container.getAtomCount(); i++) {
            queryContainer.addAtom(new SymbolQueryAtom(container.getAtom(i)));
        }
        Iterator<IBond> bonds = container.bonds().iterator();
        while (bonds.hasNext()) {
            IBond bond = (IBond)bonds.next();
            int index1 = container.getAtomNumber(bond.getAtom(0));
            int index2 = container.getAtomNumber(bond.getAtom(1));
            queryContainer.addBond(
                  new OrderQueryBondOrderOnly(
                        (IQueryAtom) queryContainer.getAtom(index1),
                    (IQueryAtom) queryContainer.getAtom(index2),
                    bond.getOrder()
                )
            );
        }
        return queryContainer;
    }

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index