# 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

- QwPolygonalGraphic ()
- virtual ~QwPolygonalGraphic ()
- virtual bool at ( int, int ) const
- bool at ( const class QRect & ) const
- virtual int rtti () const
- QPoint position () const
- int x () const
- int y () const
- void z ( int a )
- virtual int z () const
- void setPen ( QPen p )
- void setBrush ( QBrush b )
- void moveTo ( int x, int y )
- void moveTo ( QPoint )
- virtual void moveBy ( int dx, int dy )
- void moveBy ( QPoint )

## Protected Members

- virtual void makeVisible ( bool yes )
- virtual void movingBy ( int dx, int dy )
- virtual QPointArray areaPoints () const
- void addToChunks ()
- void removeFromChunks ()
- void changeChunks ()
- void drawRects ( QPainter & p )
- void draw ( class QPainter & )
- virtual void drawShape ( class QPainter & )

## 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:

- QwSpriteField.h
- QwSpriteField-double.cpp
- QwSpriteField-int.cpp
- QwSpriteField-mobdouble.cpp
- QwSpriteField-mobint.cpp
- QwSpriteField-template.cpp
- QwSpriteField.cpp