OpenASIP
2.0
|
#include <EPSDC.hh>
Public Member Functions | |
EPSDC () | |
virtual | ~EPSDC () |
virtual bool | Ok () const |
virtual void | BeginDrawing () |
virtual void | EndDrawing () |
virtual void | DoDrawText (const wxString &text, wxCoord x, wxCoord y) |
virtual void | DoDrawLine (wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) |
virtual void | DoCrossHair (wxCoord x, wxCoord y) |
virtual void | DoDrawPoint (wxCoord x, wxCoord y) |
virtual void | DoDrawIcon (const wxIcon &icon, wxCoord x, wxCoord y) |
virtual void | DoDrawLines (int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset) |
virtual void | DoDrawArc (wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, wxCoord xc, wxCoord yc) |
virtual void | DoDrawEllipticArc (wxCoord x, wxCoord y, wxCoord width, wxCoord height, double start, double end) |
virtual bool | DoFloodFill (wxCoord x, wxCoord y, const wxColour &colour, int style) |
virtual void | DoDrawBitmap (const wxBitmap &bitmap, wxCoord x, wxCoord y, bool transparent) |
virtual void | DoDrawPolygon (int n, wxPoint points[], wxCoord xoffset=0, wxCoord yoffset=0, int fillStyle=wxODDEVEN_RULE) |
virtual void | DoDrawRectangle (wxCoord x, wxCoord y, wxCoord width, wxCoord height) |
virtual void | DoDrawRoundedRectangle (wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius=20) |
virtual void | DoDrawEllipse (wxCoord x, wxCoord y, wxCoord width, wxCoord height) |
virtual void | DoDrawRotatedText (const wxString &text, wxCoord x, wxCoord y, double angle) |
virtual bool | DoBlit (wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, int logicalFunc=wxCOPY, bool useMask=false, wxCoord xsrcMask=-1, wxCoord ysrcMask=-1) |
virtual void | DoGetSize (wxCoord *width, wxCoord *height) const |
virtual void | DoGetTextExtent (const wxString &text, wxCoord *w, wxCoord *h, wxCoord *descent=NULL, wxCoord *externalLeading=NULL, wxFont *font=NULL) const |
virtual bool | DoGetPixel (wxCoord x, wxCoord y, wxColour *colour) const |
virtual void | DoSetClippingRegionAsRegion (const wxRegion ®ion) |
virtual bool | CanDrawBitmap () const |
virtual bool | CanGetTextExtent () const |
virtual void | Clear () |
virtual void | SetFont (const wxFont &font) |
virtual void | SetPen (const wxPen &pen) |
virtual void | SetBrush (const wxBrush &brush) |
virtual void | SetBackground (const wxBrush &brush) |
virtual void | SetBackgroundMode (int mode) |
virtual void | SetPalette (const wxPalette &palette) |
virtual void | SetLogicalFunction (int function) |
virtual wxCoord | GetCharHeight () const |
virtual wxCoord | GetCharWidth () const |
virtual int | GetDepth () const |
virtual bool | StartDoc (const wxString &message) |
virtual void | EndDoc () |
virtual void | StartPage () |
virtual void | EndPage () |
void | setTitle (const std::string &title) |
void | setCreator (const std::string &creator) |
void | writeToStream (std::ostream &stream) |
Private Member Functions | |
void | setLineColour (const wxColour &colour) |
void | setFillColour (const wxColour &colour) |
void | drawCircle (int x, int y, unsigned radius) |
Private Attributes | |
EPSGenerator | eps_ |
EPSGenerator generating the postscript code. More... | |
bool | fill_ |
True, if background brush is set to fill the shapes. More... | |
unsigned | fontSize_ |
Current font size. More... | |
Encapsulated postscript device context.
EPSDC is a wxWidgets device context for drawing graphics and text to an eps file.
EPSDC::EPSDC | ( | ) |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Clears all drawings on the canvas.
Definition at line 136 of file EPSDC.cc.
References EPSGenerator::clearBuffer(), and eps_.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Draws an ellipse on the dc.
x | Ellipse bounding box lower left corner x-coordinate. |
y | Ellipse bounding box lower left corner y-coordinate. |
width | Ellipse width. |
height | Ellipse height. |
Definition at line 361 of file EPSDC.cc.
References drawCircle(), EPSGenerator::drawEllipse(), EPSGenerator::drawFilledEllipse(), eps_, and fill_.
|
virtual |
|
virtual |
|
virtual |
Draws a line on the dc.
x1 | x-coordinate of the first end of the line. |
y1 | y-coordinate of the first end of the line. |
x2 | x-coordinate of the second end of the line. |
y2 | y-coordinate of the second end of the line. |
Definition at line 70 of file EPSDC.cc.
References EPSGenerator::drawLine(), and eps_.
|
virtual |
|
virtual |
|
virtual |
Draws a polygon on the dc.
n | Number of vertices. |
vertices | Vertices. |
xOffset | Offset for x-coordinates. |
yOffset | Offset for y-coordinates. |
Definition at line 83 of file EPSDC.cc.
References VertexList::addVertex(), EPSGenerator::drawFilledPolygon(), EPSGenerator::drawPolygon(), eps_, and fill_.
|
virtual |
Draws a rectangle on the dc.
x | Lower left corner x-coordinate of the canvas. |
y | Lower left corner y-coordinate of the canvas. |
Definition at line 111 of file EPSDC.cc.
References EPSGenerator::drawFilledRectangle(), EPSGenerator::drawRectangle(), eps_, and fill_.
Referenced by DoDrawRoundedRectangle().
|
virtual |
|
virtual |
Not implemented, falls back to a rectangle.
Definition at line 343 of file EPSDC.cc.
References DoDrawRectangle().
|
virtual |
Draws text on the dc.
text | Text to draw. |
x | x-coordinate of the lower left corner of the text. |
y | y-coordinate of the lower left corner of the text. |
Definition at line 127 of file EPSDC.cc.
References EPSGenerator::drawText(), eps_, and WxConversion::toString().
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Returns crude approximation of the width and height of a text on the dc.
w | Approximation of width is set as the value of w. |
h | Approximation of height is set as the value of h. |
Definition at line 453 of file EPSDC.cc.
References fontSize_, and Conversion::toInt().
|
virtual |
|
private |
Draws a circle.
x | X-coordinate of the circle centre. |
y | Y-coordinate of the circle centre. |
radius | Radius of the circle. |
Definition at line 437 of file EPSDC.cc.
References EPSGenerator::drawCircle(), EPSGenerator::drawFilledCircle(), eps_, and fill_.
Referenced by DoDrawEllipse().
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Sets the brush used for filling shapes with colour.
Only solid and transparent brushes are supported. Everything else is interpreted as transparent brush.
Definition at line 171 of file EPSDC.cc.
References fill_, and setFillColour().
void EPSDC::setCreator | ( | const std::string & | creator | ) |
Sets the eps-file creator string.
creator | String describin the eps file creator. |
Definition at line 199 of file EPSDC.cc.
References eps_, and EPSGenerator::setCreator().
Referenced by MachineCanvas::saveEPS().
|
private |
Sets the filling colour of the eps generator.
colour | New filing colour. |
Definition at line 421 of file EPSDC.cc.
References eps_, and EPSGenerator::setFillColour().
Referenced by SetBrush().
|
virtual |
|
private |
Sets the line drawing colour of the eps generator.
colour | New line drawing colour. |
Definition at line 408 of file EPSDC.cc.
References eps_, and EPSGenerator::setLineColour().
Referenced by SetPen().
|
virtual |
|
virtual |
|
virtual |
NOT IMPLEMENTED
Definition at line 158 of file EPSDC.cc.
References eps_, setLineColour(), and EPSGenerator::setLineWidth().
void EPSDC::setTitle | ( | const std::string & | title | ) |
Sets the eps-file title.
title | String which will be set as the eps file title. |
Definition at line 189 of file EPSDC.cc.
References eps_, and EPSGenerator::setTitle().
Referenced by MachineCanvas::saveEPS().
|
virtual |
|
virtual |
Starts a new page in the document.
Definition at line 560 of file EPSDC.cc.
Referenced by MachineCanvas::saveEPS().
void EPSDC::writeToStream | ( | std::ostream & | stream | ) |
Writes the generated eps file to an output stream.
stream | Output stream where the eps file contents will be written. |
Definition at line 209 of file EPSDC.cc.
References eps_, and EPSGenerator::writeEPS().
Referenced by MachineCanvas::saveEPS().
|
private |
EPSGenerator generating the postscript code.
Definition at line 189 of file EPSDC.hh.
Referenced by Clear(), DoDrawEllipse(), DoDrawLine(), DoDrawPolygon(), DoDrawRectangle(), DoDrawText(), drawCircle(), setCreator(), setFillColour(), SetFont(), setLineColour(), SetPen(), setTitle(), and writeToStream().
|
private |
True, if background brush is set to fill the shapes.
Definition at line 191 of file EPSDC.hh.
Referenced by DoDrawEllipse(), DoDrawPolygon(), DoDrawRectangle(), drawCircle(), and SetBrush().
|
private |
Current font size.
Definition at line 193 of file EPSDC.hh.
Referenced by DoGetTextExtent(), and SetFont().