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:

OEDepict.OEPrepareDepiction(mol);

OEImage image = new OEImage(200.0, 200.0);
OE2DMolDisplayOptions opts = new OE2DMolDisplayOptions(image.GetWidth(), image.GetHeight(), OEScale.AutoScale);
OE2DMolDisplay disp = new OE2DMolDisplay(mol, opts);
OEDepict.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:

OEDepict.OEPrepareDepiction(mol);

OEImage image = new OEImage(200.0, 200.0);
OEDepict.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:

OEDepict.OEPrepareDepiction(mol);

OE2DMolDisplayOptions opts = new OE2DMolDisplayOptions(200.0, 200.0, OEScale.AutoScale);
OE2DMolDisplay disp = new OE2DMolDisplay(mol, opts);
OEDepict.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:

OEDepict.OEPrepareDepiction(mol);

OEDepict.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:

OEDepict.OEPrepareDepiction(mol);

OE2DMolDisplayOptions opts = new OE2DMolDisplayOptions(200.0, 200.0, OEScale.AutoScale);
OE2DMolDisplay disp = new OE2DMolDisplay(mol, opts);

oeofstream ofs = new oeofstream("OERenderMolecule-stream-disp.png");
OEDepict.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:

OEDepict.OEPrepareDepiction(mol);

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

See also