RDKit: RDKit::MolDraw2DUtils Namespace Reference

| RDKit Open-source cheminformatics and machine learning.

Loading...
Searching...
No Matches
Classes | Functions
RDKit::MolDraw2DUtils Namespace Reference

## Classes
struct | ContourParams

## Functions
RDKIT_MOLDRAW2D_EXPORT void | prepareMolForDrawing (RWMol &mol, bool kekulize=true, bool addChiralHs=true, bool wedgeBonds=true, bool forceCoords=false, bool wavyBonds=false)
| Does some cleanup operations on the molecule to prepare it to draw nicely.
RDKIT_MOLDRAW2D_EXPORT void | prepareAndDrawMolecule (MolDraw2D &drawer, const ROMol &mol, const std::string &legend="", const std::vector< int > *highlight_atoms=nullptr, const std::vector< int > *highlight_bonds=nullptr, const std::map< int, DrawColour > *highlight_atom_map=nullptr, const std::map< int, DrawColour > *highlight_bond_map=nullptr, const std::map< int, double > *highlight_radii=nullptr, int confId=-1, bool kekulize=true, bool addChiralHs=true, bool wedgeBonds=true, bool forceCoords=false, bool wavyBonds=false)
| prepare a molecule for drawing and draw it
RDKIT_MOLDRAW2D_EXPORT void | updateDrawerParamsFromJSON (MolDraw2D &drawer, const char *json)
RDKIT_MOLDRAW2D_EXPORT void | updateDrawerParamsFromJSON (MolDraw2D &drawer, const std::string &json)
RDKIT_MOLDRAW2D_EXPORT void | updateMolDrawOptionsFromJSON (MolDrawOptions &opts, const char *json)
RDKIT_MOLDRAW2D_EXPORT void | updateMolDrawOptionsFromJSON (MolDrawOptions &opts, const std::string &json)
RDKIT_MOLDRAW2D_EXPORT void | contourAndDrawGrid (MolDraw2D &drawer, const double *grid, const std::vector< double > &xcoords, const std::vector< double > &ycoords, size_t nContours, std::vector< double > &levels, const ContourParams &ps=ContourParams(), const ROMol *mol=nullptr)
| Generates and draws contours for data on a grid.
RDKIT_MOLDRAW2D_EXPORT void | contourAndDrawGrid (MolDraw2D &drawer, const double *grid, const std::vector< double > &xcoords, const std::vector< double > &ycoords, size_t nContours=10, const ContourParams &ps=ContourParams(), const ROMol *mol=nullptr)
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
RDKIT_MOLDRAW2D_EXPORT void | contourAndDrawGaussians (MolDraw2D &drawer, const std::vector< Point2D > &locs, const std::vector< double > &heights, const std::vector< double > &widths, size_t nContours, std::vector< double > &levels, const ContourParams &ps=ContourParams(), const ROMol *mol=nullptr)
| Generates and draws contours for a set of gaussians.
RDKIT_MOLDRAW2D_EXPORT void | contourAndDrawGaussians (MolDraw2D &drawer, const std::vector< Point2D > &locs, const std::vector< double > &heights, const std::vector< double > &widths, size_t nContours=10, const ContourParams &ps=ContourParams(), const ROMol *mol=nullptr)
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
RDKIT_MOLDRAW2D_EXPORT void | drawMolACS1996 (MolDraw2D &drawer, const ROMol &mol, const std::string &legend, const std::vector< int > *highlight_atoms, const std::vector< int > *highlight_bonds, const std::map< int, DrawColour > *highlight_atom_map=nullptr, const std::map< int, DrawColour > *highlight_bond_map=nullptr, const std::map< int, double > *highlight_radii=nullptr, int confId=-1)
| Draw a molecule to a MolDraw2D object according to ACS 1996 guidelines.
RDKIT_MOLDRAW2D_EXPORT void | setACS1996Options (MolDrawOptions &opts, double meanBondLen=1.0)
RDKIT_MOLDRAW2D_EXPORT double | meanBondLength (const ROMol &mol, int confId=-1)

## Function Documentation

## ◆ contourAndDrawGaussians() [1/2]

RDKIT_MOLDRAW2D_EXPORT void RDKit::MolDraw2DUtils::contourAndDrawGaussians | ( | MolDraw2D & | drawer,
|  | const std::vector< Point2D > & | locs,
|  | const std::vector< double > & | heights,
|  | const std::vector< double > & | widths,
|  | size_t | nContours,
|  | std::vector< double > & | levels,
|  | const ContourParams & | ps = ContourParams(),
|  | const ROMol * | mol = nullptr )

Generates and draws contours for a set of gaussians.

References RDKIT_MOLDRAW2D_EXPORT.

Referenced by contourAndDrawGaussians().

## ◆ contourAndDrawGaussians() [2/2]

RDKIT_MOLDRAW2D_EXPORT void RDKit::MolDraw2DUtils::contourAndDrawGaussians | ( | MolDraw2D & | drawer,
|  | const std::vector< Point2D > & | locs,
|  | const std::vector< double > & | heights,
|  | const std::vector< double > & | widths,
|  | size_t | nContours = 10,
|  | const ContourParams & | ps = ContourParams(),
|  | const ROMol * | mol = nullptr )
| inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 184 of file MolDraw2DUtils.h.

References contourAndDrawGaussians(), and RDKIT_MOLDRAW2D_EXPORT.

## ◆ contourAndDrawGrid() [1/2]

