|
bpp-core
2.2.0
|
Partial implementation of the GraphicDevice interface. More...
#include <Bpp/Graphics/AbstractGraphicDevice.h>
Inheritance diagram for bpp::AbstractGraphicDevice:
Collaboration diagram for bpp::AbstractGraphicDevice:Public Member Functions | |
| AbstractGraphicDevice () | |
| virtual | ~AbstractGraphicDevice () |
| 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) throw (Exception) |
| 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 |
| virtual void | begin ()=0 |
| Start the painting. More... | |
| virtual void | end ()=0 |
| End the painting. More... | |
| virtual void | drawLine (double x1, double y1, double x2, double y2)=0 |
| Draw a line between two points. More... | |
| virtual void | drawRect (double x, double y, double width, double height, short fill=FILL_EMPTY)=0 |
| Draw a rectangle. More... | |
| virtual void | drawCircle (double x, double y, double radius, short fill=FILL_EMPTY)=0 |
| Draw a circle. More... | |
| virtual void | drawText (double x, double y, const std::string &text, short hpos=TEXT_HORIZONTAL_LEFT, short vpos=TEXT_VERTICAL_BOTTOM, double angle=0)=0 throw (UnvalidFlagException) |
| Draw some characters. More... | |
| virtual void | comment (const std::string &comment)=0 |
| Add a comment in the output. More... | |
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 | |
| double | xUnit_ |
| double | yUnit_ |
| RGBColor | fgColor_ |
| RGBColor | bgColor_ |
| Font | font_ |
| unsigned int | pointSize_ |
| short | lineType_ |
| int | currentLayer_ |
Partial implementation of the GraphicDevice interface.
Implement this interface to support new formats.
Definition at line 53 of file AbstractGraphicDevice.h.
|
inline |
Definition at line 67 of file AbstractGraphicDevice.h.
|
inlinevirtual |
Definition at line 71 of file AbstractGraphicDevice.h.
|
pure virtualinherited |
Start the painting.
Implemented in bpp::XFigGraphicDevice, bpp::PgfGraphicDevice, and bpp::SvgGraphicDevice.
|
pure virtualinherited |
Add a comment in the output.
| comment | Comment text. |
Implemented in bpp::XFigGraphicDevice, bpp::PgfGraphicDevice, and bpp::SvgGraphicDevice.
|
pure virtualinherited |
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). |
Implemented in bpp::XFigGraphicDevice, bpp::PgfGraphicDevice, and bpp::SvgGraphicDevice.
|
pure virtualinherited |
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 |
Implemented in bpp::XFigGraphicDevice, bpp::PgfGraphicDevice, and bpp::SvgGraphicDevice.
|
pure virtualinherited |
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). |
Implemented in bpp::XFigGraphicDevice, bpp::PgfGraphicDevice, and bpp::SvgGraphicDevice.
|
pure virtualinherited | ||||||||||||||||||||||||||||||||||||
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. |
Implemented in bpp::XFigGraphicDevice, bpp::PgfGraphicDevice, and bpp::SvgGraphicDevice.
|
pure virtualinherited |
End the painting.
Depending on the implementation of the device, the call of this method might be required before the plotting commands become visible.
Implemented in bpp::XFigGraphicDevice, bpp::PgfGraphicDevice, and bpp::SvgGraphicDevice.
|
inlinevirtual |
Implements bpp::GraphicDevice.
Definition at line 93 of file AbstractGraphicDevice.h.
References bgColor_.
|
inlinevirtual |
Implements bpp::GraphicDevice.
Definition at line 94 of file AbstractGraphicDevice.h.
References font_.
|
inlinevirtual |
Implements bpp::GraphicDevice.
Definition at line 92 of file AbstractGraphicDevice.h.
References fgColor_.
|
inlinevirtual |
Implements bpp::GraphicDevice.
Definition at line 97 of file AbstractGraphicDevice.h.
References currentLayer_.
Referenced by bpp::SvgGraphicDevice::comment(), bpp::PgfGraphicDevice::end(), and bpp::PgfGraphicDevice::setCurrentLayer().
|
inlinevirtual |
Implements bpp::GraphicDevice.
Definition at line 96 of file AbstractGraphicDevice.h.
References lineType_.
|
inlinevirtual |
Implements bpp::GraphicDevice.
Definition at line 95 of file AbstractGraphicDevice.h.
References pointSize_.
|
inlinevirtual |
Implements bpp::GraphicDevice.
Definition at line 76 of file AbstractGraphicDevice.h.
References xUnit_.
Referenced by bpp::PgfGraphicDevice::end().
|
inlinevirtual |
Implements bpp::GraphicDevice.
Definition at line 77 of file AbstractGraphicDevice.h.
References yUnit_.
Referenced by bpp::PgfGraphicDevice::end().
|
inlineprotected |
Definition at line 104 of file AbstractGraphicDevice.h.
References xUnit_.
|
inlineprotected |
Definition at line 105 of file AbstractGraphicDevice.h.
References yUnit_.
|
inlinevirtual |
Implements bpp::GraphicDevice.
Reimplemented in bpp::XFigGraphicDevice, and bpp::PgfGraphicDevice.
Definition at line 80 of file AbstractGraphicDevice.h.
References bgColor_.
Referenced by bpp::PgfGraphicDevice::setCurrentBackgroundColor(), and bpp::XFigGraphicDevice::setCurrentBackgroundColor().
|
inlinevirtual |
Implements bpp::GraphicDevice.
Reimplemented in bpp::XFigGraphicDevice, and bpp::PgfGraphicDevice.
Definition at line 81 of file AbstractGraphicDevice.h.
References font_.
Referenced by bpp::PgfGraphicDevice::setCurrentFont(), and bpp::XFigGraphicDevice::setCurrentFont().
|
inlinevirtual |
Implements bpp::GraphicDevice.
Reimplemented in bpp::XFigGraphicDevice, and bpp::PgfGraphicDevice.
Definition at line 79 of file AbstractGraphicDevice.h.
References fgColor_.
Referenced by bpp::PgfGraphicDevice::setCurrentForegroundColor(), and bpp::XFigGraphicDevice::setCurrentForegroundColor().
|
inlinevirtual |
Implements bpp::GraphicDevice.
Reimplemented in bpp::PgfGraphicDevice.
Definition at line 90 of file AbstractGraphicDevice.h.
References currentLayer_.
Referenced by bpp::PgfGraphicDevice::setCurrentLayer(), and bpp::XFigGraphicDevice::XFigGraphicDevice().
|
inlinevirtual | ||||||||||||||
Implements bpp::GraphicDevice.
Reimplemented in bpp::XFigGraphicDevice, and bpp::PgfGraphicDevice.
Definition at line 83 of file AbstractGraphicDevice.h.
References bpp::GraphicDevice::LINE_DASHED, bpp::GraphicDevice::LINE_DOTTED, bpp::GraphicDevice::LINE_SOLID, lineType_, and bpp::TextTools::toString().
Referenced by bpp::PgfGraphicDevice::setCurrentLineType(), and bpp::XFigGraphicDevice::setCurrentLineType().
|
inlinevirtual |
Implements bpp::GraphicDevice.
Reimplemented in bpp::PgfGraphicDevice.
Definition at line 82 of file AbstractGraphicDevice.h.
References pointSize_.
Referenced by bpp::PgfGraphicDevice::setCurrentPointSize().
|
inlinevirtual |
| xu | The x expansion factor. The actual unit actually depends on the implementation. |
Implements bpp::GraphicDevice.
Definition at line 74 of file AbstractGraphicDevice.h.
References xUnit_.
Referenced by bpp::PgfGraphicDevice::PgfGraphicDevice().
|
inlinevirtual |
| yu | The y expansion factor. The actual unit actually depends on the implementation. |
Implements bpp::GraphicDevice.
Definition at line 75 of file AbstractGraphicDevice.h.
References yUnit_.
Referenced by bpp::PgfGraphicDevice::PgfGraphicDevice().
|
inlineprotected |
Definition at line 101 of file AbstractGraphicDevice.h.
References xUnit_.
Referenced by bpp::PgfGraphicDevice::setCurrentPointSize().
|
inlineprotected |
Definition at line 102 of file AbstractGraphicDevice.h.
References yUnit_.
|
private |
Definition at line 60 of file AbstractGraphicDevice.h.
Referenced by getCurrentBackgroundColor(), and setCurrentBackgroundColor().
|
private |
Definition at line 64 of file AbstractGraphicDevice.h.
Referenced by getCurrentLayer(), and setCurrentLayer().
|
private |
Definition at line 59 of file AbstractGraphicDevice.h.
Referenced by getCurrentForegroundColor(), and setCurrentForegroundColor().
|
staticinherited |
Definition at line 186 of file GraphicDevice.h.
|
staticinherited |
Definition at line 187 of file GraphicDevice.h.
Referenced by bpp::PgfGraphicDevice::drawCircle(), and bpp::PgfGraphicDevice::drawRect().
|
staticinherited |
Definition at line 188 of file GraphicDevice.h.
|
private |
Definition at line 61 of file AbstractGraphicDevice.h.
Referenced by getCurrentFont(), and setCurrentFont().
|
staticinherited |
Definition at line 191 of file GraphicDevice.h.
Referenced by setCurrentLineType(), and bpp::XFigGraphicDevice::setCurrentLineType().
|
staticinherited |
Definition at line 192 of file GraphicDevice.h.
Referenced by setCurrentLineType(), and bpp::XFigGraphicDevice::setCurrentLineType().
|
staticinherited |
Definition at line 190 of file GraphicDevice.h.
Referenced by setCurrentLineType(), and bpp::XFigGraphicDevice::setCurrentLineType().
|
private |
Definition at line 63 of file AbstractGraphicDevice.h.
Referenced by getCurrentLineType(), and setCurrentLineType().
|
private |
Definition at line 62 of file AbstractGraphicDevice.h.
Referenced by getCurrentPointSize(), and setCurrentPointSize().
|
staticinherited |
Definition at line 179 of file GraphicDevice.h.
|
staticinherited |
Definition at line 180 of file GraphicDevice.h.
|
staticinherited |
Definition at line 181 of file GraphicDevice.h.
|
staticinherited |
Definition at line 183 of file GraphicDevice.h.
|
staticinherited |
Definition at line 182 of file GraphicDevice.h.
|
staticinherited |
Definition at line 184 of file GraphicDevice.h.
|
private |
Definition at line 57 of file AbstractGraphicDevice.h.
Referenced by getXUnit(), revx_(), setXUnit(), and x_().
|
private |
Definition at line 58 of file AbstractGraphicDevice.h.
Referenced by getYUnit(), revy_(), setYUnit(), and y_().