RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
DrawMolMCH.h
Go to the documentation of this file.
1//
2// Copyright (C) 2021-2022 David Cosgrove and other RDKit contributors
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// Original author: David Cosgrove (CozChemIx Limited)
11//
12// This class, derived from DrawMol, does multi-coloured highlights.
13// Like DrawMol, it is not part of the public API and should only be
14// used by MolDraw2D.
15
16#ifndef RDKIT_DRAWMOLMCH_H
17#define RDKIT_DRAWMOLMCH_H
18
21
22namespace RDKit {
23namespace MolDraw2D_detail {
24
25class DrawMolMCH : public DrawMol {
26 public:
27 /*!
28 Make a DrawMol that does multi-coloured highlights. Both atoms and
29 bonds can have more than 1 highlight. There's no maximum although more
30 than 4 is very cluttered.
31 \param mol : the molecule to draw
32 \param legend : the legend (to be drawn under the molecule)
33 \param width : width (in pixels) of the rendering
34 set this to -1 to have the canvas size set automatically
35 \param height : height (in pixels) of the rendering
36 set this to -1 to have the canvas size set automatically
37 \param drawOptions : a MolDrawOptions object from the owning MolDraw2D
38 \param textDrawer : a DrawText object from the owning MolDraw2D
39 \param highlight_atom_map : indexed on atom idx, the colours to be used to
40 highlight atoms. Not all atoms need to be mentioned.
41 \param highlight_bond_map : indexed on bond idx, the colours to be used to
42 highlight bonds. Not all bonds need to be mentioned.
43 \param highlightRadii : map from atomId -> radius (in molecule coordinates)
44 for the radii of atomic highlights. If not provided for an atom, the default
45 value from \c drawOptions() will be used.
46 \param highlight_linewidth_multipliers : map from bondId -> int, to change
47 the thickness of the lines used for the highlighting.
48 \param confId : (optional) conformer ID to be used for atomic
49 coordinates
50 */
51 DrawMolMCH(const ROMol &mol, const std::string &legend, int width, int height,
52 MolDrawOptions &drawOptions, DrawText &textDrawer,
53 const std::map<int, std::vector<DrawColour>> &highlight_atom_map,
54 const std::map<int, std::vector<DrawColour>> &highlight_bond_map,
55 const std::map<int, double> &highlight_radii,
56 const std::map<int, int> &highlight_linewidth_multipliers,
57 int confId = -1);
58 DrawMolMCH(const DrawMol &) = delete;
59 DrawMolMCH(DrawMol &&) = delete;
60 DrawMolMCH &operator=(const DrawMol &) = delete;
62
63 void extractHighlights(double scale) override;
64 virtual void extractMCHighlights() = 0;
65 void getAtomRadius(unsigned int atomIdx, double &xradius,
66 double &yradius) const;
67
68 const std::map<int, std::vector<DrawColour>> &mcHighlightAtomMap_;
69 const std::map<int, std::vector<DrawColour>> &mcHighlightBondMap_;
70 const std::map<int, int> &highlightLinewidthMultipliers_;
71};
72
73} // namespace MolDraw2D_detail
74} // namespace RDKit
75
76#endif // RDKIT_DRAWMOLMCH_H
DrawMolMCH(const DrawMol &)=delete
DrawMolMCH & operator=(const DrawMol &)=delete
const std::map< int, std::vector< DrawColour > > & mcHighlightBondMap_
Definition DrawMolMCH.h:69
void getAtomRadius(unsigned int atomIdx, double &xradius, double &yradius) const
DrawMolMCH & operator=(DrawMol &&)=delete
const std::map< int, std::vector< DrawColour > > & mcHighlightAtomMap_
Definition DrawMolMCH.h:68
DrawMolMCH(const ROMol &mol, const std::string &legend, int width, int height, MolDrawOptions &drawOptions, DrawText &textDrawer, const std::map< int, std::vector< DrawColour > > &highlight_atom_map, const std::map< int, std::vector< DrawColour > > &highlight_bond_map, const std::map< int, double > &highlight_radii, const std::map< int, int > &highlight_linewidth_multipliers, int confId=-1)
void extractHighlights(double scale) override
const std::map< int, int > & highlightLinewidthMultipliers_
Definition DrawMolMCH.h:70
Std stuff.
bool rdvalue_is(const RDValue_cast_t)