Open Babel: OBPainter Class Reference

Public Member Functions

# OBPainter Class Reference

Abstract painter base class used by OBDepict. More...

`#include <openbabel/depict/painter.h>`

List of all members.

## Public Member Functions
virtual | ~OBPainter ()
virtual void | NewCanvas (double width, double height)=0
virtual bool | IsGood () const =0
virtual void | SetFontFamily (const std::string &fontFamily)=0
virtual void | SetFontSize (int pointSize)=0
virtual void | SetFillColor (const OBColor &color)=0
virtual void | SetPenColor (const OBColor &color)=0
virtual void | SetPenWidth (double width)=0
virtual void | DrawLine (double x1, double y1, double x2, double y2)=0
virtual void | DrawCircle (double x, double y, double r)=0
virtual void | DrawPolygon (const std::vector< std::pair< double, double > > &points)=0
virtual void | DrawText (double x, double y, const std::string &text)=0
virtual OBFontMetrics | GetFontMetrics (const std::string &text)=0

## Detailed Description

Abstract painter base class used by OBDepict.

Since:
  version 2.3

## Constructor & Destructor Documentation

virtual ~OBPainter | ( | ) | `[inline, virtual]`

Virtual destructor to be inhereted by subclasses

## Member Function Documentation

virtual void NewCanvas | ( | double | width,
|  | double | height
| ) |  | `[pure virtual]`

Create a new canvas to paint on with size `width` x `height`. OBDepict will always call NewCanvas before performing any drawing operations. Painters that are capable of drawing on a previously unspecified area don't need to implement this.

virtual bool IsGood | ( | ) | const`[pure virtual]`

Before OBDepict performes any drawing operation, this method is called to check if the painter is ready to start drawing. If this method returns false, drawing is aborted.

virtual void SetFontFamily | ( | const std::string & | fontFamily ) | `[pure virtual]`

Set the painter's font family.

virtual void SetFontSize | ( | int | pointSize ) | `[pure virtual]`

Set the painter's font point size.

virtual void SetFillColor | ( | const OBColor & | color ) | `[pure virtual]`

Set the painter's fill color.

virtual void SetPenColor | ( | const OBColor & | color ) | `[pure virtual]`

Set the painter's pen color.

virtual void SetPenWidth | ( | double | width ) | `[pure virtual]`

Set the painter's pen width.

virtual void DrawLine | ( | double | x1,
|  | double | y1,
|  | double | x2,
|  | double | y2
| ) |  | `[pure virtual]`

Draw a line from `x1`, `y1` to `x2`, `y2`. The line is drawn using the current pen color and width.

virtual void DrawCircle | ( | double | x,
|  | double | y,
|  | double | r
| ) |  | `[pure virtual]`

virtual void DrawPolygon | ( | const std::vector< std::pair< double, double > > & | points ) | `[pure virtual]`

Draw a polygon by connecting consecutive points. The last point will be connected to the first one. The lines are drawn using the current pen color and width. The area inside the polygon is filled with the current fill color.

virtual void DrawText | ( | double | x,
|  | double | y,
|  | const std::string & | text
| ) |  | `[pure virtual]`

virtual OBFontMetrics GetFontMetrics | ( | const std::string & | text ) | `[pure virtual]`

The documentation for this class was generated from the following file:

- painter.h

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines