14 #ifndef RDKIT_MOLDRAW2DHELPERS_H
15 #define RDKIT_MOLDRAW2DHELPERS_H
23 namespace 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;
170 int legendFontSize = 16;
172 double legendFraction =
174 int maxFontSize = 40;
180 double annotationFontScale = 0.5;
182 std::string fontFile =
"";
188 double multipleBondOffset = 0.15;
193 double additionalAtomLabelPadding = 0.0;
203 double bondLineWidth = 2.0;
204 bool scaleBondWidth =
false;
205 bool scaleHighlightBondWidth =
true;
206 int highlightBondWidthMultiplier = 8;
208 bool prepareMolsBeforeDrawing =
true;
221 double fixedBondLength =
233 bool isotopeLabels =
true;
234 bool dummyIsotopeLabels =
true;
237 bool atomHighlightsAreCircles =
false;
240 bool centreMoleculesBeforeDrawing =
false;
242 bool explicitMethyl =
false;
243 bool includeRadicals =
246 bool includeMetadata =
249 bool comicMode =
false;
252 int variableBondWidthMultiplier = 16;
254 double variableAtomRadius = 0.4;
258 bool includeChiralFlagLabel =
260 bool simplifiedStereoGroupLabel =
264 bool unspecifiedStereoIsUnknown =
false;
269 bool singleColourWedgeBonds =
273 bool useMolBlockWedging =
false;
276 double scalingFactor = 20.0;
278 double baseFontSize =
282 bool drawMolsSameScale =
true;
287 highlightColourPalette.emplace_back(
289 highlightColourPalette.emplace_back(
DrawColour(1., .8, .6));
290 highlightColourPalette.emplace_back(
292 highlightColourPalette.emplace_back(
294 highlightColourPalette.emplace_back(
DrawColour(.87, .63, .87));
295 highlightColourPalette.emplace_back(
297 highlightColourPalette.emplace_back(
299 highlightColourPalette.emplace_back(
DrawColour(.64, .76, .34));
300 highlightColourPalette.emplace_back(
302 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