bpp-core3
3.0.0
|
SVG plotting format. More...
#include <Bpp/Graphics/Svg/SvgGraphicDevice.h>
Public Member Functions | |
SvgGraphicDevice (std::ostream &out, bool inkscapeEnabled=false) | |
virtual | ~SvgGraphicDevice () |
void | begin () |
Start the painting. More... | |
void | end () |
End the painting. More... | |
void | drawLine (double x1, double y1, double x2, double y2) |
Draw a line between two points. More... | |
void | drawRect (double x, double y, double width, double height, short fill=FILL_EMPTY) |
Draw a rectangle. More... | |
void | drawCircle (double x, double y, double radius, short fill=FILL_EMPTY) |
Draw a circle. More... | |
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. More... | |
void | comment (const std::string &text) |
Add a comment in the output. More... | |
void | setXUnit (double xu) |
void | setYUnit (double yu) |
double | getXUnit () const |
double | getYUnit () const |
void | setCurrentForegroundColor (const RGBColor &color) |
void | setCurrentBackgroundColor (const RGBColor &color) |
void | setCurrentFont (const Font &font) |
void | setCurrentPointSize (unsigned int size) |
void | setCurrentLineType (short type) |
void | setCurrentLayer (int layerIndex) |
const RGBColor & | getCurrentForegroundColor () const |
const RGBColor & | getCurrentBackgroundColor () const |
const Font & | getCurrentFont () const |
unsigned int | getCurrentPointSize () const |
short | getCurrentLineType () const |
int | getCurrentLayer () const |
Static Public Member Functions | |
static std::string | colorToText (const RGBColor &color) |
Static Public Attributes | |
static short | TEXT_HORIZONTAL_CENTER = 0 |
static short | TEXT_HORIZONTAL_LEFT = 1 |
static short | TEXT_HORIZONTAL_RIGHT = 2 |
static short | TEXT_VERTICAL_CENTER = 3 |
static short | TEXT_VERTICAL_BOTTOM = 4 |
static short | TEXT_VERTICAL_TOP = 5 |
static short | FILL_EMPTY = 10 |
static short | FILL_FILLED = 11 |
static short | FILL_PATTERN = 12 |
static short | LINE_SOLID = 20 |
static short | LINE_DASHED = 21 |
static short | LINE_DOTTED = 22 |
Protected Member Functions | |
double | x_ (double x) const |
double | y_ (double y) const |
double | revx_ (double x) const |
double | revy_ (double y) const |
Private Attributes | |
std::ostream & | out_ |
std::map< int, std::vector< std::string >, std::greater< int > > | layers_ |
bool | inkscapeEnabled_ |
double | minx_ |
double | maxx_ |
double | miny_ |
double | maxy_ |
std::map< short int, std::string > | fontStyles_ |
std::map< short int, std::string > | fontWeights_ |
SVG plotting format.
Definition at line 20 of file SvgGraphicDevice.h.
|
inline |
Definition at line 32 of file SvgGraphicDevice.h.
References bpp::Font::STYLE_ITALIC, bpp::Font::STYLE_NORMAL, bpp::Font::WEIGHT_BOLD, and bpp::Font::WEIGHT_NORMAL.
|
inlinevirtual |
Definition at line 45 of file SvgGraphicDevice.h.
References begin(), drawCircle(), drawLine(), drawRect(), drawText(), end(), bpp::GraphicDevice::FILL_EMPTY, bpp::GraphicDevice::TEXT_HORIZONTAL_LEFT, and bpp::GraphicDevice::TEXT_VERTICAL_BOTTOM.
|
virtual |
Start the painting.
Implements bpp::GraphicDevice.
Definition at line 10 of file SvgGraphicDevice.cpp.
Referenced by ~SvgGraphicDevice().
|
inlinestatic |
Definition at line 61 of file SvgGraphicDevice.h.
References bpp::TextTools::toString().
|
inlinevirtual |
Add a comment in the output.
comment | Comment text. |
Implements bpp::GraphicDevice.
Definition at line 55 of file SvgGraphicDevice.h.
References bpp::AbstractGraphicDevice::getCurrentLayer().
|
virtual |
Draw a circle.
This method uses the current foreground color and the current line type for drawing the stroke of the circle, and the current background color for filling the circle.
x | x coordinate of the center |
y | y coordinate of the center |
radius | The circle radius |
fill | Filling type (one of FILL_EMPTY, FILL_FILLED or FILL_PATTERN). |
Implements bpp::GraphicDevice.
Definition at line 106 of file SvgGraphicDevice.cpp.
References bpp::TextTools::toString().
Referenced by ~SvgGraphicDevice().
|
virtual |
Draw a line between two points.
This method uses the current foreground color and the current line type.
x1 | x coordinate 1 |
y1 | y coordinate 1 |
x2 | x coordinate 2 |
y2 | y coordinate 2 |
Implements bpp::GraphicDevice.
Definition at line 50 of file SvgGraphicDevice.cpp.
References bpp::TextTools::toString().
Referenced by ~SvgGraphicDevice().
|
virtual |
Draw a rectangle.
This method uses the current foreground color and the current line type for drawing the stroke of the rectangle, and the current background color for filling the rectangle.
x | x coordinate |
y | y coordinate |
width | The rectangle width |
height | The rectangle height |
fill | Filling type (one of FILL_EMPTY, FILL_FILLED or FILL_PATTERN). |
Implements bpp::GraphicDevice.
Definition at line 82 of file SvgGraphicDevice.cpp.
References bpp::TextTools::toString().
Referenced by ~SvgGraphicDevice().
|
virtual |
Draw some characters.
This method uses the current foreground color.
x | x coordinate |
y | y coordinate |
text | The characters to draw |
hpos | Horizontal adjustment, one of TEXT_HORIZONTAL_LEFT, TEXT_HORIZONTAL_CENTER or TEXT_HORIZONTAL_RIGHT. |
vpos | Vertical adjustment, one of TEXT_VERTICAL_LEFT, TEXT_VERTICAL_CENTER or TEXT_VERTICAL_RIGHT. |
angle | Angle i radian to rotate the text. |
Implements bpp::GraphicDevice.
Definition at line 121 of file SvgGraphicDevice.cpp.
References bpp::TextTools::toString().
Referenced by ~SvgGraphicDevice().
|
virtual |
End the painting.
Depending on the implementation of the device, the call of this method might be required before the plotting commands become visible.
Implements bpp::GraphicDevice.
Definition at line 16 of file SvgGraphicDevice.cpp.
Referenced by ~SvgGraphicDevice().
|
inlinevirtualinherited |
Implements bpp::GraphicDevice.
Definition at line 58 of file AbstractGraphicDevice.h.
References bpp::AbstractGraphicDevice::bgColor_.
|
inlinevirtualinherited |
Implements bpp::GraphicDevice.
Definition at line 59 of file AbstractGraphicDevice.h.
References bpp::AbstractGraphicDevice::font_.
|
inlinevirtualinherited |
Implements bpp::GraphicDevice.
Definition at line 57 of file AbstractGraphicDevice.h.
References bpp::AbstractGraphicDevice::fgColor_.
|
inlinevirtualinherited |
Implements bpp::GraphicDevice.
Definition at line 62 of file AbstractGraphicDevice.h.
References bpp::AbstractGraphicDevice::currentLayer_.
Referenced by comment(), bpp::PgfGraphicDevice::end(), and bpp::PgfGraphicDevice::setCurrentLayer().
|
inlinevirtualinherited |
Implements bpp::GraphicDevice.
Definition at line 61 of file AbstractGraphicDevice.h.
References bpp::AbstractGraphicDevice::lineType_.
|
inlinevirtualinherited |
Implements bpp::GraphicDevice.
Definition at line 60 of file AbstractGraphicDevice.h.
References bpp::AbstractGraphicDevice::pointSize_.
Referenced by bpp::PgfGraphicDevice::setCurrentLineType().
|
inlinevirtualinherited |
Implements bpp::GraphicDevice.
Definition at line 41 of file AbstractGraphicDevice.h.
References bpp::AbstractGraphicDevice::xUnit_.
Referenced by bpp::PgfGraphicDevice::end().
|
inlinevirtualinherited |
Implements bpp::GraphicDevice.
Definition at line 42 of file AbstractGraphicDevice.h.
References bpp::AbstractGraphicDevice::yUnit_.
Referenced by bpp::PgfGraphicDevice::end().
|
inlineprotectedinherited |
Definition at line 68 of file AbstractGraphicDevice.h.
References bpp::AbstractGraphicDevice::xUnit_.
|
inlineprotectedinherited |
Definition at line 69 of file AbstractGraphicDevice.h.
References bpp::AbstractGraphicDevice::yUnit_.
|
inlinevirtualinherited |
Implements bpp::GraphicDevice.
Reimplemented in bpp::XFigGraphicDevice, and bpp::PgfGraphicDevice.
Definition at line 45 of file AbstractGraphicDevice.h.
Referenced by bpp::PgfGraphicDevice::setCurrentBackgroundColor(), and bpp::XFigGraphicDevice::setCurrentBackgroundColor().
|
inlinevirtualinherited |
Implements bpp::GraphicDevice.
Reimplemented in bpp::XFigGraphicDevice, and bpp::PgfGraphicDevice.
Definition at line 46 of file AbstractGraphicDevice.h.
Referenced by bpp::PgfGraphicDevice::setCurrentFont(), and bpp::XFigGraphicDevice::setCurrentFont().
|
inlinevirtualinherited |
Implements bpp::GraphicDevice.
Reimplemented in bpp::XFigGraphicDevice, and bpp::PgfGraphicDevice.
Definition at line 44 of file AbstractGraphicDevice.h.
Referenced by bpp::PgfGraphicDevice::setCurrentForegroundColor(), and bpp::XFigGraphicDevice::setCurrentForegroundColor().
|
inlinevirtualinherited |
Implements bpp::GraphicDevice.
Reimplemented in bpp::PgfGraphicDevice.
Definition at line 55 of file AbstractGraphicDevice.h.
Referenced by bpp::PgfGraphicDevice::setCurrentLayer(), and bpp::XFigGraphicDevice::XFigGraphicDevice().
|
inlinevirtualinherited |
Implements bpp::GraphicDevice.
Reimplemented in bpp::XFigGraphicDevice, and bpp::PgfGraphicDevice.
Definition at line 48 of file AbstractGraphicDevice.h.
References bpp::GraphicDevice::LINE_DASHED, bpp::GraphicDevice::LINE_DOTTED, bpp::GraphicDevice::LINE_SOLID, and bpp::TextTools::toString().
Referenced by bpp::PgfGraphicDevice::setCurrentLineType(), and bpp::XFigGraphicDevice::setCurrentLineType().
|
inlinevirtualinherited |
Implements bpp::GraphicDevice.
Reimplemented in bpp::PgfGraphicDevice.
Definition at line 47 of file AbstractGraphicDevice.h.
Referenced by bpp::PgfGraphicDevice::setCurrentPointSize().
|
inlinevirtualinherited |
xu | The x expansion factor. The actual unit actually depends on the implementation. |
Implements bpp::GraphicDevice.
Definition at line 39 of file AbstractGraphicDevice.h.
Referenced by bpp::PgfGraphicDevice::PgfGraphicDevice().
|
inlinevirtualinherited |
yu | The y expansion factor. The actual unit actually depends on the implementation. |
Implements bpp::GraphicDevice.
Definition at line 40 of file AbstractGraphicDevice.h.
Referenced by bpp::PgfGraphicDevice::PgfGraphicDevice().
|
inlineprotectedinherited |
Definition at line 65 of file AbstractGraphicDevice.h.
References bpp::AbstractGraphicDevice::xUnit_.
Referenced by bpp::PgfGraphicDevice::setCurrentLineType(), and bpp::PgfGraphicDevice::setCurrentPointSize().
|
inlineprotectedinherited |
Definition at line 66 of file AbstractGraphicDevice.h.
References bpp::AbstractGraphicDevice::yUnit_.
|
staticinherited |
Definition at line 150 of file GraphicDevice.h.
Referenced by bpp::XFigGraphicDevice::setCurrentLineType(), bpp::PgfGraphicDevice::~PgfGraphicDevice(), and ~SvgGraphicDevice().
|
staticinherited |
Definition at line 151 of file GraphicDevice.h.
Referenced by bpp::PgfGraphicDevice::drawCircle(), and bpp::PgfGraphicDevice::drawRect().
|
staticinherited |
Definition at line 152 of file GraphicDevice.h.
|
private |
Definition at line 28 of file SvgGraphicDevice.h.
|
private |
Definition at line 29 of file SvgGraphicDevice.h.
|
private |
Definition at line 26 of file SvgGraphicDevice.h.
|
private |
Definition at line 25 of file SvgGraphicDevice.h.
|
staticinherited |
Definition at line 155 of file GraphicDevice.h.
Referenced by bpp::AbstractGraphicDevice::setCurrentLineType(), bpp::PgfGraphicDevice::setCurrentLineType(), and bpp::XFigGraphicDevice::setCurrentLineType().
|
staticinherited |
Definition at line 156 of file GraphicDevice.h.
Referenced by bpp::AbstractGraphicDevice::setCurrentLineType(), bpp::PgfGraphicDevice::setCurrentLineType(), and bpp::XFigGraphicDevice::setCurrentLineType().
|
staticinherited |
Definition at line 154 of file GraphicDevice.h.
Referenced by bpp::AbstractGraphicDevice::setCurrentLineType(), bpp::PgfGraphicDevice::setCurrentLineType(), and bpp::XFigGraphicDevice::setCurrentLineType().
|
private |
Definition at line 27 of file SvgGraphicDevice.h.
|
private |
Definition at line 27 of file SvgGraphicDevice.h.
|
private |
Definition at line 27 of file SvgGraphicDevice.h.
|
private |
Definition at line 27 of file SvgGraphicDevice.h.
|
private |
Definition at line 24 of file SvgGraphicDevice.h.
|
staticinherited |
Definition at line 143 of file GraphicDevice.h.
Referenced by bpp::PgfGraphicDevice::drawText().
|
staticinherited |
Definition at line 144 of file GraphicDevice.h.
Referenced by bpp::PgfGraphicDevice::drawText(), bpp::XFigGraphicDevice::setCurrentLineType(), bpp::PgfGraphicDevice::~PgfGraphicDevice(), and ~SvgGraphicDevice().
|
staticinherited |
Definition at line 145 of file GraphicDevice.h.
Referenced by bpp::PgfGraphicDevice::drawText().
|
staticinherited |
Definition at line 147 of file GraphicDevice.h.
Referenced by bpp::PgfGraphicDevice::drawText(), bpp::XFigGraphicDevice::setCurrentLineType(), bpp::PgfGraphicDevice::~PgfGraphicDevice(), and ~SvgGraphicDevice().
|
staticinherited |
Definition at line 146 of file GraphicDevice.h.
Referenced by bpp::PgfGraphicDevice::drawText().
|
staticinherited |
Definition at line 148 of file GraphicDevice.h.
Referenced by bpp::PgfGraphicDevice::drawText().