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

void org::openscience::cdk::modeling::builder3d::ModelBuilder3D::placeLinearChains3D ( IMolecule  molecule,
IAtomContainer  startAtoms,
AtomPlacer3D  ap3d,
AtomTetrahedralLigandPlacer3D  atlp3d,
AtomPlacer  atomPlacer 
) throws CDKException [inline, private]

Layout all aliphatic chains with ZMatrix.

Parameters:
startAtomsAtomContainer of possible start atoms for a chain

Definition at line 498 of file ModelBuilder3D.java.

References org::openscience::cdk::interfaces::IAtomContainer::add(), org::openscience::cdk::interfaces::IAtomContainer::addAtom(), org::openscience::cdk::interfaces::IAtomContainer::getAtomCount(), org::openscience::cdk::interfaces::IChemObject::getBuilder(), org::openscience::cdk::interfaces::IChemObjectBuilder::newAtomContainer(), org::openscience::cdk::interfaces::IAtomContainer::removeAllElements(), searchAndPlaceBranches(), and setAtomsToUnVisited().

Referenced by searchAndPlaceBranches().

                                                                                                                                                                                          {
            //logger.debug("****** PLACE LINEAR CHAINS ******");
            IAtom dihPlacedAtom = null;
            IAtom thirdPlacedAtom = null;
            IAtomContainer longestUnplacedChain = molecule.getBuilder().newAtomContainer();
            if (startAtoms.getAtomCount() == 0) {
                  //no branch points ->linear chain
                  //logger.debug("------ LINEAR CHAIN - FINISH ------");
            } else {
                  for (int i = 0; i < startAtoms.getAtomCount(); i++) {
                        //logger.debug("FOUND BRANCHED ALKAN");
                        //logger.debug("Atom NOT NULL:" + molecule.getAtomNumber(startAtoms.getAtomAt(i)));
                        thirdPlacedAtom = ap3d.getPlacedHeavyAtom(molecule, startAtoms.getAtom(i));
                        dihPlacedAtom = ap3d.getPlacedHeavyAtom(molecule, thirdPlacedAtom, startAtoms.getAtom(i));
                        longestUnplacedChain.addAtom(dihPlacedAtom);
                        longestUnplacedChain.addAtom(thirdPlacedAtom);
                        longestUnplacedChain.addAtom(startAtoms.getAtom(i));

                        longestUnplacedChain.add(atomPlacer.getLongestUnplacedChain(molecule, startAtoms.getAtom(i)));
                        setAtomsToUnVisited(molecule);
                        
                        if (longestUnplacedChain.getAtomCount() < 4) {
                              //di,third,sec
                              //logger.debug("------ SINGLE BRANCH METHYLTYP ------");
                              //break;
                        } else {
                              //logger.debug("LongestUnchainLength:"+longestUnplacedChain.getAtomCount());
                              ap3d.placeAliphaticHeavyChain(molecule, longestUnplacedChain);
                              ap3d.zmatrixChainToCartesian(molecule, true);
                              searchAndPlaceBranches(molecule, longestUnplacedChain, ap3d, atlp3d, atomPlacer);
                        }
                        longestUnplacedChain.removeAllElements();
                  }//for

            }
            //logger.debug("****** HANDLE ALIPHATICS END ******");
      }

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