22 out_ <<
"#FIG 3.2 Produced by the Bio++ Graphic Device System" << endl;
23 out_ <<
"Portrait" << endl;
24 out_ <<
"Flush left" << endl;
25 out_ <<
"Metric" << endl;
27 out_ <<
"100" << endl;
28 out_ <<
"Single" << endl;
31 out_ <<
"72 2" << endl;
34 out_ <<
"#Color definitions:" << endl;
35 vector<unsigned int> codes = colorManager_.getCodes();
36 vector<RGBColor> colors = colorManager_.getColors();
37 for (
unsigned int i = 32; i < colorManager_.getNumberOfColors(); i++)
39 string hexCode = colors[i].toHex();
40 out_ <<
"0 " << codes[i] <<
" " << hexCode << endl;
44 out_ <<
"#Drawing content:" << endl;
45 for (
unsigned int i = 0; i < content_.size(); i++)
47 out_ << content_[i] << endl;
53 fgColorCode_ = colorManager_.getCode(color);
59 bgColorCode_ = colorManager_.getCode(color);
65 if (fontFlag_ == FONTFLAG_LATEX)
66 fontCode_ = latexFontManager_.getCode(font);
67 else if (fontFlag_ == FONTFLAG_POSTSCRIPT)
68 fontCode_ = postscriptFontManager_.getCode(font);
78 oss <<
"2 1 " << lineTypeCode_ <<
" " << getCurrentPointSize()
79 <<
" " << fgColorCode_
80 <<
" " << bgColorCode_
81 <<
" " << getCurrentLayer()
82 <<
" " <<
"-1 -1 -1 0 0 0 0 0 2" << endl;
83 oss << round(x_(x1)) <<
" " << round(y_(y1)) << endl;
84 oss << round(x_(x2)) <<
" " << round(y_(y2));
85 content_.push_back(oss.str());
91 oss <<
"2 2 0 " << getCurrentPointSize()
92 <<
" " << fgColorCode_
93 <<
" " << bgColorCode_
94 <<
" " << getCurrentLayer()
96 <<
" " << getFillCode(fill) <<
" -1 0 0 0 0 0 5" << endl;
97 oss << round(x) <<
" " << round(y) << endl;
98 oss << round(x_(x + width)) <<
" " << round(y_(y)) << endl;
99 oss << round(x_(x + width)) <<
" " << round(y_(y + height)) << endl;
100 oss << round(x_(x)) <<
" " << round(y_(y + height)) << endl;
101 oss << round(x_(x)) <<
" " << round(y_(y));
102 content_.push_back(oss.str());
108 oss <<
"1 3 0 " << getCurrentPointSize()
109 <<
" " << fgColorCode_
110 <<
" " << bgColorCode_
111 <<
" " << getCurrentLayer()
113 <<
" " << getFillCode(fill) <<
" -1 1 0 " 114 << round(x_(x)) <<
" " << round(y_(y)) <<
" " 115 << round(x_(radius)) <<
" " << round(y_(radius)) <<
" " 116 << round(x_(x + radius)) <<
" " << round(y_(y)) <<
" " 117 << round(x_(x + radius)) <<
" " << round(y_(y)) << endl;
118 content_.push_back(oss.str());
123 int xrel =
static_cast<int>(round(x_(x)));
125 if (hpos == TEXT_HORIZONTAL_LEFT)
127 else if (hpos == TEXT_HORIZONTAL_CENTER)
129 else if (hpos == TEXT_HORIZONTAL_RIGHT)
135 if (vpos == TEXT_VERTICAL_BOTTOM)
136 yrel =
static_cast<int>(round(y_(y - 1.)));
137 else if (vpos == TEXT_VERTICAL_CENTER)
138 yrel =
static_cast<int>(round(y + fontSize_ / 2 - 1));
139 else if (vpos == TEXT_VERTICAL_TOP)
140 yrel =
static_cast<int>(round(y - fontSize_));
145 oss <<
"4 " << sub <<
" " << fgColorCode_ <<
" " << 50 <<
" " << -1 <<
" " << fontCode_ <<
" " << fontSize_ <<
" " 146 << angle <<
" " << fontFlag_ <<
" " << -1 <<
" " << -1 <<
" " << xrel <<
" " << yrel <<
" " << text <<
"\\001";
147 content_.push_back(oss.str());
152 if (fill == FILL_EMPTY)
154 if (fill == FILL_FILLED)
156 if (fill == FILL_PATTERN)
void end()
End the painting.
Data structure for fonts.
void setCurrentBackgroundColor(const RGBColor &color)
void setCurrentForegroundColor(const RGBColor &color)
Describe a color according to its red, green and blue componants.
static const unsigned int FONTFLAG_LATEX
void drawCircle(double x, double y, double radius, short fill=FILL_EMPTY)
Draw a circle.
static const unsigned int FONTFLAG_POSTSCRIPT
int getFillCode(short fill)
void drawLine(double x1, double y1, double x2, double y2)
Draw a line between two points.
void setCurrentForegroundColor(const RGBColor &color)
void setCurrentFont(const Font &font)
const unsigned int & getSize() const
void begin()
Start the painting.
void drawText(double x, double y, const std::string &text, short hpos=TEXT_HORIZONTAL_LEFT, short vpos=TEXT_VERTICAL_BOTTOM, double angle=0)
Draw some characters.
std::string toString(T t)
General template method to convert to a string.
void setCurrentBackgroundColor(const RGBColor &color)
void setCurrentFont(const Font &font)
void drawRect(double x, double y, double width, double height, short fill=FILL_EMPTY)
Draw a rectangle.