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

void org::openscience::cdk::layout::StructureDiagramGenerator::setMolecule ( IMolecule  mol,
boolean  clone 
) [inline]

Assings a molecule to be layed out. Call generateCoordinates() to do the actual layout.

Parameters:
molthe molecule for which coordinates are to be generated.
cloneShould the whole process be performed with a cloned copy?

Definition at line 130 of file StructureDiagramGenerator.java.

References org::openscience::cdk::interfaces::IChemObject::clone(), org::openscience::cdk::tools::LoggingTool::debug(), org::openscience::cdk::tools::LoggingTool::error(), org::openscience::cdk::interfaces::IAtomContainer::getAtom(), org::openscience::cdk::interfaces::IAtomContainer::getAtomCount(), org::openscience::cdk::interfaces::IChemObject::getBuilder(), org::openscience::cdk::CDKConstants::ISALIPHATIC, org::openscience::cdk::CDKConstants::ISINRING, org::openscience::cdk::CDKConstants::ISPLACED, org::openscience::cdk::layout::AtomPlacer::setMolecule(), org::openscience::cdk::interfaces::IAtom::setPoint2d(), and org::openscience::cdk::CDKConstants::VISITED.

Referenced by setMolecule(), and StructureDiagramGenerator().

                                                            {
            templateHandler = new TemplateHandler(mol.getBuilder());
            IAtom atom = null;
            if (clone)
            {
                  try {
                        this.molecule = (IMolecule) mol.clone();
                  } catch (CloneNotSupportedException e) {
                        logger.error("Should clone, but exception occured: ", e.getMessage());
                        logger.debug(e);
                  }
            } else
            {
                  this.molecule = mol;
            }
            for (int f = 0; f < molecule.getAtomCount(); f++)
            {
                  atom = molecule.getAtom(f);
                  atom.setPoint2d(null);
                  atom.setFlag(CDKConstants.ISPLACED, false);
                  atom.setFlag(CDKConstants.VISITED, false);
                  atom.setFlag(CDKConstants.ISINRING, false);
                  atom.setFlag(CDKConstants.ISALIPHATIC, false);
            }
            atomPlacer.setMolecule(this.molecule);
            ringPlacer.setMolecule(this.molecule);
            ringPlacer.setAtomPlacer(this.atomPlacer);
      }

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