OERenderMoleculeΒΆ

The overloaded versions of the OERenderMolecule function
Link Description
OERenderMolecule(image, disp) renders a molecule display into an image
OERenderMolecule(image, mol) renders molecule into an image using the default depiction style
OERenderMolecule(filename, disp) writes a molecule display into a file
OERenderMolecule(filename, mol) writes a molecule into a file using the default depiction style
OERenderMolecule(stream, ext, disp) writes a molecule display into an output stream
OERenderMolecule(stream, ext, mol) writes a molecule into an output stream using the default depiction style
bool OERenderMolecule(OEImageBase &image, const OE2DMolDisplay &disp,
                      bool clearbackground=true)

Renders the molecule display into an image.

image
The image in which the molecule is drawn.
disp
The OE2DMolDisplay object that holds the data necessary to depict the molecule with which it is initialized.
clearbackground
Determines whether or not the image is cleared (by calling OEImageBase::Clear method) prior to the molecule rendering.

Example:

OEPrepareDepiction(mol);

OEImage image(200.0, 200.0);
OE2DMolDisplayOptions opts(image.GetWidth(), image.GetHeight(), OEScale::AutoScale);
OE2DMolDisplay disp(mol, opts);
OERenderMolecule(image, disp);

See also

bool OERenderMolecule(OEImageBase &image, const OEChem::OEMolBase &mol,
                      bool clearbackground=true)

Renders a molecule into an image using the default depiction style.

image
The image in which the molecule is drawn.
mol
The molecule being rendered has to have valid 2D coordinates before calling the OERenderMolecule function.
clearbackground
Determines whether or not the image is cleared (by calling OEImageBase::Clear method) prior to the molecule rendering.

Example:

OEPrepareDepiction(mol);

OEImage image(200.0, 200.0);
OERenderMolecule(image, mol);

See also

bool OERenderMolecule(const std::string &filename, const OE2DMolDisplay &disp,
                      bool clearbackground=true)

Writes the molecule display into a file.

filename
The name of the file into which the molecule display is being written. The extension of the filename determine the type of the image.
disp
The OE2DMolDisplay object that holds the data necessary to depict the molecule with which it is initialized.
clearbackground
Determines whether or not the image is cleared (by calling OEImageBase::Clear method) prior to the molecule rendering.

Example:

OEPrepareDepiction(mol);

OE2DMolDisplayOptions opts(200.0, 200.0, OEScale::AutoScale);
OE2DMolDisplay disp(mol, opts);
OERenderMolecule("OERenderMolecule-fname-disp.png", disp);

See also

bool OERenderMolecule(const std::string &filename, const OEChem::OEMolBase &mol,
                      bool clearbackground=true)

Writes a molecule into a file using the default depiction style.

filename
The name of the file into which the molecule is written. The extension of the filename determine the type of the image.
mol
The molecule being rendered has to have valid 2D coordinates before calling the OERenderMolecule function.
clearbackground
Determines whether or not the image is cleared (by calling OEImageBase::Clear method) prior to the molecule rendering.

Example:

OEPrepareDepiction(mol);

OERenderMolecule("OERenderMolecule-fname-mol.png", mol);
bool OERenderMolecule(OEPlatform::oeostream &os, const std::string &extension,
                      const OE2DMolDisplay &disp, bool clearbackground=true)

Writes the molecule display into a stream.

os
The stream into which the molecule display is being written.
ext
The extension which determine the type of the image.
disp
The OE2DMolDisplay object that holds the data necessary to depict the molecule with which it is initialized.
clearbackground
Determines whether or not the image is cleared (by calling OEImageBase::Clear method) prior to the molecule rendering.

Example:

OEPrepareDepiction(mol);

OE2DMolDisplayOptions opts(200.0, 200.0, OEScale::AutoScale);
OE2DMolDisplay disp(mol, opts);

oeofstream ofs("OERenderMolecule-stream-disp.png");
OERenderMolecule(ofs, "png", disp);

See also

bool OERenderMolecule(OEPlatform::oeostream &os, const std::string &extension,
                      const OEChem::OEMolBase &mol, bool clearbackground=true)

Writes a molecule into a stream using the default depiction style.

os
The stream into which the molecule is being written.
ext
The extension which determine the type of the image.
mol
The molecule being rendered has to have valid 2D coordinates before calling the OERenderMolecule function.
clearbackground
Determines whether or not the image is cleared (by calling OEImageBase::Clear method) prior to the molecule rendering.

Example:

OEPrepareDepiction(mol);

oeofstream ofs("OERenderMolecule-stream-mol.png");
OERenderMolecule(ofs, "png", mol);

See also