A QCanvasItem which renders itself in a polygonal area. More...
#include <qcanvas.h>
Inherits QCanvasItem.
Inherited by QCanvasEllipse, QCanvasLine, QCanvasPolygon and QCanvasRectangle.
QCanvasPolygonalItem is an abstract class that is useful for all items which cover a polygonal area of the canvas. QCanvasSprite and QCanvasText, the other branches of QCanvasItem derivatives usually cover a simple rectangular area and are dealt with specially, but typical geometric shapes such as lines and circles would be too inefficiently bounded by rectangular areas - a diagonal line from one corner of the canvas area to the other bound be bounded by a rectangle covering the entire area! QCanvasPolygonalItem objects allow the area to be defined by a polygon - a sequence of points bounding the area covered by the item.
Derived classes should try to define as small as possible an area to maximize efficiency, but must definately be contained completely within the polygonal area. Calculating the exact requirements may be difficult, but a small amount of over-estimation is better than any under-estimation, which will give drawing errors.
All subclasses must call hide() in their destructor while the functions numAreaPoints() and getAreaPoints() are valid.
Constructs a QCanvasPolygonalItem on canvas.
[virtual]
Destruct the QCanvasPolygonalItem. Derived classes must call hide() in their destructor, as this destructor cannot call the virtual methods.
[virtual]
Must return the points bounding the shape. Note that the returned points are outside the object, not touching it.
Reimplemented in QCanvasPolygon, QCanvasEllipse, QCanvasRectangle and QCanvasLine.
[virtual]
Returns the points advanced by the current xVelocity() and yVelocity().
[virtual]
Returns the bounding rectangle of the polygonal item, based on areaPoints().
Reimplemented from QCanvasItem.
Returns the QBrush used to fill the item, if filled.
See also setBrush().
[virtual]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QCanvasItem.
[virtual protected]
Reimplemented from QCanvasItem, this draws the item by setting the pen and brush on p and calling drawShape().
Reimplemented from QCanvasItem.
[virtual protected]
Subclasses must reimplement this function to draw their shape. The pen and brush of p are already set to pen() and brush() prior to calling this function.
See also draw().
Reimplemented in QCanvasRectangle, QCanvasPolygon, QCanvasEllipse and QCanvasLine.
Returns the QPen used to draw the outline of the item, if any.
See also setPen().
[virtual]
Returns 2.
See also QCanvasItem::rtti().
Reimplemented from QCanvasItem.
[virtual]
Sets the QBrush used when drawing item.
See also setPen(), brush() and drawShape().
[virtual]
Sets the QPen used when drawing the item. Note that many QCanvasPolygonalItem do not use the pen value.
See also setBrush(), pen() and drawShape().
Reimplemented in QCanvasLine.
[protected]
Sets whether the polygonal item to use winding algorithm for determine the "inside" of the polygon, rather than the odd-even algorithm.
See also winding().
[protected]
Returns TRUE if the polygonal item uses the winding algorithm for determine the "inside" of the polygon, of FALSE if it uses the odd-even algorithm.
See also setWinding().
Search the documentation, FAQ, qt-interest archive and more (uses
www.trolltech.com):
This file is part of the Qt toolkit, copyright © 1995-2000 Trolltech, all rights reserved.
Copyright © 2000 Trolltech | Trademarks | Qt version 2.2.1
|