RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
DrawMolMCHCircleAndLine.h
Go to the documentation of this file.
1//
2// Copyright (C) 2023 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// This is the original multi-coloured highlighting code, which is done
11// by multi-coloured arcs and bars.
12
13#ifndef DRAWMOLMCHCIRCLEANDLINE_H
14#define DRAWMOLMCHCIRCLEANDLINE_H
15
17
18namespace RDKit {
19namespace MolDraw2D_detail {
20
22 public:
23 /*!
24 Make a DrawMol that does multi-coloured highlights. Both atoms and
25 bonds can have more than 1 highlight. There's no maximum although more
26 than 4 is very cluttered.
27 \param mol : the molecule to draw
28 \param legend : the legend (to be drawn under the molecule)
29 \param width : width (in pixels) of the rendering
30 set this to -1 to have the canvas size set automatically
31 \param height : height (in pixels) of the rendering
32 set this to -1 to have the canvas size set automatically
33 \param drawOptions : a MolDrawOptions object from the owning MolDraw2D
34 \param textDrawer : a DrawText object from the owning MolDraw2D
35 \param highlight_atom_map : indexed on atom idx, the colours to be used to
36 highlight atoms. Not all atoms need to be mentioned.
37 \param highlight_bond_map : indexed on bond idx, the colours to be used to
38 highlight bonds. Not all bonds need to be mentioned.
39 \param highlightRadii : map from atomId -> radius (in molecule coordinates)
40 for the radii of atomic highlights. If not provided for an atom, the default
41 value from \c drawOptions() will be used.
42 \param highlight_linewidth_multipliers : map from bondId -> int, to change
43 the thickness of the lines used for the highlighting.
44 \param confId : (optional) conformer ID to be used for atomic
45 coordinates
46 */
48 const ROMol &mol, const std::string &legend, int width, int height,
49 MolDrawOptions &drawOptions, DrawText &textDrawer,
50 const std::map<int, std::vector<DrawColour>> &highlight_atom_map,
51 const std::map<int, std::vector<DrawColour>> &highlight_bond_map,
52 const std::map<int, double> &highlight_radii,
53 const std::map<int, int> &highlight_linewidth_multipliers,
54 int confId = -1);
59
60 void extractHighlights(double scale) override;
61 void extractMCHighlights() override;
62
64 std::vector<std::unique_ptr<DrawShape>> &bondHighlights);
66 std::vector<std::unique_ptr<DrawShape>> &atomHighlights);
67 // adjust p2 so that the line from p1 to p2 stops where it intersects
68 // the label ellipse for at_idx.
70 void calcSymbolEllipse(unsigned int atomIdx, Point2D &centre, double &xradius,
71 double &yradius) const;
73 std::vector<std::unique_ptr<DrawShape>> &atomHighlights,
74 std::vector<std::unique_ptr<DrawShape>> &bondHighlights);
75};
76} // namespace MolDraw2D_detail
77} // namespace RDKit
78#endif // DRAWMOLMCHCIRCLEANDLINE_H
void calcSymbolEllipse(unsigned int atomIdx, Point2D &centre, double &xradius, double &yradius) const
void makeAtomHighlights(std::vector< std::unique_ptr< DrawShape > > &atomHighlights)
DrawMolMCHCircleAndLine(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 adjustLineEndForHighlight(int at_idx, Point2D p1, Point2D &p2) const
void makeBondHighlights(std::vector< std::unique_ptr< DrawShape > > &bondHighlights)
void fixHighlightJoinProblems(std::vector< std::unique_ptr< DrawShape > > &atomHighlights, std::vector< std::unique_ptr< DrawShape > > &bondHighlights)
DrawMolMCHCircleAndLine & operator=(DrawMol &&)=delete
DrawMolMCHCircleAndLine & operator=(const DrawMol &)=delete
void extractHighlights(double scale) override
Std stuff.
bool rdvalue_is(const RDValue_cast_t)