14#ifndef RDKIT_MOLDRAW2DHELPERS_H
15#define RDKIT_MOLDRAW2DHELPERS_H
23namespace MolDraw2D_detail {
30 double r = 0.0,
g = 0.0,
b = 0.0,
a = 1.0;
35 return r == other.
r &&
g == other.
g &&
b == other.
b &&
a == other.
a;
38 bool ignoreAlpha =
true)
const {
39 return fabs(
r - other.
r) <= tol && fabs(
g - other.
g) <= tol &&
40 fabs(
b - other.
b) <= tol &&
41 (ignoreAlpha || fabs(
a - other.
a) <= tol);
44 return {
r + other.
r,
g + other.
g,
b + other.
b,
a + other.
a};
47 return {
r - other.
r,
g - other.
g,
b - other.
b,
a - other.
a};
51 return {
r / v,
g / v,
b / v,
a / v};
64 palette[1] = palette[6] =
DrawColour(0.0, 0.0, 0.0);
80 palette[1] = palette[6] =
DrawColour(0.0, 0.0, 0.0);
100 palette[1] = palette[6] =
DrawColour(0.0, 0.0, 0.0);
105 palette[16] =
DrawColour(0.776, 0.776, 0.173);
106 palette[17] =
DrawColour(0.122, 0.498, 0.122);
107 palette[35] =
DrawColour(0.651, 0.161, 0.161);
116 palette[1] = palette[6] =
DrawColour(0.9, 0.9, 0.9);
133 bool atomLabelDeuteriumTritium =
135 bool dummiesAreAttachments =
false;
136 bool circleAtoms =
true;
137 bool splitBonds =
false;
141 bool continuousHighlight =
true;
143 bool fillHighlights =
true;
145 double highlightRadius = 0.3;
147 int flagCloseContactsDist = 3;
149 bool includeAtomTags =
152 bool clearBackground =
true;
156 int legendFontSize = 16;
158 double legendFraction =
160 int maxFontSize = 40;
166 double annotationFontScale = 0.5;
168 std::string fontFile =
"";
172 double multipleBondOffset = 0.15;
176 double additionalAtomLabelPadding = 0.0;
186 int bondLineWidth = 2;
187 bool scaleBondWidth =
false;
188 bool scaleHighlightBondWidth =
true;
189 int highlightBondWidthMultiplier = 8;
191 bool prepareMolsBeforeDrawing =
true;
204 double fixedBondLength =
216 bool isotopeLabels =
true;
217 bool dummyIsotopeLabels =
true;
220 bool atomHighlightsAreCircles =
false;
223 bool centreMoleculesBeforeDrawing =
false;
225 bool explicitMethyl =
false;
226 bool includeRadicals =
229 bool includeMetadata =
232 bool comicMode =
false;
235 int variableBondWidthMultiplier = 16;
237 double variableAtomRadius = 0.4;
241 bool includeChiralFlagLabel =
243 bool simplifiedStereoGroupLabel =
247 bool singleColourWedgeBonds =
251 double scalingFactor = 20.0;
253 double baseFontSize =
257 bool drawMolsSameScale =
true;
262 highlightColourPalette.emplace_back(
264 highlightColourPalette.emplace_back(
DrawColour(1., .8, .6));
265 highlightColourPalette.emplace_back(
267 highlightColourPalette.emplace_back(
269 highlightColourPalette.emplace_back(
DrawColour(.87, .63, .87));
270 highlightColourPalette.emplace_back(
272 highlightColourPalette.emplace_back(
274 highlightColourPalette.emplace_back(
DrawColour(.64, .76, .34));
275 highlightColourPalette.emplace_back(
277 highlightColourPalette.emplace_back(
DrawColour(.20, .63, .79));
#define PRECONDITION(expr, mess)
#define RDKIT_MOLDRAW2D_EXPORT
RDKIT_MOLDRAW2D_EXPORT void addBondIndices(const ROMol &mol)
add annotations with bond indices.
RDKIT_MOLDRAW2D_EXPORT void addAtomIndices(const ROMol &mol)
add annotations with atom indices.
RDKIT_MOLDRAW2D_EXPORT void addStereoAnnotation(const ROMol &mol, bool includeRelativeCIP=false)
add R/S, relative stereo, and E/Z annotations to atoms and bonds
std::vector< double > DashPattern
void assignDefaultPalette(ColourPalette &palette)
use the RDKit's default palette r
void assignAvalonPalette(ColourPalette &palette)
use the color palette from the Avalon renderer
void assignDarkModePalette(ColourPalette &palette)
std::map< int, DrawColour > ColourPalette
void assignBWPalette(ColourPalette &palette)
void assignCDKPalette(ColourPalette &palette)
use (part of) the CDK color palette
bool feq(const DrawColour &other, double tol=0.001, bool ignoreAlpha=true) const
DrawColour operator+(const DrawColour &other) const
DrawColour operator/(double v) const
DrawColour operator*(double v) const
DrawColour(double r, double g, double b, double a=1.0)
DrawColour operator-(const DrawColour &other) const
bool operator==(const DrawColour &other) const
std::vector< std::vector< int > > atomRegions
std::map< int, std::string > atomLabels
ColourPalette atomColourPalette
std::vector< DrawColour > highlightColourPalette