22 #include <openbabel/babelconfig.h> 44 OBColor(
double _red,
double _green,
double _blue,
double _alpha = 1.0) :
52 std::stringstream ss(color.substr(1));
55 *
this =
OBColor((c/0x10000)/256.0, ((c%0x10000)/0x100/256.0), (c%0x100)/256.0);
60 else if (color ==
"white")
62 else if (color ==
"red")
64 else if (color ==
"green")
66 else if (color ==
"blue")
68 else if (color ==
"yellow")
70 else if (color ==
"gray")
72 else if (color ==
"cyan")
74 else if (color ==
"purple")
76 else if (color ==
"teal")
78 else if (color ==
"olive")
80 else if (color ==
"none")
81 *
this =
OBColor(0.0, 0.0, 0.0, 0.0);
142 virtual void NewCanvas(
double width,
double height) = 0;
148 virtual bool IsGood()
const = 0;
152 virtual void SetFontFamily(
const std::string &fontFamily) = 0;
156 virtual void SetFontSize(
int pointSize) = 0;
160 virtual void SetFillColor(
const OBColor &color) = 0;
164 virtual void SetFillRadial(
const OBColor &start,
const OBColor &end) = 0;
168 virtual void SetPenColor(
const OBColor &color) = 0;
172 virtual void SetPenWidth(
double width) = 0;
176 virtual double GetPenWidth() = 0;
181 virtual void DrawLine(
double x1,
double y1,
double x2,
double y2,
const std::vector<double> & dashes=std::vector<double>()) = 0;
182 virtual void DrawCircle(
double x,
double y,
double r) = 0;
189 virtual void DrawPolygon(
const std::vector<std::pair<double,double> > &points) = 0;
195 virtual void DrawBall(
double x,
double y,
double r,
double opacity = 1.0) = 0;
197 virtual void DrawText(
double x,
double y,
const std::string &text) = 0;
198 virtual OBFontMetrics GetFontMetrics(
const std::string &text) = 0;
Abstract painter base class used by OBDepict.
Definition: painter.h:128
double width
Definition: painter.h:120
bool operator<(const OBBitVec &bv1, const OBBitVec &bv2)
Definition: bitvec.cpp:556
double red
Definition: painter.h:108
double descent
Definition: painter.h:119
virtual ~OBPainter()
Definition: painter.h:134
static const char * blue
Definition: isomorphism.cpp:33
OBColor()
Definition: painter.h:40
static const char * green
Definition: isomorphism.cpp:31
static const char * red
Definition: isomorphism.cpp:30
Color class used by OBDepict.
Definition: painter.h:37
Font metrics class used by OBDepict.
Definition: painter.h:116
double green
Definition: painter.h:108
double blue
Definition: painter.h:108
OBColor(double _red, double _green, double _blue, double _alpha=1.0)
Definition: painter.h:44
OBColor(const std::string &color)
Definition: painter.h:48
int fontSize
Definition: painter.h:118
OBColor(std::vector< double > vec)
Definition: painter.h:86
Global namespace for all Open Babel code.
Definition: alias.h:22