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;
39 bool ignoreAlpha =
true)
const {
40 return fabs(
r - other.
r) <= tol && fabs(
g - other.
g) <= tol &&
41 fabs(
b - other.
b) <= tol &&
42 (ignoreAlpha || fabs(
a - other.
a) <= tol);
45 return {
r + other.
r,
g + other.
g,
b + other.
b,
a + other.
a};
48 return {
r - other.
r,
g - other.
g,
b - other.
b,
a - other.
a};
52 return {
r / v,
g / v,
b / v,
a / v};
71 palette[1] = palette[6] =
DrawColour(0.0, 0.0, 0.0);
89 palette[1] = palette[6] =
DrawColour(0.0, 0.0, 0.0);
111 palette[1] = palette[6] =
DrawColour(0.0, 0.0, 0.0);
116 palette[16] =
DrawColour(0.776, 0.776, 0.173);
117 palette[17] =
DrawColour(0.122, 0.498, 0.122);
118 palette[35] =
DrawColour(0.651, 0.161, 0.161);
129 palette[1] = palette[6] =
DrawColour(0.9, 0.9, 0.9);
147 bool atomLabelDeuteriumTritium =
149 bool dummiesAreAttachments =
false;
150 bool circleAtoms =
true;
151 bool splitBonds =
false;
155 bool continuousHighlight =
true;
157 bool fillHighlights =
true;
159 double highlightRadius = 0.3;
161 int flagCloseContactsDist = 3;
163 bool includeAtomTags =
166 bool clearBackground =
true;
172 int legendFontSize = 16;
174 double legendFraction =
176 int maxFontSize = 40;
182 double annotationFontScale = 0.5;
184 std::string fontFile =
"";
190 double multipleBondOffset = 0.15;
195 double additionalAtomLabelPadding = 0.0;
207 double bondLineWidth = 2.0;
208 bool scaleBondWidth =
false;
209 bool scaleHighlightBondWidth =
true;
210 int highlightBondWidthMultiplier = 8;
212 bool prepareMolsBeforeDrawing =
true;
225 double fixedBondLength =
237 bool isotopeLabels =
true;
238 bool dummyIsotopeLabels =
true;
241 bool atomHighlightsAreCircles =
false;
244 bool centreMoleculesBeforeDrawing =
false;
246 bool explicitMethyl =
false;
247 bool includeRadicals =
250 bool includeMetadata =
253 bool comicMode =
false;
256 int variableBondWidthMultiplier = 16;
258 double variableAtomRadius = 0.4;
262 bool includeChiralFlagLabel =
264 bool simplifiedStereoGroupLabel =
268 bool unspecifiedStereoIsUnknown =
false;
273 bool singleColourWedgeBonds =
277 bool useMolBlockWedging =
false;
280 double scalingFactor = 20.0;
282 double baseFontSize =
286 bool drawMolsSameScale =
true;
289 bool useComplexQueryAtomSymbols =
296 highlightColourPalette.emplace_back(
298 highlightColourPalette.emplace_back(
DrawColour(1., .8, .6));
299 highlightColourPalette.emplace_back(
301 highlightColourPalette.emplace_back(
303 highlightColourPalette.emplace_back(
DrawColour(.87, .63, .87));
304 highlightColourPalette.emplace_back(
306 highlightColourPalette.emplace_back(
308 highlightColourPalette.emplace_back(
DrawColour(.64, .76, .34));
309 highlightColourPalette.emplace_back(
311 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
static const double lineWidthScaleFactor
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)
bool operator!=(const DrawColour &other) const
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