Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Examples  

QSCanvasDrv Class Reference

Abstract graphics driver. More...

#include <qsdrv.h>

Inheritance diagram for QSCanvasDrv:

Inheritance graph
[legend]
List of all members.

Public Methods

double toPixels (double points)
double toPoints (double pixels)
 QSCanvasDrv ()
virtual ~QSCanvasDrv ()
virtual QSCanvasDrv * copy ()=0
virtual void startDrawing ()
virtual void stopDrawing ()
virtual void drawLine (const QSPt2f &one, const QSPt2f &two)=0
virtual void drawRect (const QSPt2f &p1, const QSPt2f &p2)=0
virtual void drawPoly (const QSPt2f pts[], int npoints, const bool edges[]=NULL, int edgesAutoColor=0)=0
virtual void drawEllipse (const QSPt2f &p1, const QSPt2f &p2)=0
virtual void drawText (const QSPt2f &pos, const QString &text, int align=AlignLeft|AlignBottom)=0
virtual QSPt2f textSize (const QString &text)=0
virtual void drawRText (const QSPt2f &pos, int angle, const QString &text, int align=AlignLeft|AlignBottom)=0
virtual void drawRTextBox (const QSPt2f &pos, int angle, const QString &text, int align=AlignLeft|AlignBottom)
virtual void getRTextBoundingPoly (QSPt2f outPts[4], const QSPt2f &pos, int angle, const QString &text, int align=AlignLeft|AlignBottom)=0
virtual QSPt2f rTextSize (int angle, const QString &text)
virtual void drawPoint (const QSPt2f &pos, const QSGPoint &style)
virtual void drawDart (const QSPt2f &pos, double angle, const QSGArrow &style)
virtual void drawArrow (const QSPt2f &p1, const QSPt2f &p2, const QSGArrow &p1style, const QSGArrow &p2style)
virtual void setFill (const QSGFill &f)=0
virtual void setFont (const QSGFont &f)=0
virtual void setLine (const QSGLine &l)=0
virtual QSGFont currentFont ()
virtual QSGFill currentFill ()
virtual QSGLine currentLine ()
virtual void beginPolyline (const QSPt2f &pos)=0
virtual void drawPolylineTo (const QSPt2f &pos)=0
virtual void endPolyline ()
virtual QSPt2f currPolylinePos ()
virtual void getPixmapBuffer (PixmapBuffer *buff, int pwidth, int pheight)
virtual void drawPixmap (const QSPt2f &pos, PixmapBuffer *data)

Public Attributes

double dpi

Detailed Description

Abstract graphics driver.

Most functions need to be reimplemented. Font, point, arrow sizes are in points, so 'dpi' must be used to convert it to pixels, line width is an exception. Despite all coordinates are float, they are pixel coordinates. Function startDrawing() is used to initialize the graphics driver, and function stopDrawing() is called when drawing is finished.


Constructor & Destructor Documentation

QSCanvasDrv::QSCanvasDrv  
 

Constructor

virtual QSCanvasDrv::~QSCanvasDrv   [virtual]
 

Destructor


Member Function Documentation

virtual void QSCanvasDrv::beginPolyline const QSPt2f   pos [pure virtual]
 

Starts to draw a polyline.

Implemented in QSDrvHitTest.

virtual QSCanvasDrv* QSCanvasDrv::copy   [pure virtual]
 

Returns a copy of this object.

Implemented in QSDrv.

virtual QSGFill QSCanvasDrv::currentFill   [inline, virtual]
 

This function should return the current fill.

Reimplemented in QSDrvQt.

virtual QSGFont QSCanvasDrv::currentFont   [inline, virtual]
 

This function should return the current font.

Reimplemented in QSDrvQt.

virtual QSGLine QSCanvasDrv::currentLine   [inline, virtual]
 

This function should return the current line.

Reimplemented in QSDrvQt.

virtual QSPt2f QSCanvasDrv::currPolylinePos   [inline, virtual]
 

Returns the current pen position.

Reimplemented in QSDrvHitTest.

virtual void QSCanvasDrv::drawArrow const QSPt2f   p1,
const QSPt2f   p2,
const QSGArrow   p1style,
const QSGArrow   p2style
[virtual]
 

Draws an arrow. It can change current fill and line settings. It has a default implementation already.

virtual void QSCanvasDrv::drawDart const QSPt2f   pos,
double    angle,
const QSGArrow   style
[virtual]
 

Draws a line end. It can change current fill settings. It has a default implementation already.

virtual void QSCanvasDrv::drawEllipse const QSPt2f   p1,
const QSPt2f   p2
[pure virtual]
 

Draws a circle.

Implemented in QSDrvHitTest.

