57 out_ <<
"#FIG 3.2 Produced by the Bio++ Graphic Device System" << endl;
58 out_ <<
"Portrait" << endl;
59 out_ <<
"Flush left" << endl;
60 out_ <<
"Metric" << endl;
62 out_ <<
"100" << endl;
63 out_ <<
"Single" << endl;
66 out_ <<
"72 2" << endl;
69 out_ <<
"#Color definitions:" << endl;
70 vector<unsigned int> codes = colorManager_.getCodes();
71 vector<RGBColor> colors = colorManager_.getColors();
72 for(
unsigned int i = 32; i < colorManager_.getNumberOfColors(); i++)
74 string hexCode = colors[i].toHex();
75 out_ <<
"0 " << codes[i] <<
" " << hexCode << endl;
79 out_ <<
"#Drawing content:" << endl;
80 for(
unsigned int i = 0; i < content_.size(); i++)
82 out_ << content_[i] << endl;
88 fgColorCode_ = colorManager_.getCode(color);
94 bgColorCode_ = colorManager_.getCode(color);
100 if (fontFlag_ == FONTFLAG_LATEX)
101 fontCode_ = latexFontManager_.getCode(font);
102 else if (fontFlag_ == FONTFLAG_POSTSCRIPT)
103 fontCode_ = postscriptFontManager_.getCode(font);
113 oss <<
"2 1 " << lineTypeCode_ <<
" " << getCurrentPointSize()
114 <<
" " << fgColorCode_
115 <<
" " << bgColorCode_
116 <<
" " << getCurrentLayer()
117 <<
" " <<
"-1 -1 -1 0 0 0 0 0 2" << endl;
118 oss << round(x_(x1)) <<
" " << round(y_(y1)) << endl;
119 oss << round(x_(x2)) <<
" " << round(y_(y2));
120 content_.push_back(oss.str());
126 oss <<
"2 2 0 " << getCurrentPointSize()
127 <<
" " << fgColorCode_
128 <<
" " << bgColorCode_
129 <<
" " << getCurrentLayer()
131 <<
" " << getFillCode(fill) <<
" -1 0 0 0 0 0 5" << endl;
132 oss << round(x) <<
" " << round(y) << endl;
133 oss << round(x_(x + width)) <<
" " << round(y_(y)) << endl;
134 oss << round(x_(x + width)) <<
" " << round(y_(y + height)) << endl;
135 oss << round(x_(x)) <<
" " << round(y_(y + height)) << endl;
136 oss << round(x_(x)) <<
" " << round(y_(y));
137 content_.push_back(oss.str());
143 oss <<
"1 3 0 " << getCurrentPointSize()
144 <<
" " << fgColorCode_
145 <<
" " << bgColorCode_
146 <<
" " << getCurrentLayer()
148 <<
" " << getFillCode(fill) <<
" -1 1 0 " 149 << round(x_(x)) <<
" " << round(y_(y)) <<
" " 150 << round(x_(radius)) <<
" " << round(y_(radius)) <<
" " 151 << round(x_(x + radius)) <<
" " << round(y_(y)) <<
" " 152 << round(x_(x + radius)) <<
" " << round(y_(y)) << endl;
153 content_.push_back(oss.str());
158 int xrel =
static_cast<int>(round(x_(x)));
160 if (hpos == TEXT_HORIZONTAL_LEFT)
162 else if (hpos == TEXT_HORIZONTAL_CENTER)
164 else if (hpos == TEXT_HORIZONTAL_RIGHT)
169 if (vpos == TEXT_VERTICAL_BOTTOM)
170 yrel =
static_cast<int>(round(y_(y - 1.)));
171 else if (vpos == TEXT_VERTICAL_CENTER)
172 yrel =
static_cast<int>(round(y + fontSize_ / 2 - 1));
173 else if (vpos == TEXT_VERTICAL_TOP)
174 yrel =
static_cast<int>(round(y - fontSize_));
178 oss <<
"4 " << sub <<
" " << fgColorCode_ <<
" " << 50 <<
" " << -1 <<
" " << fontCode_ <<
" " << fontSize_ <<
" " 179 << angle <<
" " << fontFlag_ <<
" " << -1 <<
" " << -1 <<
" " << xrel <<
" " << yrel <<
" " << text <<
"\\001";
180 content_.push_back(oss.str());
185 if (fill == FILL_EMPTY)
return -1;
186 if (fill == FILL_FILLED)
return 20;
187 if (fill == FILL_PATTERN)
void end()
End the painting.
Data structure for fonts.
This class allows to perform a correspondence analysis.
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
static std::string toString(T t)
General template method to convert to a string.
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.
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.