RDKit
Open-source cheminformatics and machine learning.
MolDraw2D.h
Go to the documentation of this file.
1 //
2 // @@ All Rights Reserved @@
3 // This file is part of the RDKit.
4 // The contents are covered by the terms of the BSD license
5 // which is included in the file license.txt, found at the root
6 // of the RDKit source tree.
7 //
8 // Original author: David Cosgrove (AstraZeneca)
9 // 27th May 2014
10 //
11 // This class makes a 2D drawing of an RDKit molecule.
12 // It draws heavily on $RDBASE/GraphMol/MolDrawing/MolDrawing.h.
13 // One purpose of this is to make it easier to overlay annotations on top of
14 // the molecule drawing, which is difficult to do from the output of
15 // MolDrawing.h
16 // The class design philosophy echoes a standard one:
17 // a virtual base class defines the interface and does all
18 // the heavy lifting and concrete derived classes implement
19 // library-specific drawing code such as drawing lines, writing strings
20 // etc.
21 
22 #include <RDGeneral/export.h>
23 #ifndef RDKITMOLDRAW2D_H
24 #define RDKITMOLDRAW2D_H
25 
26 #include <vector>
27 
28 #include <Geometry/point.h>
29 #include <GraphMol/RDKitBase.h>
31 
32 #include <boost/tuple/tuple.hpp>
33 
34 // ****************************************************************************
35 using RDGeom::Point2D;
36 
37 namespace RDKit {
38 
39 typedef boost::tuple<float, float, float> DrawColour;
40 typedef std::map<int, DrawColour> ColourPalette;
41 typedef std::vector<unsigned int> DashPattern;
42 
43 inline void assignDefaultPalette(ColourPalette &palette) {
44  palette.clear();
45  palette[-1] = DrawColour(0, 0, 0);
46  palette[0] = DrawColour(0.5, 0.5, 0.5);
47  palette[1] = palette[6] = DrawColour(0.0, 0.0, 0.0);
48  palette[7] = DrawColour(0.0, 0.0, 1.0);
49  palette[8] = DrawColour(1.0, 0.0, 0.0);
50  palette[9] = DrawColour(0.2, 0.8, 0.8);
51  palette[15] = DrawColour(1.0, 0.5, 0.0);
52  palette[16] = DrawColour(0.8, 0.8, 0.0);
53  palette[17] = DrawColour(0.0, 0.802, 0.0);
54  palette[35] = DrawColour(0.5, 0.3, 0.1);
55  palette[53] = DrawColour(0.63, 0.12, 0.94);
56 };
57 
58 inline void assignBWPalette(ColourPalette &palette) {
59  palette.clear();
60  palette[-1] = DrawColour(0, 0, 0);
61 };
62 
64  bool atomLabelDeuteriumTritium; // toggles replacing 2H with D and 3H with T
65  bool dummiesAreAttachments; // draws "breaks" at dummy atoms
66  bool circleAtoms; // draws circles under highlighted atoms
67  DrawColour highlightColour; // default highlight color
68  bool continuousHighlight; // highlight by drawing an outline *underneath* the
69  // molecule
70  bool fillHighlights; // fill the areas used to highlight atoms and atom
71  // regions
72  int flagCloseContactsDist; // if positive, this will be used as a cutoff (in
73  // pixels) for highlighting close contacts
74  bool includeAtomTags; // toggles inclusion of atom tags in the output. does
75  // not make sense for all renderers.
76  bool clearBackground; // toggles clearing the background before drawing a
77  // molecule
78  DrawColour
79  backgroundColour; // color to be used while clearing the background
80  int legendFontSize; // font size (in pixels) to be used for the legend (if
81  // present)
82  DrawColour legendColour; // color to be used for the legend (if present)
83  double multipleBondOffset; // offset (in Angstroms) for the extra lines in a
84  // multiple bond
85  double padding; // fraction of empty space to leave around the molecule
86  double additionalAtomLabelPadding; // additional padding to leave around atom
87  // labels. Expressed as a fraction of the
88  // font size.
89  std::map<int, std::string> atomLabels; // replacement labels for atoms
90  std::vector<std::vector<int> > atomRegions; // regions
91  DrawColour
92  symbolColour; // color to be used for the symbols and arrows in reactions
93  std::vector<DrawColour> highlightColourPalette; // defining 10 default colors
94  // for highlighting atoms and bonds
95  // or reactants in a reactions
96  ColourPalette atomColourPalette; // the palette used to assign
97  // colors to atoms based on
98  // atomic number. -1 is the default value
99 
101  : atomLabelDeuteriumTritium(false),
102  dummiesAreAttachments(false),
103  circleAtoms(true),
104  highlightColour(1, .5, .5),
105  continuousHighlight(true),
106  fillHighlights(true),
107  flagCloseContactsDist(3),
108  includeAtomTags(false),
109  clearBackground(true),
110  backgroundColour(1, 1, 1),
111  legendFontSize(12),
112  legendColour(0, 0, 0),
113  multipleBondOffset(0.15),
114  padding(0.05),
115  additionalAtomLabelPadding(0.0),
116  symbolColour(0, 0, 0) {
117  highlightColourPalette.push_back(
118  DrawColour(1., 1., .67)); // popcorn yellow
119  highlightColourPalette.push_back(DrawColour(1., .8, .6)); // sand
120  highlightColourPalette.push_back(DrawColour(1., .71, .76)); // light pink
121  highlightColourPalette.push_back(DrawColour(.8, 1., .8)); // offwhitegreen
122  highlightColourPalette.push_back(DrawColour(.87, .63, .87)); // plum
123  highlightColourPalette.push_back(DrawColour(.76, .94, .96)); // pastel blue
124  highlightColourPalette.push_back(DrawColour(.67, .67, 1.)); // periwinkle
125  highlightColourPalette.push_back(DrawColour(.64, .76, .34)); // avocado
126  highlightColourPalette.push_back(DrawColour(.56, .93, .56)); // light green
127  highlightColourPalette.push_back(DrawColour(.20, .63, .79)); // peacock
128  assignDefaultPalette(atomColourPalette);
129  };
130 };
131 
132 //! MolDraw2D is the base class for doing 2D renderings of molecules
134  public:
135  typedef enum { C = 0, N, E, S, W } OrientType;
136  typedef enum {
137  TextDrawNormal = 0,
139  TextDrawSubscript
140  } TextDrawType;
141 
142  //! constructor for a particular size
143  /*!
144  \param width : width (in pixels) of the rendering
145  \param height : height (in pixels) of the rendering
146  \param panelWidth : (optional) width (in pixels) of a single panel
147  \param panelHeight : (optional) height (in pixels) of a single panel
148 
149  The \c panelWidth and \c panelHeight arguments are used to provide the
150  sizes of the panels individual molecules are drawn in when
151  \c drawMolecules() is called.
152  */
153  MolDraw2D(int width, int height, int panelWidth = -1, int panelHeight = -1);
154 
155  virtual ~MolDraw2D() {}
156 
157  //! draw a single molecule
158  /*!
159  \param mol : the molecule to draw
160  \param legend : the legend (to be drawn under the molecule)
161  \param highlight_atoms : (optional) vector of atom ids to highlight
162  \param highlight_atoms : (optional) vector of bond ids to highlight
163  \param highlight_atom_map : (optional) map from atomId -> DrawColour
164  providing the highlight colors. If not provided the default highlight colour
165  from \c drawOptions() will be used.
166  \param highlight_bond_map : (optional) map from bondId -> DrawColour
167  providing the highlight colors. If not provided the default highlight colour
168  from \c drawOptions() will be used.
169  \param highlight_radii : (optional) map from atomId -> radius (in molecule
170  coordinates) for the radii of atomic highlights. If not provided the default
171  value from \c drawOptions() will be used.
172  \param confId : (optional) conformer ID to be used for atomic
173  coordinates
174 
175  */
176  virtual void drawMolecule(
177  const ROMol &mol, const std::string &legend,
178  const std::vector<int> *highlight_atoms,
179  const std::vector<int> *highlight_bonds,
180  const std::map<int, DrawColour> *highlight_atom_map = NULL,
181  const std::map<int, DrawColour> *highlight_bond_map = NULL,
182  const std::map<int, double> *highlight_radii = NULL, int confId = -1);
183 
184  //! \overload
185  virtual void drawMolecule(
186  const ROMol &mol, const std::vector<int> *highlight_atoms = NULL,
187  const std::map<int, DrawColour> *highlight_map = NULL,
188  const std::map<int, double> *highlight_radii = NULL, int confId = -1);
189 
190  //! \overload
191  virtual void drawMolecule(
192  const ROMol &mol, const std::string &legend,
193  const std::vector<int> *highlight_atoms = NULL,
194  const std::map<int, DrawColour> *highlight_map = NULL,
195  const std::map<int, double> *highlight_radii = NULL, int confId = -1);
196 
197  //! \overload
198  virtual void drawMolecule(
199  const ROMol &mol, const std::vector<int> *highlight_atoms,
200  const std::vector<int> *highlight_bonds,
201  const std::map<int, DrawColour> *highlight_atom_map = NULL,
202  const std::map<int, DrawColour> *highlight_bond_map = NULL,
203  const std::map<int, double> *highlight_radii = NULL, int confId = -1);
204 
205  //! draw multiple molecules in a grid
206  /*!
207  \param mols : the molecules to draw
208  \param legends : (optional) the legends (to be drawn under the
209  molecules)
210  \param highlight_atoms : (optional) vectors of atom ids to highlight
211  \param highlight_atoms : (optional) vectors of bond ids to highlight
212  \param highlight_atom_map : (optional) maps from atomId -> DrawColour
213  providing the highlight colors. If not provided the default highlight colour
214  from \c drawOptions() will be used.
215  \param highlight_bond_map : (optional) maps from bondId -> DrawColour
216  providing the highlight colors. If not provided the default highlight colour
217  from \c drawOptions() will be used.
218  \param highlight_radii : (optional) maps from atomId -> radius (in molecule
219  coordinates) for the radii of atomic highlights. If not provided the default
220  value from \c drawOptions() will be used.
221  \param confId : (optional) conformer IDs to be used for atomic
222  coordinates
223 
224  The \c panelWidth and \c panelHeight values will be used to determine the
225  number of rows and columns to be drawn. Theres not a lot of error checking
226  here, so if you provide too many molecules for the number of panes things
227  are likely to get screweed up.
228  If the number of rows or columns ends up being <= 1, molecules will be
229  being drawn in a single row/column.
230  */
231  virtual void drawMolecules(
232  const std::vector<ROMol *> &mols,
233  const std::vector<std::string> *legends = NULL,
234  const std::vector<std::vector<int> > *highlight_atoms = NULL,
235  const std::vector<std::vector<int> > *highlight_bonds = NULL,
236  const std::vector<std::map<int, DrawColour> > *highlight_atom_maps = NULL,
237  const std::vector<std::map<int, DrawColour> > *highlight_bond_maps = NULL,
238  const std::vector<std::map<int, double> > *highlight_radii = NULL,
239  const std::vector<int> *confIds = NULL);
240 
241  //! draw a ChemicalReaction
242  /*!
243  \param rxn : the reaction to draw
244  \param highlightByReactant : (optional) if this is set, atoms and bonds will
245  be highlighted based on which reactant they come from. Atom map numbers
246  will not be shown.
247  \param highlightColorsReactants : (optional) provide a vector of colors for
248  the
249  reactant highlighting.
250  \param confIds : (optional) vector of confIds to use for rendering. These
251  are numbered by reactants, then agents, then products.
252  */
253  virtual void drawReaction(
254  const ChemicalReaction &rxn, bool highlightByReactant = false,
255  const std::vector<DrawColour> *highlightColorsReactants = NULL,
256  const std::vector<int> *confIds = NULL);
257 
258  //! \name Transformations
259  //@{
260  // transform a set of coords in the molecule's coordinate system
261  // to drawing system coordinates and vice versa. Note that the coordinates
262  // have
263  // the origin in the top left corner, which is how Qt and Cairo have it, no
264  // doubt a holdover from X Windows. This means that a higher y value will be
265  // nearer the bottom of the screen. This doesn't really matter except when
266  // doing text superscripts and subscripts.
267 
268  //! transform a point from the molecule coordinate system into the drawing
269  //! coordinate system
270  virtual Point2D getDrawCoords(const Point2D &mol_cds) const;
271  //! returns the drawing coordinates of a particular atom
272  virtual Point2D getDrawCoords(int at_num) const;
273  virtual Point2D getAtomCoords(const std::pair<int, int> &screen_cds) const;
274  //! transform a point from drawing coordinates to the molecule coordinate
275  //! system
276  virtual Point2D getAtomCoords(
277  const std::pair<double, double> &screen_cds) const;
278  //! returns the molecular coordinates of a particular atom
279  virtual Point2D getAtomCoords(int at_num) const;
280  //@}
281 
282  //! return the width of the drawing area.
283  virtual int width() const { return width_; }
284  //! return the height of the drawing area.
285  virtual int height() const { return height_; }
286  //! return the width of the drawing panels.
287  virtual int panelWidth() const { return panel_width_; }
288  //! return the height of the drawing panels.
289  virtual int panelHeight() const { return panel_height_; }
290 
291  //! returns the drawing scale (conversion from molecular coords -> drawing
292  // coords)
293  double scale() const { return scale_; }
294  //! calculates the drawing scale (conversion from molecular coords -> drawing
295  // coords)
296  void calculateScale(int width, int height);
297  //! \overload
298  void calculateScale() { calculateScale(panel_width_, panel_height_); };
299  //! explicitly sets the scaling factors for the drawing
300  void setScale(int width, int height, const Point2D &minv,
301  const Point2D &maxv);
302  //! sets the drawing offset (in drawing coords)
303  void setOffset(int x, int y) {
304  x_offset_ = x;
305  y_offset_ = y;
306  }
307  //! returns the drawing offset (in drawing coords)
308  Point2D offset() { return Point2D(x_offset_, y_offset_); }
309  //! returns the font size (in nolecule units)
310  virtual double fontSize() const { return font_size_; }
311  //! set font size in molecule coordinate units. That's probably Angstrom for
312  //! RDKit.
313  virtual void setFontSize(double new_size);
314 
315  //! sets the current draw color
316  virtual void setColour(const DrawColour &col) { curr_colour_ = col; }
317  //! returns the current draw color
318  virtual DrawColour colour() const { return curr_colour_; }
319  //! sets the current dash pattern
320  virtual void setDash(const DashPattern &patt) { curr_dash_ = patt; }
321  //! returns the current dash pattern
322  virtual const DashPattern &dash() const { return curr_dash_; }
323 
324  //! sets the current line width
325  virtual void setLineWidth(int width) { curr_width_ = width; }
326  //! returns the current line width
327  virtual int lineWidth() const { return curr_width_; }
328 
329  //! establishes whether to put string draw mode into super- or sub-script
330  //! mode based on contents of instring from i onwards. Increments i
331  //! appropriately
332  //! \returns true or false depending on whether it did something or not
333  bool setStringDrawMode(const std::string &instring, TextDrawType &draw_mode,
334  int &i) const;
335  //! clears the contes of the drawingd]
336  virtual void clearDrawing() = 0;
337  //! draws a line from \c cds1 to \c cds2 using the current drawing style
338  virtual void drawLine(const Point2D &cds1, const Point2D &cds2) = 0;
339 
340  //! using the current scale, work out the size of the label in molecule
341  //! coordinates.
342  /*!
343  Bear in mind when implementing this, that, for example, NH2 will appear as
344  NH<sub>2</sub> to convey that the 2 is a subscript, and this needs to
345  accounted for in the width and height.
346  */
347  virtual void getStringSize(const std::string &label, double &label_width,
348  double &label_height) const = 0;
349  //! drawString centres the string on cds.
350  virtual void drawString(const std::string &str, const Point2D &cds);
351 
352  //! draw a polygon
353  virtual void drawPolygon(const std::vector<Point2D> &cds) = 0;
354  //! draw a triange
355  virtual void drawTriangle(const Point2D &cds1, const Point2D &cds2,
356  const Point2D &cds3);
357  //! draw an ellipse
358  virtual void drawEllipse(const Point2D &cds1, const Point2D &cds2);
359  //! draw a rectangle
360  virtual void drawRect(const Point2D &cds1, const Point2D &cds2);
361  //! draw a line indicating the presence of an attachment point (normally a
362  //! squiggle line perpendicular to a bond)
363  virtual void drawAttachmentLine(const Point2D &cds1, const Point2D &cds2,
364  const DrawColour &col, double len = 1.0,
365  unsigned int nSegments = 16);
366  //! draw a wavy line like that used to indicate unknown stereochemistry
367  virtual void drawWavyLine(const Point2D &cds1, const Point2D &cds2,
368  const DrawColour &col1, const DrawColour &col2,
369  unsigned int nSegments = 16,
370  double vertOffset = 0.05);
371  //! adds additional information about the atoms to the output. Does not make
372  //! sense for all renderers.
373  virtual void tagAtoms(const ROMol &mol) { RDUNUSED_PARAM(mol); };
374  //! set whether or not polygons are being filled
375  virtual bool fillPolys() const { return fill_polys_; }
376  //! returns ehther or not polygons should be filled
377  virtual void setFillPolys(bool val) { fill_polys_ = val; }
378 
379  //! returns our current drawing options
380  MolDrawOptions &drawOptions() { return options_; }
381  //! \overload
382  const MolDrawOptions &drawOptions() const { return options_; }
383 
384  //! returns the coordinates of the atoms of the current molecule in molecular
385  //! coordinates
386  const std::vector<Point2D> &atomCoords() const {
387  PRECONDITION(activeMolIdx_ >= 0, "no index");
388  return at_cds_[activeMolIdx_];
389  };
390  //! returns the atomic symbols of the current molecule
391  const std::vector<std::pair<std::string, OrientType> > &atomSyms() const {
392  PRECONDITION(activeMolIdx_ >= 0, "no index");
393  return atom_syms_[activeMolIdx_];
394  };
395 
396  private:
397  bool needs_scale_;
398  int width_, height_, panel_width_, panel_height_;
399  double scale_;
400  double x_min_, y_min_, x_range_, y_range_;
401  double x_trans_, y_trans_;
402  int x_offset_, y_offset_; // translation in screen coordinates
403  // font_size_ in molecule coordinate units. Default 0.5 (a bit bigger
404  // than the default width of a double bond)
405  double font_size_;
406  int curr_width_;
407  bool fill_polys_;
408  int activeMolIdx_;
409 
410  DrawColour curr_colour_;
411  DashPattern curr_dash_;
412  MolDrawOptions options_;
413 
414  std::vector<std::vector<Point2D> > at_cds_; // from mol
415  std::vector<std::vector<int> > atomic_nums_;
416  std::vector<std::vector<std::pair<std::string, OrientType> > > atom_syms_;
417  Point2D bbox_[2];
418 
419  // draw the char, with the bottom left hand corner at cds
420  virtual void drawChar(char c, const Point2D &cds) = 0;
421 
422  // return a DrawColour based on the contents of highlight_atoms or
423  // highlight_map, falling back to atomic number by default
424  DrawColour getColour(int atom_idx,
425  const std::vector<int> *highlight_atoms = NULL,
426  const std::map<int, DrawColour> *highlight_map = NULL);
427  DrawColour getColourByAtomicNum(int atomic_num);
428 
429  void extractAtomCoords(const ROMol &mol, int confId, bool updateBBox);
430  void extractAtomSymbols(const ROMol &mol);
431 
432  virtual void drawLine(const Point2D &cds1, const Point2D &cds2,
433  const DrawColour &col1, const DrawColour &col2);
434  void drawBond(const ROMol &mol, const Bond* bond, int at1_idx,
435  int at2_idx, const std::vector<int> *highlight_atoms = NULL,
436  const std::map<int, DrawColour> *highlight_atom_map = NULL,
437  const std::vector<int> *highlight_bonds = NULL,
438  const std::map<int, DrawColour> *highlight_bond_map = NULL);
439  void drawWedgedBond(const Point2D &cds1, const Point2D &cds2,
440  bool draw_dashed, const DrawColour &col1,
441  const DrawColour &col2);
442  void drawAtomLabel(int atom_num,
443  const std::vector<int> *highlight_atoms = NULL,
444  const std::map<int, DrawColour> *highlight_map = NULL);
445  // cds1 and cds2 are 2 atoms in a ring. Returns the perpendicular pointing
446  // into
447  // the ring.
448  Point2D bondInsideRing(const ROMol &mol, const Bond* bond,
449  const Point2D &cds1, const Point2D &cds2);
450  // cds1 and cds2 are 2 atoms in a chain double bond. Returns the
451  // perpendicular
452  // pointing into the inside of the bond
453  Point2D bondInsideDoubleBond(const ROMol &mol, const Bond* bond);
454  // calculate normalised perpendicular to vector between two coords, such
455  // that
456  // it's inside the angle made between (1 and 2) and (2 and 3).
457  Point2D calcInnerPerpendicular(const Point2D &cds1, const Point2D &cds2,
458  const Point2D &cds3);
459 
460  // take the coords for atnum, with neighbour nbr_cds, and move cds out to
461  // accommodate
462  // the label associated with it.
463  void adjustBondEndForLabel(int atnum, const Point2D &nbr_cds,
464  Point2D &cds) const;
465 
466  // adds LaTeX-like annotation for super- and sub-script.
467  std::pair<std::string, OrientType> getAtomSymbolAndOrientation(
468  const Atom &atom, const Point2D &nbr_sum);
469 
470  protected:
471  virtual void doContinuousHighlighting(
472  const ROMol &mol, const std::vector<int> *highlight_atoms,
473  const std::vector<int> *highlight_bonds,
474  const std::map<int, DrawColour> *highlight_atom_map,
475  const std::map<int, DrawColour> *highlight_bond_map,
476  const std::map<int, double> *highlight_radii);
477 
478  virtual void highlightCloseContacts();
479 
480  // calculate normalised perpendicular to vector between two coords
481  Point2D calcPerpendicular(const Point2D &cds1, const Point2D &cds2);
482 };
483 }
484 
485 #endif // RDKITMOLDRAW2D_H
virtual void setColour(const DrawColour &col)
sets the current draw color
Definition: MolDraw2D.h:316
virtual int lineWidth() const
returns the current line width
Definition: MolDraw2D.h:327
virtual void setLineWidth(int width)
sets the current line width
Definition: MolDraw2D.h:325
virtual double fontSize() const
returns the font size (in nolecule units)
Definition: MolDraw2D.h:310
virtual int height() const
return the height of the drawing area.
Definition: MolDraw2D.h:285
void calculateScale()
Definition: MolDraw2D.h:298
std::vector< unsigned int > DashPattern
Definition: MolDraw2D.h:41
virtual int panelWidth() const
return the width of the drawing panels.
Definition: MolDraw2D.h:287
virtual void setDash(const DashPattern &patt)
sets the current dash pattern
Definition: MolDraw2D.h:320
DrawColour legendColour
Definition: MolDraw2D.h:82
const std::vector< Point2D > & atomCoords() const
Definition: MolDraw2D.h:386
virtual void setFillPolys(bool val)
returns ehther or not polygons should be filled
Definition: MolDraw2D.h:377
virtual DrawColour colour() const
returns the current draw color
Definition: MolDraw2D.h:318
void assignBWPalette(ColourPalette &palette)
Definition: MolDraw2D.h:58
virtual bool fillPolys() const
set whether or not polygons are being filled
Definition: MolDraw2D.h:375
This is a class for storing and applying general chemical reactions.
Definition: Reaction.h:118
pulls in the core RDKit functionality
void setOffset(int x, int y)
sets the drawing offset (in drawing coords)
Definition: MolDraw2D.h:303
MolDrawOptions & drawOptions()
returns our current drawing options
Definition: MolDraw2D.h:380
DrawColour backgroundColour
Definition: MolDraw2D.h:79
const MolDrawOptions & drawOptions() const
Definition: MolDraw2D.h:382
virtual int panelHeight() const
return the height of the drawing panels.
Definition: MolDraw2D.h:289
double additionalAtomLabelPadding
Definition: MolDraw2D.h:86
void assignDefaultPalette(ColourPalette &palette)
Definition: MolDraw2D.h:43
Std stuff.
Definition: Atom.h:30
virtual ~MolDraw2D()
Definition: MolDraw2D.h:155
class for representing a bond
Definition: Bond.h:47
#define RDUNUSED_PARAM(x)
Definition: Invariant.h:195
double scale() const
returns the drawing scale (conversion from molecular coords -> drawing
Definition: MolDraw2D.h:293
virtual const DashPattern & dash() const
returns the current dash pattern
Definition: MolDraw2D.h:322
MolDraw2D is the base class for doing 2D renderings of molecules.
Definition: MolDraw2D.h:133
double multipleBondOffset
Definition: MolDraw2D.h:83
ColourPalette atomColourPalette
Definition: MolDraw2D.h:96
virtual int width() const
return the width of the drawing area.
Definition: MolDraw2D.h:283
#define PRECONDITION(expr, mess)
Definition: Invariant.h:108
std::map< int, std::string > atomLabels
Definition: MolDraw2D.h:89
std::map< int, DrawColour > ColourPalette
Definition: MolDraw2D.h:40
std::vector< std::vector< int > > atomRegions
Definition: MolDraw2D.h:90
DrawColour highlightColour
Definition: MolDraw2D.h:67
#define RDKIT_MOLDRAW2D_EXPORT
Definition: export.h:385
std::vector< DrawColour > highlightColourPalette
Definition: MolDraw2D.h:93
DrawColour symbolColour
Definition: MolDraw2D.h:92
Point2D offset()
returns the drawing offset (in drawing coords)
Definition: MolDraw2D.h:308
The class for representing atoms.
Definition: Atom.h:69
const std::vector< std::pair< std::string, OrientType > > & atomSyms() const
returns the atomic symbols of the current molecule
Definition: MolDraw2D.h:391
boost::tuple< float, float, float > DrawColour
Definition: MolDraw2D.h:39
bool atomLabelDeuteriumTritium
Definition: MolDraw2D.h:64
virtual void tagAtoms(const ROMol &mol)
Definition: MolDraw2D.h:373