virtual void QSCanvasDrv::drawLine const QSPt2f   one,
const QSPt2f   two
[pure virtual]
 

Draw a line.

Implemented in QSDrvHitTest.

virtual void QSCanvasDrv::drawPixmap const QSPt2f   pos,
PixmapBuffer   data
[virtual]
 

Draw a pixmap. Notice that the pixmap buffer will be always the last requested one.'getPixmapBuffer' / 'drawPixmap' pair is always called together.

Reimplemented in QSDrvHitTest.

virtual void QSCanvasDrv::drawPoint const QSPt2f   pos,
const QSGPoint   style
[virtual]
 

Draws a point. Because point contains its own color attr. it can change current fill and line settings It has a default implementation already.

virtual void QSCanvasDrv::drawPoly const QSPt2f    pts[],
int    npoints,
const bool    edges[] = NULL,
int    edgesAutoColor = 0
[pure virtual]
 

Draw a polygon defined by 'npoints' points in 'pts'. Can change the current line ( if edgeAuto color != 0 )

Implemented in QSDrvHitTest.

virtual void QSCanvasDrv::drawPolylineTo const QSPt2f   pos [pure virtual]
 

Draw the next line segment. Wach out for setLine() call during drawPolyline2()

Implemented in QSDrvHitTest.

virtual void QSCanvasDrv::drawRect const QSPt2f   p1,
const QSPt2f   p2
[pure virtual]
 

Draw a rectangle.

Implemented in QSDrvHitTest.

virtual void QSCanvasDrv::drawRText const QSPt2f   pos,
int    angle,
const QString &    text,
int    align = AlignLeft|AlignBottom
[pure virtual]
 

Draw a rotated text. This must be reimplemented.

Implemented in QSDrvHitTest.

virtual void QSCanvasDrv::drawRTextBox const QSPt2f   pos,
int    angle,
const QString &    text,
int    align = AlignLeft|AlignBottom
[virtual]
 

Draw a rotated text. Aligns the bounding rectangle, not the bounding poly. No need to be reimplemented

virtual void QSCanvasDrv::drawText const QSPt2f   pos,
const QString &    text,
int    align = AlignLeft|AlignBottom
[pure virtual]
 

Draw a text.

Implemented in QSDrvHitTest.

virtual void QSCanvasDrv::endPolyline   [inline, virtual]
 

Ends polyline.

Reimplemented in QSDrvHitTest.

virtual void QSCanvasDrv::getPixmapBuffer PixmapBuffer   buff,
int    pwidth,
int    pheight
[virtual]
 

This method is always called before QSDrv::drawPixmap. The struct 'PixmapBuffer' must be filled with correct values. Pixmap width is requested to be equal to 'pwidth', pixmap height must be lower or equal to pheight ( see field 'lines' in 'PixmapBuffer' ).

Reimplemented in QSDrvHitTest.

virtual void QSCanvasDrv::getRTextBoundingPoly QSPt2f    outPts[4],
const QSPt2f   pos,
int    angle,
const QString &    text,
int    align = AlignLeft|AlignBottom
[pure virtual]
 

Return size of a rotated text. This must be reimplemented.

Implemented in QSDrvQt.

virtual QSPt2f QSCanvasDrv::rTextSize int    angle,
const QString &    text
[virtual]
 

Returns the size of a roated text. Default implementation is provided using 'getRTextBoundingPoly'

virtual void QSCanvasDrv::setFill const QSGFill   f [pure virtual]
 

Set the current fill .

Implemented in QSDrvHitTest.

virtual void QSCanvasDrv::setFont const QSGFont   f [pure virtual]
 

Set the current font.

Implemented in QSDrvQt.

virtual void QSCanvasDrv::setLine const QSGLine   l [pure virtual]
 

Set the current line style.

Implemented in QSDrvHitTest.

virtual void QSCanvasDrv::startDrawing   [virtual]
 

This method is called to activate the graphics context when drawing starts.

Reimplemented in QSDrv.

virtual void QSCanvasDrv::stopDrawing   [virtual]
 

This function is called when drawing ends.

Reimplemented in QSDrv.

virtual QSPt2f QSCanvasDrv::textSize const QString &    text [pure virtual]
 

Return the size of the text that will be printed by the corresponding QSDrv::drawText function.

Implemented in QSDrvQt.

double QSCanvasDrv::toPixels double    points [inline]
 

Converts points to pixels - "pixels = points*dpi/72.0".

double QSCanvasDrv::toPoints double    pixels [inline]
 

Converts pixels to points


The documentation for this class was generated from the following file:
Generated on Mon Mar 18 19:16:38 2002 for KMatplot library by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002