RDKit
Open-source cheminformatics and machine learning.
Toggle main menu visibility
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
19
#include <
GraphMol/MolDraw2D/AtomSymbol.h
>
20
#include <
GraphMol/MolDraw2D/DrawMol.h
>
21
22
namespace
RDKit
{
23
namespace
MolDraw2D_detail
{
24
25
class
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
;
61
DrawMolMCH
&
operator=
(
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
AtomSymbol.h
DrawMol.h
RDKit::MolDraw2D_detail::DrawMolMCH::DrawMolMCH
DrawMolMCH(DrawMol &&)=delete
RDKit::MolDraw2D_detail::DrawMolMCH::DrawMolMCH
DrawMolMCH(const DrawMol &)=delete
RDKit::MolDraw2D_detail::DrawMolMCH::operator=
DrawMolMCH & operator=(const DrawMol &)=delete
RDKit::MolDraw2D_detail::DrawMolMCH::mcHighlightBondMap_
const std::map< int, std::vector< DrawColour > > & mcHighlightBondMap_
Definition
DrawMolMCH.h:69
RDKit::MolDraw2D_detail::DrawMolMCH::getAtomRadius
void getAtomRadius(unsigned int atomIdx, double &xradius, double &yradius) const
RDKit::MolDraw2D_detail::DrawMolMCH::operator=
DrawMolMCH & operator=(DrawMol &&)=delete
RDKit::MolDraw2D_detail::DrawMolMCH::extractMCHighlights
virtual void extractMCHighlights()=0
RDKit::MolDraw2D_detail::DrawMolMCH::mcHighlightAtomMap_
const std::map< int, std::vector< DrawColour > > & mcHighlightAtomMap_
Definition
DrawMolMCH.h:68
RDKit::MolDraw2D_detail::DrawMolMCH::DrawMolMCH
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)
RDKit::MolDraw2D_detail::DrawMolMCH::extractHighlights
void extractHighlights(double scale) override
RDKit::MolDraw2D_detail::DrawMolMCH::highlightLinewidthMultipliers_
const std::map< int, int > & highlightLinewidthMultipliers_
Definition
DrawMolMCH.h:70
RDKit::MolDraw2D_detail::DrawMol::DrawMol
DrawMol(const ROMol &mol, const std::string &legend, int width, int height, const MolDrawOptions &drawOptions, DrawText &textDrawer, const std::vector< int > *highlightAtoms=nullptr, const std::vector< int > *highlightBonds=nullptr, const std::map< int, DrawColour > *highlightAtomMap=nullptr, const std::map< int, DrawColour > *highlightBondMap=nullptr, const std::vector< std::pair< DrawColour, DrawColour > > *bondColours=nullptr, const std::map< int, double > *highlight_radii=nullptr, bool includeAnnotations=true, int confId=-1, bool isReactionMol=false)
RDKit::MolDraw2D_detail::DrawText
Definition
DrawText.h:46
RDKit::ROMol
Definition
ROMol.h:344
RDKit::MolDraw2D_detail
Definition
AtomSymbol.h:30
RDKit
Std stuff.
Definition
Abbreviations.h:19
RDKit::MolDrawOptions
Definition
MolDraw2DHelpers.h:174
GraphMol
MolDraw2D
DrawMolMCH.h
Generated on
for RDKit by
1.17.0