RDKIT_MOLDRAW2D_EXPORT void RDKit::MolDraw2DUtils::contourAndDrawGrid | ( | MolDraw2D & | drawer,
|  | const double * | grid,
|  | const std::vector< double > & | xcoords,
|  | const std::vector< double > & | ycoords,
|  | size_t | nContours,
|  | std::vector< double > & | levels,
|  | const ContourParams & | ps = ContourParams(),
|  | const ROMol * | mol = nullptr )

Generates and draws contours for data on a grid.

References RDKIT_MOLDRAW2D_EXPORT.

Referenced by contourAndDrawGrid().

## ◆ contourAndDrawGrid() [2/2]

RDKIT_MOLDRAW2D_EXPORT void RDKit::MolDraw2DUtils::contourAndDrawGrid | ( | MolDraw2D & | drawer,
|  | const double * | grid,
|  | const std::vector< double > & | xcoords,
|  | const std::vector< double > & | ycoords,
|  | size_t | nContours = 10,
|  | const ContourParams & | ps = ContourParams(),
|  | const ROMol * | mol = nullptr )
| inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 141 of file MolDraw2DUtils.h.

References contourAndDrawGrid(), and RDKIT_MOLDRAW2D_EXPORT.

## ◆ drawMolACS1996()

RDKIT_MOLDRAW2D_EXPORT void RDKit::MolDraw2DUtils::drawMolACS1996 | ( | MolDraw2D & | drawer,
|  | const ROMol & | mol,
|  | const std::string & | legend,
|  | const std::vector< int > * | highlight_atoms,
|  | const std::vector< int > * | highlight_bonds,
|  | const std::map< int, DrawColour > * | highlight_atom_map = nullptr,
|  | const std::map< int, DrawColour > * | highlight_bond_map = nullptr,
|  | const std::map< int, double > * | highlight_radii = nullptr,
|  | int | confId = -1 )

Draw a molecule to a MolDraw2D object according to ACS 1996 guidelines.

References RDKIT_MOLDRAW2D_EXPORT.

## ◆ meanBondLength()

RDKIT_MOLDRAW2D_EXPORT double RDKit::MolDraw2DUtils::meanBondLength | ( | const ROMol & | mol,
|  | int | confId = -1 )

References RDKIT_MOLDRAW2D_EXPORT.

## ◆ prepareAndDrawMolecule()

RDKIT_MOLDRAW2D_EXPORT void RDKit::MolDraw2DUtils::prepareAndDrawMolecule | ( | MolDraw2D & | drawer,
|  | const ROMol & | mol,
|  | const std::string & | legend = "",
|  | const std::vector< int > * | highlight_atoms = nullptr,
|  | const std::vector< int > * | highlight_bonds = nullptr,
|  | const std::map< int, DrawColour > * | highlight_atom_map = nullptr,
|  | const std::map< int, DrawColour > * | highlight_bond_map = nullptr,
|  | const std::map< int, double > * | highlight_radii = nullptr,
|  | int | confId = -1,
|  | bool | kekulize = true,
|  | bool | addChiralHs = true,
|  | bool | wedgeBonds = true,
|  | bool | forceCoords = false,
|  | bool | wavyBonds = false )

prepare a molecule for drawing and draw it

References RDKIT_MOLDRAW2D_EXPORT.

## ◆ prepareMolForDrawing()

RDKIT_MOLDRAW2D_EXPORT void RDKit::MolDraw2DUtils::prepareMolForDrawing | ( | RWMol & | mol,
|  | bool | kekulize = true,
|  | bool | addChiralHs = true,
|  | bool | wedgeBonds = true,
|  | bool | forceCoords = false,
|  | bool | wavyBonds = false )

Does some cleanup operations on the molecule to prepare it to draw nicely.

References RDKIT_MOLDRAW2D_EXPORT.

## ◆ setACS1996Options()

RDKIT_MOLDRAW2D_EXPORT void RDKit::MolDraw2DUtils::setACS1996Options | ( | MolDrawOptions & | opts,
|  | double | meanBondLen = 1.0 )

Set the draw options to produce something as close as possible to the ACS 1996 guidelines as described at https://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style/Chemistry/Structure_drawing

References RDKIT_MOLDRAW2D_EXPORT.

## ◆ updateDrawerParamsFromJSON() [1/2]

RDKIT_MOLDRAW2D_EXPORT void RDKit::MolDraw2DUtils::updateDrawerParamsFromJSON | ( | MolDraw2D & | drawer,
|  | const char * | json )

References RDKIT_MOLDRAW2D_EXPORT.

## ◆ updateDrawerParamsFromJSON() [2/2]

RDKIT_MOLDRAW2D_EXPORT void RDKit::MolDraw2DUtils::updateDrawerParamsFromJSON | ( | MolDraw2D & | drawer,
|  | const std::string & | json )

References RDKIT_MOLDRAW2D_EXPORT.

## ◆ updateMolDrawOptionsFromJSON() [1/2]

RDKIT_MOLDRAW2D_EXPORT void RDKit::MolDraw2DUtils::updateMolDrawOptionsFromJSON | ( | MolDrawOptions & | opts,
|  | const char * | json )

References RDKIT_MOLDRAW2D_EXPORT.

## ◆ updateMolDrawOptionsFromJSON() [2/2]

RDKIT_MOLDRAW2D_EXPORT void RDKit::MolDraw2DUtils::updateMolDrawOptionsFromJSON | ( | MolDrawOptions & | opts,
|  | const std::string & | json )

References RDKIT_MOLDRAW2D_EXPORT.