25 #ifndef RDKITMOLDRAW2D_H
26 #define RDKITMOLDRAW2D_H
46 double r = 0.0,
g = 0.0,
b = 0.0,
a = 1.0;
51 return r == other.
r &&
g == other.
g &&
b == other.
b &&
a == other.
a;
54 bool ignoreAlpha =
true)
const {
55 return fabs(
r - other.
r) <= tol && fabs(
g - other.
g) <= tol &&
56 fabs(
b - other.
b) <= tol &&
57 (ignoreAlpha || fabs(
a - other.
a) <= tol);
60 return {
r + other.
r,
g + other.
g,
b + other.
b,
a + other.
a};
63 return {
r - other.
r,
g - other.
g,
b - other.
b,
a - other.
a};
67 return {
r / v,
g / v,
b / v,
a / v};
122 double padding)
const {
123 double wb2 = padding +
width_ / 2.0;
124 double hb2 = padding +
height_ / 2.0;
146 if ((otl.
x >= ttl.
x && otl.
x <= ttr.
x && otl.
y >= tbl.
y &&
148 (otr.
x >= ttl.
x && otr.
x <= ttr.
x && otr.
y >= tbl.
y &&
150 (obr.
x >= ttl.
x && obr.
x <= ttr.
x && obr.
y >= tbl.
y &&
152 (obl.
x >= ttl.
x && obl.
x <= ttr.
x && obl.
y >= tbl.
y &&
156 if ((ttl.
x >= otl.
x && ttl.
x <= otr.
x && ttl.
y >= obl.
y &&
158 (ttr.
x >= otl.
x && ttr.
x <= otr.
x && ttr.
y >= obl.
y &&
160 (tbr.
x >= otl.
x && tbr.
x <= otr.
x && tbr.
y >= obl.
y &&
162 (tbl.
x >= otl.
x && tbl.
x <= otr.
x && tbl.
y >= obl.
y &&
184 palette[1] = palette[6] =
DrawColour(0.0, 0.0, 0.0);
201 bool atomLabelDeuteriumTritium =
203 bool dummiesAreAttachments =
false;
204 bool circleAtoms =
true;
205 bool splitBonds =
false;
209 bool continuousHighlight =
true;
211 bool fillHighlights =
true;
213 double highlightRadius = 0.3;
215 int flagCloseContactsDist = 3;
217 bool includeAtomTags =
220 bool clearBackground =
true;
224 int legendFontSize = 16;
226 int maxFontSize = 40;
229 double annotationFontScale = 0.5;
231 std::string fontFile =
"";
235 double multipleBondOffset = 0.15;
239 double additionalAtomLabelPadding = 0.0;
249 int bondLineWidth = 2;
250 bool scaleBondWidth =
false;
251 bool scaleHighlightBondWidth =
true;
252 int highlightBondWidthMultiplier = 8;
254 bool prepareMolsBeforeDrawing =
true;
267 double fixedBondLength =
279 bool isotopeLabels =
true;
280 bool dummyIsotopeLabels =
true;
283 bool atomHighlightsAreCircles =
false;
286 bool centreMoleculesBeforeDrawing =
false;
288 bool explicitMethyl =
false;
289 bool includeRadicals =
292 bool includeMetadata =
295 bool comicMode =
false;
298 int variableBondWidthMultiplier = 16;
300 double variableAtomRadius = 0.4;
304 bool includeChiralFlagLabel =
306 bool simplifiedStereoGroupLabel =
310 bool singleColourWedgeBonds =
316 highlightColourPalette.emplace_back(
318 highlightColourPalette.emplace_back(
DrawColour(1., .8, .6));
319 highlightColourPalette.emplace_back(
321 highlightColourPalette.emplace_back(
323 highlightColourPalette.emplace_back(
DrawColour(.87, .63, .87));
324 highlightColourPalette.emplace_back(
326 highlightColourPalette.emplace_back(
328 highlightColourPalette.emplace_back(
DrawColour(.64, .76, .34));
329 highlightColourPalette.emplace_back(
331 highlightColourPalette.emplace_back(
DrawColour(.20, .63, .79));
350 MolDraw2D(
int width,
int height,
int panelWidth,
int panelHeight);
356 virtual void initDrawing() = 0;
357 virtual void initTextDrawer(
bool noFreetype) = 0;
391 const ROMol &mol,
const std::string &legend,
392 const std::vector<int> *highlight_atoms,
393 const std::vector<int> *highlight_bonds,
394 const std::map<int, DrawColour> *highlight_atom_map =
nullptr,
395 const std::map<int, DrawColour> *highlight_bond_map =
nullptr,
396 const std::map<int, double> *highlight_radii =
nullptr,
int confId = -1);
400 const ROMol &mol,
const std::vector<int> *highlight_atoms =
nullptr,
401 const std::map<int, DrawColour> *highlight_map =
nullptr,
402 const std::map<int, double> *highlight_radii =
nullptr,
int confId = -1);
406 const ROMol &mol,
const std::string &legend,
407 const std::vector<int> *highlight_atoms =
nullptr,
408 const std::map<int, DrawColour> *highlight_map =
nullptr,
409 const std::map<int, double> *highlight_radii =
nullptr,
int confId = -1);
413 const ROMol &mol,
const std::vector<int> *highlight_atoms,
414 const std::vector<int> *highlight_bonds,
415 const std::map<int, DrawColour> *highlight_atom_map =
nullptr,
416 const std::map<int, DrawColour> *highlight_bond_map =
nullptr,
417 const std::map<int, double> *highlight_radii =
nullptr,
int confId = -1);
434 const ROMol &mol,
const std::string &legend,
435 const std::map<
int, std::vector<DrawColour>> &highlight_atom_map,
436 const std::map<
int, std::vector<DrawColour>> &highlight_bond_map,
437 const std::map<int, double> &highlight_radii,
438 const std::map<int, int> &highlight_linewidth_multipliers,
468 const std::vector<ROMol *> &mols,
469 const std::vector<std::string> *legends =
nullptr,
470 const std::vector<std::vector<int>> *highlight_atoms =
nullptr,
471 const std::vector<std::vector<int>> *highlight_bonds =
nullptr,
472 const std::vector<std::map<int, DrawColour>> *highlight_atom_maps =
474 const std::vector<std::map<int, DrawColour>> *highlight_bond_maps =
476 const std::vector<std::map<int, double>> *highlight_radii =
nullptr,
477 const std::vector<int> *confIds =
nullptr);
493 const std::vector<DrawColour> *highlightColorsReactants =
nullptr,
494 const std::vector<int> *confIds =
nullptr);
515 const std::pair<double, double> &screen_cds)
const;
520 virtual int width()
const {
return width_; }
522 virtual int height()
const {
return height_; }
527 virtual int drawHeight()
const {
return panel_height_ - legend_height_; }
531 double scale()
const {
return scale_; }
535 const std::vector<int> *highlight_atoms =
nullptr,
536 const std::map<int, double> *highlight_radii =
nullptr,
542 const std::vector<std::vector<int>> *highlight_atoms,
543 const std::vector<std::map<int, double>> *highlight_radii,
544 const std::vector<int> *confIds,
545 std::vector<std::unique_ptr<RWMol>> &tmols);
551 const ROMol *mol =
nullptr);
579 virtual void setLineWidth(
int width) { drawOptions().bondLineWidth = width; }
581 virtual int lineWidth()
const {
return drawOptions().bondLineWidth; }
591 double &label_height)
const;
595 double &label_width,
double &label_height)
const;
598 const Point2D &cds,
double &x_min,
double &y_min,
599 double &x_max,
double &y_max)
const;
620 double ang1,
double ang2);
627 unsigned int nSegments = 16);
631 unsigned int nSegments = 16,
632 double vertOffset = 0.05);
653 return at_cds_[activeMolIdx_];
656 const std::vector<std::pair<std::string, OrientType>> &
atomSyms()
const {
658 return atom_syms_[activeMolIdx_];
662 bool asPolygon =
false,
double frac = 0.05,
663 double angle =
M_PI / 6);
675 at_idx1 = (at_idx1 < 0 ? -1 : at_idx1);
676 at_idx2 = (at_idx2 < 0 ? -1 : at_idx2);
677 if (at_idx2 >= 0 && at_idx1 < 0) {
678 std::swap(at_idx1, at_idx2);
680 activeAtmIdx1_ = at_idx1;
681 activeAtmIdx2_ = at_idx2;
689 int width_, height_, panel_width_, panel_height_, legend_height_;
691 double x_min_, y_min_, x_range_, y_range_;
692 double x_trans_, y_trans_;
693 int x_offset_, y_offset_;
703 std::vector<std::vector<Point2D>> at_cds_;
704 std::vector<std::vector<int>> atomic_nums_;
705 std::vector<std::vector<std::pair<std::string, OrientType>>> atom_syms_;
711 std::vector<std::vector<AnnotationType>> annotations_;
712 std::vector<std::vector<std::pair<std::shared_ptr<StringRect>,
OrientType>>>
715 std::vector<std::vector<MolDrawShape>> pre_shapes_;
716 std::vector<std::vector<MolDrawShape>> post_shapes_;
721 int atom_idx,
const std::vector<int> *highlight_atoms =
nullptr,
722 const std::map<int, DrawColour> *highlight_map =
nullptr);
723 DrawColour getColourByAtomicNum(
int atomic_num);
726 std::unique_ptr<RWMol> setupDrawMolecule(
727 const ROMol &mol,
const std::vector<int> *highlight_atoms,
728 const std::map<int, double> *highlight_radii,
int confId,
int width,
732 void pushDrawDetails();
733 void popDrawDetails();
736 std::unique_ptr<RWMol> setupMoleculeDraw(
737 const ROMol &mol,
const std::vector<int> *highlight_atoms,
738 const std::map<int, double> *highlight_radii,
int confId = -1);
739 void setupTextDrawer();
744 void drawBonds(
const ROMol &draw_mol,
745 const std::vector<int> *highlight_atoms =
nullptr,
746 const std::map<int, DrawColour> *highlight_atom_map =
nullptr,
747 const std::vector<int> *highlight_bonds =
nullptr,
748 const std::map<int, DrawColour> *highlight_bond_map =
nullptr,
749 const std::vector<std::pair<DrawColour, DrawColour>>
750 *bond_colours =
nullptr);
752 void finishMoleculeDraw(
const ROMol &draw_mol,
753 const std::vector<DrawColour> &atom_colours);
754 void drawLegend(
const std::string &legend);
756 void drawHighlightedAtom(
int atom_idx,
const std::vector<DrawColour> &colours,
757 const std::map<int, double> *highlight_radii);
763 const Point2D &label_coords)
const;
766 void calcLabelEllipse(
int atom_idx,
767 const std::map<int, double> *highlight_radii,
768 Point2D ¢re,
double &xradius,
769 double &yradius)
const;
772 const std::string ¬e);
774 const std::string ¬e);
775 StringRect calcAnnotationPosition(
const ROMol &mol,
const std::string ¬e);
778 void calcAtomAnnotationPosition(
const ROMol &mol,
const Atom *atom,
780 const std::string ¬e);
783 void drawHighlightedBonds(
785 const std::map<
int, std::vector<DrawColour>> &highlight_bond_map,
786 const std::map<int, int> &highlight_linewidth_multipliers,
787 const std::map<int, double> *highlight_radii);
788 int getHighlightBondWidth(
790 const std::map<int, int> *highlight_linewidth_multipliers)
const;
793 void adjustLineEndForHighlight(
int at_idx,
794 const std::map<int, double> *highlight_radii,
797 void extractAtomCoords(
const ROMol &mol,
int confId,
bool updateBBox);
798 void extractAtomSymbols(
const ROMol &mol);
799 void extractMolNotes(
const ROMol &mol);
800 void extractAtomNotes(
const ROMol &mol);
801 void extractBondNotes(
const ROMol &mol);
802 void extractRadicals(
const ROMol &mol);
803 void extractSGroupData(
const ROMol &mol);
804 void extractVariableBonds(
const ROMol &mol);
805 void extractBrackets(
const ROMol &mol);
806 void extractLinkNodes(
const ROMol &mol);
808 void drawAtomLabel(
int atom_num,
809 const std::vector<int> *highlight_atoms =
nullptr,
810 const std::map<int, DrawColour> *highlight_map =
nullptr);
813 void drawRadicals(
const ROMol &mol);
817 double getNoteStartAngle(
const ROMol &mol,
const Atom *atom)
const;
822 const std::vector<std::shared_ptr<StringRect>> &rects,
823 const ROMol &mol,
unsigned int atom_idx);
825 const std::vector<std::shared_ptr<StringRect>> &rects,
829 bool doesNoteClashNbourBonds(
831 const std::vector<std::shared_ptr<StringRect>> &rects,
const ROMol &mol,
832 const Atom *atom)
const;
834 bool doesNoteClashAtomLabels(
836 const std::vector<std::shared_ptr<StringRect>> &rects,
const ROMol &mol,
837 unsigned int atom_idx)
const;
838 bool doesNoteClashOtherNotes(
840 const std::vector<std::shared_ptr<StringRect>> &rects)
const;
845 void adjustBondEndForLabel(
const std::pair<std::string, OrientType> &lbl,
849 std::pair<std::string, OrientType> getAtomSymbolAndOrientation(
850 const Atom &atom)
const;
851 std::string getAtomSymbol(
const Atom &atom,
OrientType orientation)
const;
855 void adjustScaleForAtomLabels(
const std::vector<int> *highlight_atoms,
856 const std::map<int, double> *highlight_radii);
857 void adjustScaleForRadicals(
const ROMol &mol);
858 void adjustScaleForAnnotation(
const std::vector<AnnotationType> ¬es);
861 virtual void updateMetadata(
const ROMol &mol,
int confId) {
871 unsigned int d_numMetadataEntries = 0;
874 const ROMol &mol,
const std::vector<int> *highlight_atoms,
875 const std::vector<int> *highlight_bonds,
876 const std::map<int, DrawColour> *highlight_atom_map,
877 const std::map<int, DrawColour> *highlight_bond_map,
878 const std::map<int, double> *highlight_radii);
885 const ROMol &mol,
const Bond *bond,
int at1_idx,
int at2_idx,
886 const std::vector<int> *highlight_atoms =
nullptr,
887 const std::map<int, DrawColour> *highlight_atom_map =
nullptr,
888 const std::vector<int> *highlight_bonds =
nullptr,
889 const std::map<int, DrawColour> *highlight_bond_map =
nullptr,
890 const std::vector<std::pair<DrawColour, DrawColour>> *bond_colours =
898 annot.
rect_ = note_rect;
899 drawAnnotation(annot);
907 Point2D &arrowEnd, std::vector<double> &plusLocs,
908 double spacing,
const std::vector<int> *confIds);
911 double &minY,
int confId,
bool shiftAgents,
927 double padding = 0.0);
#define RDUNUSED_PARAM(x)
#define PRECONDITION(expr, mess)
pulls in the core RDKit functionality
The class for representing atoms.
class for representing a bond
This is a class for storing and applying general chemical reactions.
MolDraw2D is the base class for doing 2D renderings of molecules.
virtual void tagAtoms(const ROMol &mol)
void calculateScale(int width, int height, const std::vector< ROMol * > &mols, const std::vector< std::vector< int >> *highlight_atoms, const std::vector< std::map< int, double >> *highlight_radii, const std::vector< int > *confIds, std::vector< std::unique_ptr< RWMol >> &tmols)
void getStringExtremes(const std::string &label, OrientType orient, const Point2D &cds, double &x_min, double &y_min, double &x_max, double &y_max) const
virtual void drawBond(const ROMol &mol, const Bond *bond, int at1_idx, int at2_idx, const std::vector< int > *highlight_atoms=nullptr, const std::map< int, DrawColour > *highlight_atom_map=nullptr, const std::vector< int > *highlight_bonds=nullptr, const std::map< int, DrawColour > *highlight_bond_map=nullptr, const std::vector< std::pair< DrawColour, DrawColour >> *bond_colours=nullptr)
virtual void drawMoleculeWithHighlights(const ROMol &mol, const std::string &legend, 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)
draw molecule with multiple colours allowed per atom.
void setScale(int width, int height, const Point2D &minv, const Point2D &maxv, const ROMol *mol=nullptr)
explicitly sets the scaling factors for the drawing
void centrePicture(int width, int height)
virtual void drawAnnotation(const std::string ¬e, const StringRect ¬e_rect)
DEPRECATED.
virtual int panelWidth() const
return the width of the drawing panels.
virtual void drawTriangle(const Point2D &cds1, const Point2D &cds2, const Point2D &cds3)
draw a triangle
virtual void drawMolecule(const ROMol &mol, const std::string &legend, const std::vector< int > *highlight_atoms, const std::vector< int > *highlight_bonds, const std::map< int, DrawColour > *highlight_atom_map=nullptr, const std::map< int, DrawColour > *highlight_bond_map=nullptr, const std::map< int, double > *highlight_radii=nullptr, int confId=-1)
draw a single molecule
virtual double getDrawLineWidth() const
virtual void setFontSize(double new_size)
std::unique_ptr< DrawText > text_drawer_
virtual void drawString(const std::string &str, const Point2D &cds, TextAlignType align)
virtual Point2D getAtomCoords(int at_num) const
returns the molecular coordinates of a particular atom
virtual void getStringSize(const std::string &label, double &label_width, double &label_height) const
virtual void drawMolecule(const ROMol &mol, const std::vector< int > *highlight_atoms, const std::vector< int > *highlight_bonds, const std::map< int, DrawColour > *highlight_atom_map=nullptr, const std::map< int, DrawColour > *highlight_bond_map=nullptr, const std::map< int, double > *highlight_radii=nullptr, int confId=-1)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void getLabelSize(const std::string &label, OrientType orient, double &label_width, double &label_height) const
virtual void highlightCloseContacts()
virtual int drawHeight() const
virtual void drawLine(const Point2D &cds1, const Point2D &cds2)=0
virtual void drawArc(const Point2D ¢re, double xradius, double yradius, double ang1, double ang2)
virtual void drawReaction(const ChemicalReaction &rxn, bool highlightByReactant=false, const std::vector< DrawColour > *highlightColorsReactants=nullptr, const std::vector< int > *confIds=nullptr)
draw a ChemicalReaction
MolDraw2D(int width, int height, int panelWidth, int panelHeight)
constructor for a particular size
virtual void drawMolecule(const ROMol &mol, const std::vector< int > *highlight_atoms=nullptr, const std::map< int, DrawColour > *highlight_map=nullptr, const std::map< int, double > *highlight_radii=nullptr, int confId=-1)
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual bool fillPolys() const
set whether or not polygons are being filled
virtual void drawArc(const Point2D ¢re, double radius, double ang1, double ang2)
virtual void drawEllipse(const Point2D &cds1, const Point2D &cds2)
draw an ellipse
virtual void drawMolecules(const std::vector< ROMol * > &mols, const std::vector< std::string > *legends=nullptr, const std::vector< std::vector< int >> *highlight_atoms=nullptr, const std::vector< std::vector< int >> *highlight_bonds=nullptr, const std::vector< std::map< int, DrawColour >> *highlight_atom_maps=nullptr, const std::vector< std::map< int, DrawColour >> *highlight_bond_maps=nullptr, const std::vector< std::map< int, double >> *highlight_radii=nullptr, const std::vector< int > *confIds=nullptr)
draw multiple molecules in a grid
virtual void drawAnnotation(const AnnotationType &annotation)
virtual void drawMolecule(const ROMol &mol, const std::string &legend, const std::vector< int > *highlight_atoms=nullptr, const std::map< int, DrawColour > *highlight_map=nullptr, const std::map< int, double > *highlight_radii=nullptr, int confId=-1)
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual void drawLine(const Point2D &cds1, const Point2D &cds2, const DrawColour &col1, const DrawColour &col2)
draw a line where the ends are different colours
virtual void clearDrawing()=0
clears the contents of the drawing
virtual int height() const
return the height of the drawing area.
virtual void setDash(const DashPattern &patt)
sets the current dash pattern
virtual DrawColour colour() const
returns the current draw color
virtual void doContinuousHighlighting(const ROMol &mol, const std::vector< int > *highlight_atoms, const std::vector< int > *highlight_bonds, const std::map< int, DrawColour > *highlight_atom_map, const std::map< int, DrawColour > *highlight_bond_map, const std::map< int, double > *highlight_radii)
virtual void setColour(const DrawColour &col)
sets the current draw color
virtual void drawAtomLabel(int atom_num, const DrawColour &draw_colour)
Point2D range() const
returns the width and height of the grid (in molecular coords)
MolDrawOptions & drawOptions()
returns our current drawing options
virtual Point2D getDrawCoords(const Point2D &mol_cds) const
virtual Point2D getDrawCoords(int at_num) const
returns the drawing coordinates of a particular atom
virtual Point2D getAtomCoords(const std::pair< int, int > &screen_cds) const
virtual bool supportsAnnotations()
void setOffset(int x, int y)
sets the drawing offset (in drawing coords)
virtual Point2D getAtomCoords(const std::pair< double, double > &screen_cds) const
virtual void drawArrow(const Point2D &cds1, const Point2D &cds2, bool asPolygon=false, double frac=0.05, double angle=M_PI/6)
Draw an arrow with either lines or a filled head (when asPolygon is true)
virtual int width() const
return the width of the drawing area.
virtual void setFillPolys(bool val)
returns either or not polygons should be filled
void get2DCoordsMol(RWMol &mol, double &offset, double spacing, double &maxY, double &minY, int confId, bool shiftAgents, double coordScale)
virtual void drawRect(const Point2D &cds1, const Point2D &cds2)
draw a rectangle
virtual int panelHeight() const
return the height of the drawing panels.
const std::vector< std::pair< std::string, OrientType > > & atomSyms() const
returns the atomic symbols of the current molecule
Point2D minPt() const
returns the minimum point of the drawing (in molecular coords)
virtual void drawWavyLine(const Point2D &cds1, const Point2D &cds2, const DrawColour &col1, const DrawColour &col2, unsigned int nSegments=16, double vertOffset=0.05)
draw a wavy line like that used to indicate unknown stereochemistry
virtual void setLineWidth(int width)
sets the current line width
void setActiveAtmIdx(int at_idx1=-1, int at_idx2=-1)
Point2D offset() const
returns the drawing offset (in drawing coords)
std::vector< std::pair< std::string, std::string > > d_metadata
virtual const DashPattern & dash() const
returns the current dash pattern
virtual double fontSize() const
font size in drawing coordinate units. That's probably pixels.
void get2DCoordsForReaction(ChemicalReaction &rxn, Point2D &arrowBegin, Point2D &arrowEnd, std::vector< double > &plusLocs, double spacing, const std::vector< int > *confIds)
virtual void drawAttachmentLine(const Point2D &cds1, const Point2D &cds2, const DrawColour &col, double len=1.0, unsigned int nSegments=16)
void calculateScale(int width, int height, const ROMol &mol, const std::vector< int > *highlight_atoms=nullptr, const std::map< int, double > *highlight_radii=nullptr, int confId=-1)
const std::vector< Point2D > & atomCoords() const
virtual int lineWidth() const
returns the current line width
const MolDrawOptions & drawOptions() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual void drawString(const std::string &str, const Point2D &cds)
drawString centres the string on cds.
virtual void drawPolygon(const std::vector< Point2D > &cds)=0
RWMol is a molecule class that is intended to be edited.
#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
RDKIT_MOLDRAW2D_EXPORT bool doesLineIntersectLabel(const Point2D &ls, const Point2D &lf, const StringRect &lab_rect, double padding=0.0)
std::vector< double > DashPattern
void assignDefaultPalette(ColourPalette &palette)
RDKIT_MOLDRAW2D_EXPORT bool doLinesIntersect(const Point2D &l1s, const Point2D &l1f, const Point2D &l2s, const Point2D &l2f, Point2D *ip=nullptr)
std::map< int, DrawColour > ColourPalette
void assignBWPalette(ColourPalette &palette)
MolDrawShapeType
for annotating the type of the extra shapes
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
extra shape to add to canvas
MolDrawShapeType shapeType
std::vector< Point2D > points
StringRect(const Point2D &offset, const Point2D &g_centre, double w, double h)
void calcCorners(Point2D &tl, Point2D &tr, Point2D &br, Point2D &bl, double padding) const
bool doesItIntersect(const StringRect &other) const