15 #ifndef MOLDRAW2DCAIRO_H 16 #define MOLDRAW2DCAIRO_H 31 cairo_reference(dp_cr);
37 cairo_surface_t *surf =
38 cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height);
39 dp_cr = cairo_create(surf);
40 cairo_surface_destroy(surf);
45 if (cairo_get_reference_count(dp_cr) > 0) {
71 unsigned int nSegments = 16,
double vertOffset = 0.05);
75 void getStringSize(
const std::string &label,
double &label_width,
76 double &label_height)
const;
89 #endif // MOLDRAW2DCAIRO_H 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
void drawChar(char c, const Point2D &cds)
virtual int height() const
return the height of the drawing area.
virtual int panelWidth() const
return the width of the drawing panels.
void clearDrawing()
clears the contes of the drawingd]
MolDraw2DCairo(int width, int height, int panelWidth=-1, int panelHeight=-1)
void setFontSize(double new_size)
MolDraw2DCairo(int width, int height, cairo_t *cr, int panelWidth=-1, int panelHeight=-1)
virtual int panelHeight() const
return the height of the drawing panels.
void drawPolygon(const std::vector< Point2D > &cds)
draw a polygon
void setColour(const DrawColour &col)
sets the current draw color
MolDraw2D is the base class for doing 2D renderings of molecules.
virtual int width() const
return the width of the drawing area.
std::string getDrawingText() const
void drawLine(const Point2D &cds1, const Point2D &cds2)
draws a line from cds1 to cds2 using the current drawing style
void getStringSize(const std::string &label, double &label_width, double &label_height) const
void writeDrawingText(const std::string &fName) const
boost::tuple< float, float, float > DrawColour