16#ifndef MOLDRAW2DCAIRO_H
17#define MOLDRAW2DCAIRO_H
31 int panelHeight = -1,
bool noFreetype =
false)
32 :
MolDraw2D(width, height, panelWidth, panelHeight), dp_cr(cr) {
33 cairo_reference(dp_cr);
34 df_noFreetype = noFreetype;
35 initTextDrawer(noFreetype);
38 int panelHeight = -1,
bool noFreetype =
false)
39 :
MolDraw2D(width, height, panelWidth, panelHeight), dp_cr(nullptr) {
40 if (width > 0 && height > 0) {
44 initTextDrawer(noFreetype);
45 df_noFreetype = noFreetype;
53 if (cairo_get_reference_count(dp_cr) > 0) {
68 bool rawCoords =
false)
override;
71 bool rawCoords =
false)
override;
76 unsigned int nSegments = 16,
double vertOffset = 0.05,
77 bool rawCoords =
false)
override;
84#if defined(WIN32) && !defined(RDK_BUILD_FREETYPE_SUPPORT)
85 bool supportsAnnotations()
const override {
return false; }
89 cairo_t *dp_cr =
nullptr;
90 bool df_noFreetype =
false;
92 void updateMetadata(
const ROMol &mol,
int confId)
override;
95 void initDrawing()
override;
96 void initTextDrawer(
bool noFreetype)
override;
97 std::string addMetadataToPNG(
const std::string &png)
const;
98 void updateMetadata(
const ROMol &mol)
const;
This is a class for storing and applying general chemical reactions.
void setColour(const DrawColour &col) override
sets the current draw color
MolDraw2DCairo & operator=(MolDraw2DCairo &&)=delete
void clearDrawing() override
clears the contents of the drawing
MolDraw2DCairo(const MolDraw2DCairo &)=delete
void writeDrawingText(const std::string &fName) const
void drawPolygon(const std::vector< Point2D > &cds, bool rawCoords=false) override
void drawWavyLine(const Point2D &cds1, const Point2D &cds2, const DrawColour &col1, const DrawColour &col2, unsigned int nSegments=16, double vertOffset=0.05, bool rawCoords=false) override
draw a wavy line like that used to indicate unknown stereochemistry
MolDraw2DCairo(int width, int height, int panelWidth=-1, int panelHeight=-1, bool noFreetype=false)
MolDraw2DCairo & operator=(const MolDraw2DCairo &)=delete
std::string getDrawingText() const
MolDraw2DCairo(MolDraw2DCairo &&)=delete
void drawLine(const Point2D &cds1, const Point2D &cds2, bool rawCoords=false) override
MolDraw2DCairo(int width, int height, cairo_t *cr, int panelWidth=-1, int panelHeight=-1, bool noFreetype=false)
MolDraw2D is the base class for doing 2D renderings of molecules.
#define RDKIT_MOLDRAW2D_EXPORT