59 out_ <<
"#FIG 3.2 Produced by the Bio++ Graphic Device System" << endl;
60 out_ <<
"Portrait" << endl;
61 out_ <<
"Flush left" << endl;
62 out_ <<
"Metric" << endl;
64 out_ <<
"100" << endl;
65 out_ <<
"Single" << endl;
68 out_ <<
"72 2" << endl;
71 out_ <<
"#Color definitions:" << endl;
72 vector<unsigned int> codes = colorManager_.getCodes();
73 vector<RGBColor> colors = colorManager_.getColors();
74 for (
unsigned int i = 32; i < colorManager_.getNumberOfColors(); i++)
76 string hexCode = colors[i].toHex();
77 out_ <<
"0 " << codes[i] <<
" " << hexCode << endl;
81 out_ <<
"#Drawing content:" << endl;
82 for (
unsigned int i = 0; i < content_.size(); i++)
84 out_ << content_[i] << endl;
90 fgColorCode_ = colorManager_.getCode(color);
96 bgColorCode_ = colorManager_.getCode(color);
102 if (fontFlag_ == FONTFLAG_LATEX)
103 fontCode_ = latexFontManager_.getCode(font);
104 else if (fontFlag_ == FONTFLAG_POSTSCRIPT)
105 fontCode_ = postscriptFontManager_.getCode(font);
115 oss <<
"2 1 " << lineTypeCode_ <<
" " << getCurrentPointSize()
116 <<
" " << fgColorCode_
117 <<
" " << bgColorCode_
118 <<
" " << getCurrentLayer()
119 <<
" " <<
"-1 -1 -1 0 0 0 0 0 2" << endl;
120 oss << round(x_(x1)) <<
" " << round(y_(y1)) << endl;
121 oss << round(x_(x2)) <<
" " << round(y_(y2));
122 content_.push_back(oss.str());
128 oss <<
"2 2 0 " << getCurrentPointSize()
129 <<
" " << fgColorCode_
130 <<
" " << bgColorCode_
131 <<
" " << getCurrentLayer()
133 <<
" " << getFillCode(fill) <<
" -1 0 0 0 0 0 5" << endl;
134 oss << round(x) <<
" " << round(y) << endl;
135 oss << round(x_(x + width)) <<
" " << round(y_(y)) << endl;
136 oss << round(x_(x + width)) <<
" " << round(y_(y + height)) << endl;
137 oss << round(x_(x)) <<
" " << round(y_(y + height)) << endl;
138 oss << round(x_(x)) <<
" " << round(y_(y));
139 content_.push_back(oss.str());
145 oss <<
"1 3 0 " << getCurrentPointSize()
146 <<
" " << fgColorCode_
147 <<
" " << bgColorCode_
148 <<
" " << getCurrentLayer()
150 <<
" " << getFillCode(fill) <<
" -1 1 0 "
151 << round(x_(x)) <<
" " << round(y_(y)) <<
" "
152 << round(x_(radius)) <<
" " << round(y_(radius)) <<
" "
153 << round(x_(x + radius)) <<
" " << round(y_(y)) <<
" "
154 << round(x_(x + radius)) <<
" " << round(y_(y)) << endl;
155 content_.push_back(oss.str());
160 int xrel =
static_cast<int>(round(x_(x)));
162 if (hpos == TEXT_HORIZONTAL_LEFT)
164 else if (hpos == TEXT_HORIZONTAL_CENTER)
166 else if (hpos == TEXT_HORIZONTAL_RIGHT)
172 if (vpos == TEXT_VERTICAL_BOTTOM)
173 yrel =
static_cast<int>(round(y_(y - 1.)));
174 else if (vpos == TEXT_VERTICAL_CENTER)
175 yrel =
static_cast<int>(round(y + fontSize_ / 2 - 1));
176 else if (vpos == TEXT_VERTICAL_TOP)
177 yrel =
static_cast<int>(round(y - fontSize_));
182 oss <<
"4 " << sub <<
" " << fgColorCode_ <<
" " << 50 <<
" " << -1 <<
" " << fontCode_ <<
" " << fontSize_ <<
" "
183 << angle <<
" " << fontFlag_ <<
" " << -1 <<
" " << -1 <<
" " << xrel <<
" " << yrel <<
" " << text <<
"\\001";
184 content_.push_back(oss.str());
189 if (fill == FILL_EMPTY)
191 if (fill == FILL_FILLED)
193 if (fill == FILL_PATTERN)
void setCurrentForegroundColor(const RGBColor &color)
void setCurrentBackgroundColor(const RGBColor &color)
void setCurrentFont(const Font &font)
Data structure for fonts.
const unsigned int & getSize() const
Describe a color according to its red, green and blue componants.
void drawLine(double x1, double y1, double x2, double y2)
Draw a line between two points.
static const unsigned int FONTFLAG_POSTSCRIPT
void setCurrentFont(const Font &font)
int getFillCode(short fill)
void drawRect(double x, double y, double width, double height, short fill=FILL_EMPTY)
Draw a rectangle.
void setCurrentForegroundColor(const RGBColor &color)
static const unsigned int FONTFLAG_LATEX
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 begin()
Start the painting.
void drawCircle(double x, double y, double radius, short fill=FILL_EMPTY)
Draw a circle.
void end()
End the painting.
std::string toString(T t)
General template method to convert to a string.