RDKit: MolDraw2DUtils.h Source File

| RDKit Open-source cheminformatics and machine learning.

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

MolDraw2DUtils.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2016 Greg Landrum
3 //
4 // @@ All Rights Reserved @@
5 // This file is part of the RDKit.
6 // The contents are covered by the terms of the BSD license
7 // which is included in the file license.txt, found at the root
8 // of the RDKit source tree.
9 //
10
11 #ifndef MOLDRAW2DUTILS_H
12 #define MOLDRAW2DUTILS_H
13 #include <GraphMol/RWMol.h>
14
15 // ****************************************************************************
16
17 namespace RDKit {
18 class MolDraw2D;
19 namespace MolDraw2DUtils {
20 //! Does some cleanup operations on the molecule to prepare it to draw nicely
21 /*
22 The operations include: kekulization, addition of chiral Hs (so that we can draw
23 wedges to them), wedging of bonds at chiral centers, and generation of a 2D
24 conformation if the molecule does not already have a conformation
25
26 \param mol: the molecule to be modified
27 \param kekulize: toggles kekulization (this can fail, see below)
28 \param addChiralHs: adds Hs to the graph on chiral atoms
29 \param wedgeBonds: calls WedgeMolBonds()
30 \param forceCoords: generates a 2D conformation even if one is present already
31
32 NOTE: the kekulization step can fail, throwing a MolSanitizeExecption. If this
33 happens the molecule will be in an inconsistent, partially kekulized, state.
34 This isn't normally a problem for molecules that have been sanitized, but can be
35 problematic if the molecules have been modified post santitization.
36 */
37 void prepareMolForDrawing(RWMol &mol, bool kekulize = true,
38 bool addChiralHs = true, bool wedgeBonds = true,
39 bool forceCoords = false);
40
41 void updateDrawerParamsFromJSON(MolDraw2D &drawer, const char *json);
42 void updateDrawerParamsFromJSON(MolDraw2D &drawer, const std::string &json);
43 }
44 }
45 #endif // MOLDRAW2DUTILS_H
RDKit::MolDraw2DUtils::updateDrawerParamsFromJSON
void updateDrawerParamsFromJSON(MolDraw2D &drawer, const char *json)
RDKit::RWMol
RWMol is a molecule class that is intended to be edited.
Definition: RWMol.h:30
RDKit
Std stuff.
Definition: Atom.h:29
RDKit::MolDraw2D
MolDraw2D is the base class for doing 2D renderings of molecules.
Definition: MolDraw2D.h:132
RDKit::MolDraw2DUtils::prepareMolForDrawing
void prepareMolForDrawing(RWMol &mol, bool kekulize=true, bool addChiralHs=true, bool wedgeBonds=true, bool forceCoords=false)
Does some cleanup operations on the molecule to prepare it to draw nicely.
RWMol.h
Defines the editable molecule class RWMol.