Wt: Wt::WPolygonArea Class Reference

Wt 3.3.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Hierarchy
- Class Members

Public Member Functions
Wt::WPolygonArea Class Reference

An interactive area in a widget, specified by a polygon. More...

`#include <Wt/WPolygonArea>`

Inheritance diagram for Wt::WPolygonArea:
[legend]

List of all members.

## Public Member Functions
| WPolygonArea ()
| Creates an empty polygon.
| WPolygonArea (const std::vector< WPoint > &points)
| Creates a polygon area with given vertices.
| WPolygonArea (const std::vector< WPointF > &points)
| Creates a polygon area with given vertices.
void | addPoint (int x, int y)
| Adds a point.
void | addPoint (double x, double y)
| Adds a point.
void | addPoint (const WPoint &point)
| Adds a point.
void | addPoint (const WPointF &point)
| Adds a point.
void | setPoints (const std::vector< WPoint > &points)
| Sets the polygon vertices.
void | setPoints (const std::vector< WPointF > &points)
| Sets the polygon vertices.
const std::vector< WPoint > & | points () const
| Returns the polygon vertices.

## Detailed Description

An interactive area in a widget, specified by a polygon.

The area may be added to a WImage or WPaintedWidget to provide interactivity on a polygon area of the image. The polygon is specified in pixel coordinates, and uses an even-odd winding rule (overlaps create holes).

     Wt::WImage *image = new Wt::WImage("images/family.jpg");
     Wt::WPolygonArea *face = new Wt::WPolygonArea();
     face->addPoint(100, 120);
     face->addPoint(300, 120);
     face->addPoint (200, 250);
     face->setToolTip("Uncle Frank");
     image->addArea(face);

The polygon area corresponds to the HTML `<area shape="poly">` tag.

See also:
  WImage::addArea(), WPaintedWidget::addArea()
  WCircleArea, WRectArea

## Constructor & Destructor Documentation

Wt::WPolygonArea::WPolygonArea | ( |  | ) |

Creates an empty polygon.

Defines an empty polygon.

Wt::WPolygonArea::WPolygonArea | ( | const std::vector< WPoint > & | points | ) |

Creates a polygon area with given vertices.

The polygon is defined with vertices corresponding to `points`. The polygon is closed by connecting the last point with the first point.

Wt::WPolygonArea::WPolygonArea | ( | const std::vector< WPointF > & | points | ) |

Creates a polygon area with given vertices.

The polygon is defined with vertices corresponding to `points`. The polygon is closed by connecting the last point with the first point.

## Member Function Documentation

const std::vector<WPoint>& Wt::WPolygonArea::points | ( |  | ) | const

Returns the polygon vertices.

See also:
  setPoints()

void Wt::WPolygonArea::setPoints | ( | const std::vector< WPoint > & | points | ) |

Sets the polygon vertices.

The polygon is defined with vertices corresponding to `points`. The polygon is closed by connecting the last point with the first point.

void Wt::WPolygonArea::setPoints | ( | const std::vector< WPointF > & | points | ) |

Sets the polygon vertices.

The polygon is defined with vertices corresponding to `points`. The polygon is closed by connecting the last point with the first point.

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator