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

QSDrvHitTest Class Reference

Implementation of QSDrv for testing which graph element is at the given position. More...

#include <qsdrvhittest.h>

Inheritance diagram for QSDrvHitTest:

Inheritance graph
[legend]
List of all members.

Signals

void hitDetected (int hitCategory, int hitElement)

Public Methods

 QSDrvHitTest (const QSPt2f &hitPosition, QObject *parent=NULL)
virtual ~QSDrvHitTest ()
virtual QSDrvHitTest * copy ()
void copySettingsFrom (const QSDrvHitTest *drv)
bool isHit () const
int hitCategory () const
int hitElement () const
QSPt2f hitPosition () const
virtual void clearCanvas (const QSGFill &f, const QSPt2f &pos, const QSPt2f &size)
virtual void drawLine (const QSPt2f &one, const QSPt2f &two)
virtual void beginPolyline (const QSPt2f &pos)
virtual void drawPolylineTo (const QSPt2f &pos)
virtual void endPolyline ()
virtual QSPt2f currPolylinePos ()
virtual void drawRect (const QSPt2f &p1, const QSPt2f &p2)
virtual void drawPoly (const QSPt2f pts[], int npoints, const bool edges[]=NULL, int edgeAutoColor=0)
virtual void drawEllipse (const QSPt2f &p1, const QSPt2f &p2)
virtual void drawText (const QSPt2f &pos, const QString &text, int align=AlignLeft|AlignBottom)
virtual void drawRText (const QSPt2f &pos, int angle, const QString &text, int align=AlignLeft|AlignBottom)
virtual void getPixmapBuffer (PixmapBuffer *buff, int pwidth, int pheight)
virtual void drawPixmap (const QSPt2f &pos, PixmapBuffer *data)
virtual void setFill (const QSGFill &f)
virtual void setLine (const QSGLine &l)

Protected Methods

void hit ()

Protected Attributes

QSPt2f m_hit_pos
bool m_is_hit
int m_hit_category
int m_hit_element
int m_curr_pixmap_width
QSGFill m_curr_fill
QSGLine m_curr_line

Detailed Description

Implementation of QSDrv for testing which graph element is at the given position.

Hit testing driver. To find out if an object was hit you must repaint it with QSHitDrv and next check if isHit() flag is set. QSHitDrv also emits signal hitDetected when isHit() flag is set and QSHitDrv is being deleted - so you can also use it when drawing in background. To find out what element was drawn, when hit was detected call hitCategory() and hitElement().

Author:
Kamil Dobkowski


Member Function Documentation

virtual void QSDrvHitTest::beginPolyline (  const QSPt2f &    pos )  [virtual]
 

Starts to draw a polyline.

Reimplemented from QSDrvQt.

virtual void QSDrvHitTest::clearCanvas (  const QSGFill &    f,
const QSPt2f &    pos,
const QSPt2f &    size
)  [virtual]
 

Clear the canvas.

Reimplemented from QSDrvQt.

virtual QSDrvHitTest* QSDrvHitTest::copy (    )  [virtual]
 

Returns a copy of this object.

Reimplemented from QSDrvQt.

virtual QSPt2f QSDrvHitTest::currPolylinePos (    )  [inline, virtual]
 

Returns the current pen position.

Reimplemented from QSDrvQt.

virtual void QSDrvHitTest::drawEllipse (  const QSPt2f &    p1,
const QSPt2f &    p2
)  [virtual]
 

Draws a circle.

Reimplemented from QSDrvQt.

virtual void QSDrvHitTest::drawLine (  const QSPt2f &    one,
const QSPt2f &    two
)  [virtual]
 

Draw a line.

Reimplemented from QSDrvQt.

virtual void QSDrvHitTest::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 from QSDrvQt.

virtual void QSDrvHitTest::drawPoly (  const QSPt2f    pts[],
int    npoints,
const bool    edges[] = NULL,
int    edgeAutoColor = 0
)  [virtual]
 

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

Reimplemented from QSDrvQt.

virtual void QSDrvHitTest::drawPolylineTo (  const QSPt2f &    pos )  [virtual]
 

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

Reimplemented from QSDrvQt.

virtual void QSDrvHitTest::drawRect (  const QSPt2f &    p1,
const QSPt2f &    p2
)  [virtual]
 

Draw a rectangle.

Reimplemented from QSDrvQt.

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

Draw a rotated text. This must be reimplemented.

Reimplemented from QSDrvQt.

virtual void QSDrvHitTest::drawText (  const QSPt2f &    pos,
const QString &    text,
int    align = AlignLeft|AlignBottom
)  [virtual]
 

Draw a text.

Reimplemented from QSDrvQt.

virtual void QSDrvHitTest::endPolyline (    )  [virtual]
 

Ends polyline.

Reimplemented from QSDrvQt.

virtual void QSDrvHitTest::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 from QSDrvQt.

virtual void QSDrvHitTest::setFill (  const QSGFill &    f )  [virtual]
 

Set the current fill .

Reimplemented from QSDrvQt.

virtual void QSDrvHitTest::setLine (  const QSGLine &    l )  [virtual]
 

Set the current line style.

Reimplemented from QSDrvQt.


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