QwPolygonalGraphic Class Reference


NOT YET IMPLEMENTED - A QwSpriteFieldGraphic which renders itself in a polygonal area. More...

#include <QwSpriteField.h>

Inherits QwSpriteFieldGraphic.

Inherited by QwEllipse, QwPolygon and QwRectangle.

List of all member functions.

Public Members

Protected Members


Detailed Description

NOT YET IMPLEMENTED - A QwSpriteFieldGraphic which renders itself in a polygonal area.

QwPolygonalGraphic is an abstract class that is useful for all graphics which cover a polygonal area of chunks on the field. Sprites, the other branch of QwSpriteFieldGraphic derivatives usually cover a simple rectangular area and are dealt with specially, but typical geometric shapes such as lines and circles would be quite inefficiently bounded by rectangular areas - a diagonal line from one corner of the field area to the other bound be bounded by a rectangle covering the entire area! QwPolygonalGraphic objects allow the area to be defined by a polygon - a sequence of points indicating the chunks bounding the area covered by the graphic.

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 will generally be difficult, and hence a certain amount of over-estimation could be expected.

See also: QwLineGraphic? and QwCircleGraphic?.


Member Function Documentation

QwPolygonalGraphic::QwPolygonalGraphic ()

Construct a QwPolygonalGraphic. Derived classes should call addToChunks() in their constructor once numAreaPoints() and getAreaPoints() are valid.

QwPolygonalGraphic::~QwPolygonalGraphic () [virtual]

Destruct the QwPolygonalGraphic. Derived classes must remove the area from any chunks, as this destructor cannot call the virtual methods required to do so. That is, they must call hide() in their destructor.

void QwPolygonalGraphic::addToChunks () [protected]

Adds the sprite to the appropriate chunks.

void QwPolygonalGraphic::changeChunks () [protected]

Marks the appropriate chunks as changed.

void QwPolygonalGraphic::makeVisible ( bool show ) [virtual protected]

Adds/removes the area from the QwSpriteField chunks it covers, as required by QwSpriteFieldGraphic.

Reimplemented from QwSpriteFieldGraphic.

void QwPolygonalGraphic::removeFromChunks () [protected]

Removes the sprite from the appropriate chunks.

int QwPolygonalGraphic::rtti () const [virtual]

Returns 2.

See also: QwSpriteFieldGraphic::rtti().

Reimplemented from QwSpriteFieldGraphic.


This file is copyright © 1995-97 Warwick Allison.

It was generated from the following files:


Generated at 09:21, 1998/12/09 for Qt version 1.4 by the warwick at Troll Tech