|
bpp-core
2.1.0
|
Interface for all plotting devices. More...
#include <Bpp/Graphics/GraphicDevice.h>
Inheritance diagram for bpp::GraphicDevice:Public Member Functions | |
| GraphicDevice () | |
| virtual | ~GraphicDevice () |
| virtual void | begin ()=0 |
| Start the painting. | |
| virtual void | end ()=0 |
| End the painting. | |
| virtual void | setXUnit (double xu)=0 |
| virtual void | setYUnit (double yu)=0 |
| virtual double | getXUnit () const =0 |
| virtual double | getYUnit () const =0 |
| virtual void | setCurrentForegroundColor (const RGBColor &color)=0 |
| virtual void | setCurrentBackgroundColor (const RGBColor &color)=0 |
| virtual void | setCurrentFont (const Font &font)=0 |
| virtual void | setCurrentPointSize (unsigned int size)=0 |
| virtual void | setCurrentLineType (short type)=0 |
| virtual void | setCurrentLayer (int layerIndex)=0 |
| virtual const RGBColor & | getCurrentForegroundColor () const =0 |
| virtual const RGBColor & | getCurrentBackgroundColor () const =0 |
| virtual const Font & | getCurrentFont () const =0 |
| virtual unsigned int | getCurrentPointSize () const =0 |
| virtual short | getCurrentLineType () const =0 |
| virtual int | getCurrentLayer () const =0 |
| virtual void | drawLine (double x1, double y1, double x2, double y2)=0 |
| Draw a line between two points. | |
| virtual void | drawRect (double x, double y, double width, double height, short fill=FILL_EMPTY)=0 |
| Draw a rectangle. | |
| virtual void | drawCircle (double x, double y, double radius, short fill=FILL_EMPTY)=0 |
| Draw a circle. | |
| 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. | |
| virtual void | comment (const std::string &comment)=0 |
| Add a comment in the output. | |
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 |
Interface for all plotting devices.
Implement this interface to support new formats.
Definition at line 62 of file GraphicDevice.h.
| bpp::GraphicDevice::GraphicDevice | ( | ) | [inline] |
Definition at line 65 of file GraphicDevice.h.
| virtual bpp::GraphicDevice::~GraphicDevice | ( | ) | [inline, virtual] |
Definition at line 66 of file GraphicDevice.h.
| virtual void bpp::GraphicDevice::begin | ( | ) | [pure virtual] |
Start the painting.
Implemented in bpp::XFigGraphicDevice, bpp::PgfGraphicDevice, and bpp::SvgGraphicDevice.
| virtual void bpp::GraphicDevice::comment | ( | const std::string & | comment | ) | [pure virtual] |
Add a comment in the output.
| comment | Comment text. |
Implemented in bpp::XFigGraphicDevice, bpp::PgfGraphicDevice, and bpp::SvgGraphicDevice.
| virtual void bpp::GraphicDevice::drawCircle | ( | double | x, |
| double | y, | ||
| double | radius, | ||
| short | fill = FILL_EMPTY |
||
| ) | [pure 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). |
Implemented in bpp::XFigGraphicDevice, bpp::PgfGraphicDevice, and bpp::SvgGraphicDevice.
| virtual void bpp::GraphicDevice::drawLine | ( | double | x1, |
| double | y1, | ||
| double | x2, | ||
| double | y2 | ||
| ) | [pure 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 |
Implemented in bpp::XFigGraphicDevice, bpp::PgfGraphicDevice, and bpp::SvgGraphicDevice.
| virtual void bpp::GraphicDevice::drawRect | ( | double | x, |
| double | y, | ||
| double | width, | ||
| double | height, | ||
| short | fill = FILL_EMPTY |
||
| ) | [pure 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). |
Implemented in bpp::XFigGraphicDevice, bpp::PgfGraphicDevice, and bpp::SvgGraphicDevice.
| virtual void bpp::GraphicDevice::drawText | ( | double | x, |
| double | y, | ||
| const std::string & | text, | ||
| short | hpos = TEXT_HORIZONTAL_LEFT, |
||
| short | vpos = TEXT_VERTICAL_BOTTOM, |
||
| double | angle = 0 |
||
| ) | throw (UnvalidFlagException) [pure 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. |
Implemented in bpp::XFigGraphicDevice, bpp::PgfGraphicDevice, and bpp::SvgGraphicDevice.
| virtual void bpp::GraphicDevice::end | ( | ) | [pure 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.
Implemented in bpp::XFigGraphicDevice, bpp::PgfGraphicDevice, and bpp::SvgGraphicDevice.
| virtual const RGBColor& bpp::GraphicDevice::getCurrentBackgroundColor | ( | ) | const [pure virtual] |
Implemented in bpp::AbstractGraphicDevice.
| virtual const Font& bpp::GraphicDevice::getCurrentFont | ( | ) | const [pure virtual] |
Implemented in bpp::AbstractGraphicDevice.
| virtual const RGBColor& bpp::GraphicDevice::getCurrentForegroundColor | ( | ) | const [pure virtual] |
Implemented in bpp::AbstractGraphicDevice.
| virtual int bpp::GraphicDevice::getCurrentLayer | ( | ) | const [pure virtual] |
Implemented in bpp::AbstractGraphicDevice.
| virtual short bpp::GraphicDevice::getCurrentLineType | ( | ) | const [pure virtual] |
Implemented in bpp::AbstractGraphicDevice.
| virtual unsigned int bpp::GraphicDevice::getCurrentPointSize | ( | ) | const [pure virtual] |
Implemented in bpp::AbstractGraphicDevice.
| virtual double bpp::GraphicDevice::getXUnit | ( | ) | const [pure virtual] |
Implemented in bpp::AbstractGraphicDevice.
| virtual double bpp::GraphicDevice::getYUnit | ( | ) | const [pure virtual] |
Implemented in bpp::AbstractGraphicDevice.
| virtual void bpp::GraphicDevice::setCurrentBackgroundColor | ( | const RGBColor & | color | ) | [pure virtual] |
Implemented in bpp::XFigGraphicDevice, bpp::PgfGraphicDevice, and bpp::AbstractGraphicDevice.
| virtual void bpp::GraphicDevice::setCurrentFont | ( | const Font & | font | ) | [pure virtual] |
Implemented in bpp::XFigGraphicDevice, bpp::PgfGraphicDevice, and bpp::AbstractGraphicDevice.
| virtual void bpp::GraphicDevice::setCurrentForegroundColor | ( | const RGBColor & | color | ) | [pure virtual] |
Implemented in bpp::XFigGraphicDevice, bpp::PgfGraphicDevice, and bpp::AbstractGraphicDevice.
| virtual void bpp::GraphicDevice::setCurrentLayer | ( | int | layerIndex | ) | [pure virtual] |
Implemented in bpp::PgfGraphicDevice, and bpp::AbstractGraphicDevice.
| virtual void bpp::GraphicDevice::setCurrentLineType | ( | short | type | ) | [pure virtual] |
Implemented in bpp::XFigGraphicDevice, bpp::PgfGraphicDevice, and bpp::AbstractGraphicDevice.
| virtual void bpp::GraphicDevice::setCurrentPointSize | ( | unsigned int | size | ) | [pure virtual] |
Implemented in bpp::PgfGraphicDevice, and bpp::AbstractGraphicDevice.
| virtual void bpp::GraphicDevice::setXUnit | ( | double | xu | ) | [pure virtual] |
| xu | The x expansion factor. The actual unit actually depends on the implementation. |
Implemented in bpp::AbstractGraphicDevice.
| virtual void bpp::GraphicDevice::setYUnit | ( | double | yu | ) | [pure virtual] |
| yu | The y expansion factor. The actual unit actually depends on the implementation. |
Implemented in bpp::AbstractGraphicDevice.
short GraphicDevice::FILL_EMPTY = 10 [static] |
Definition at line 186 of file GraphicDevice.h.
short GraphicDevice::FILL_FILLED = 11 [static] |
Definition at line 187 of file GraphicDevice.h.
Referenced by bpp::PgfGraphicDevice::drawCircle(), and bpp::PgfGraphicDevice::drawRect().
short GraphicDevice::FILL_PATTERN = 12 [static] |
Definition at line 188 of file GraphicDevice.h.
short GraphicDevice::LINE_DASHED = 21 [static] |
Definition at line 191 of file GraphicDevice.h.
Referenced by bpp::AbstractGraphicDevice::setCurrentLineType(), and bpp::XFigGraphicDevice::setCurrentLineType().
short GraphicDevice::LINE_DOTTED = 22 [static] |
Definition at line 192 of file GraphicDevice.h.
Referenced by bpp::AbstractGraphicDevice::setCurrentLineType(), and bpp::XFigGraphicDevice::setCurrentLineType().
short GraphicDevice::LINE_SOLID = 20 [static] |
Definition at line 190 of file GraphicDevice.h.
Referenced by bpp::AbstractGraphicDevice::setCurrentLineType(), and bpp::XFigGraphicDevice::setCurrentLineType().
short GraphicDevice::TEXT_HORIZONTAL_CENTER = 0 [static] |
Definition at line 179 of file GraphicDevice.h.
short GraphicDevice::TEXT_HORIZONTAL_LEFT = 1 [static] |
Definition at line 180 of file GraphicDevice.h.
short GraphicDevice::TEXT_HORIZONTAL_RIGHT = 2 [static] |
Definition at line 181 of file GraphicDevice.h.
short GraphicDevice::TEXT_VERTICAL_BOTTOM = 4 [static] |
Definition at line 183 of file GraphicDevice.h.
short GraphicDevice::TEXT_VERTICAL_CENTER = 3 [static] |
Definition at line 182 of file GraphicDevice.h.
short GraphicDevice::TEXT_VERTICAL_TOP = 5 [static] |
Definition at line 184 of file GraphicDevice.h.