Core 1.0
|
Set of disjoint polygons. More...
#include <polygon.h>
Public Member Functions | |
Polygons2 () | |
Empty. | |
Polygons2 (const QVector< Polygon2 > &) | |
Create a set of polygons. | |
Polygons2 (const QVector< Polygonal > &) | |
Create a set of polygons by projecting polygons in space. | |
int | Size () const |
Return the size of the set. | |
~Polygons2 () | |
Empty. | |
bool | Inside (const Vector2 &) const |
Test if a point is inside the union of a set of polygons. | |
double | RC (const Vector2 &) const |
Compute the squared distance between a point and a set of polygons. | |
const Polygon2 & | At (int) const |
Access. | |
void | Add (const Polygon2 &) |
Add a polygon to the set. | |
void | Draw (QGraphicsScene &, const QPen &=QPen(), const QBrush &=QBrush()) const |
Draw a polygon. | |
Protected Attributes | |
QVector< Polygon2 > | poly |
Set of polygons. | |
Set of disjoint polygons.
Polygons2::Polygons2 | ( | const QVector< Polygon2 > & | p | ) |
Create a set of polygons.
p | Set of polygons. |
Polygons2::Polygons2 | ( | const QVector< Polygonal > & | p | ) |
Create a set of polygons by projecting polygons in space.
p | Set of polygons. |
void Polygons2::Add | ( | const Polygon2 & | p | ) |
Add a polygon to the set.
p | Polygon. |
|
inline |
Access.
i | Index. |
void Polygons2::Draw | ( | QGraphicsScene & | scene, |
const QPen & | pen = QPen(), | ||
const QBrush & | brush = QBrush() ) const |
Draw a polygon.
scene | Graphics scene. |
pen | The pen. |
brush | The brush, should the triangle be filled. |
bool Polygons2::Inside | ( | const Vector2 & | p | ) | const |
Test if a point is inside the union of a set of polygons.
Polygons should be non intersecting. Polygons inside others will be considered as holes.
p | Point. |
double Polygons2::RC | ( | const Vector2 & | p | ) | const |
Compute the squared distance between a point and a set of polygons.
p | Point. |