|
Core 1.0
|
Core particle set in the plane. More...
#include <particle.h>
Public Member Functions | |
| ParticleSet2 () | |
| Empty constructor. | |
| ParticleSet2 (const double &) | |
| Create an empty set of particles. | |
| ParticleSet2 (const Vector2 &, const double &) | |
| Create a set of particles. | |
| ParticleSet2 (const QVector< Vector2 > &, const double &) | |
| Create a set of particles. | |
| int | Size () const |
| Return the number of particles. | |
| Circle2 | At (int) const |
| Get the k-th particle. | |
| double | Radius () const |
| Return the radius of the particles. | |
| QVector< Vector2 > | GetCenters () const |
| Return the centers of the particles. | |
| Circle2 | GetCircle () const |
| Computes the bounding circle of the centers of the particles. | |
| Box2 | GetBox () const |
| Computes the bounding box of the centers of the particles. | |
| void | Append (const Vector2 &) |
| Add a new particle to the set. | |
| bool | Intersect (const Circle2 &) const |
| Check the intersection between the cluster and a circle. | |
| bool | Intersect (const Box2 &) const |
| Check the intersection between the cluster and a box. | |
| void | Draw (QGraphicsScene &, const QPen &=QPen(QColor(150, 150, 200), 0.025), const QBrush &=QBrush(QColor(200, 200, 250))) const |
| Draw the set of particles. | |
Protected Attributes | |
| QVector< Vector2 > | points |
| Set of particles. | |
| double | r = 0.0 |
| Radius of particles. | |
Core particle set in the plane.
The particles have the same radius.
|
explicit |
Create an empty set of particles.
| r | Radius. |
|
explicit |
Create a set of particles.
| r | Radius. |
| p | First particle. |
|
explicit |
Create a set of particles.
| r | Radius. |
| s | Set of particles. |
| void ParticleSet2::Append | ( | const Vector2 & | p | ) |
Add a new particle to the set.
| p | Point. |
| Circle2 ParticleSet2::At | ( | int | k | ) | const |
Get the k-th particle.
| k | Index. |
| void ParticleSet2::Draw | ( | QGraphicsScene & | scene, |
| const QPen & | pen = QPen(QColor(150, 150, 200), 0.025), | ||
| const QBrush & | brush = QBrush(QColor(200, 200, 250)) ) const |
Draw the set of particles.
| scene | Graphics scene. |
| pen | The pen. |
| brush | The brush. |
| Box2 ParticleSet2::GetBox | ( | ) | const |
Computes the bounding box of the centers of the particles.
| Circle2 ParticleSet2::GetCircle | ( | ) | const |
Computes the bounding circle of the centers of the particles.
The exact embedding circle can be computed as:
| bool ParticleSet2::Intersect | ( | const Box2 & | box | ) | const |
Check the intersection between the cluster and a box.
| box | The box. |
| bool ParticleSet2::Intersect | ( | const Circle2 & | circle | ) | const |
Check the intersection between the cluster and a circle.
| circle | The circle. |