|
Core 1.0
|
A diffusion limited aggregation class. More...
#include <dla.h>
Public Member Functions | |
| Dla2 (const double &) | |
| Create the diffuse limited aggregation structure. | |
| Dla2 (const Circle2 &, const double &) | |
| Create a diffuse limited aggregation structure. | |
| Dla2 (const Circle2 &, const QVector< Vector2 > &, const double &) | |
| Create a diffuse limited aggregation structure. | |
| ~Dla2 () | |
| Empty. | |
| void | Add () |
| Add a new particle to the cluster. | |
| void | AddBorder () |
| Add a new particle to the cluster. | |
| void | Step (int) |
| Add several particles to the cluster. | |
| void | Extend (const double &) |
| Extend the radius of the simulation. | |
| void | Agregate (const Vector2 &) |
| Perform a random walk from an initial position, and aggregate particle if it hits the cluster. | |
| QVector< int > | GetIndices () const |
| Return the indices. | |
| Box2 | GetBox () const |
| Return the bounding box of the cluster. | |
| void | Draw (QGraphicsScene &) const |
| Draw the cluster. | |
| bool | Hit (const Vector2 &, int &) const |
| Detect the intersection between a disc and the cluster. | |
| bool | Hit (const Vector2 &) const |
| Detect the intersection between a disc and the cluster. | |
Public Member Functions inherited from ParticleSet2 | |
| 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 Member Functions | |
| bool | Walk (Vector2 &, int &, int=2000) |
| Perform a random walk until the particle either collides with the cluster, or until it reaches the maximum number of steps or escapes from the domain. | |
Protected Attributes | |
| Circle2 | circle |
| Bounding circle of the domain. | |
| QVector< int > | v |
| Tree structure topology, i.e., index of the collided particle during cluster growth. | |
Protected Attributes inherited from ParticleSet2 | |
| QVector< Vector2 > | points |
| Set of particles. | |
| double | r = 0.0 |
| Radius of particles. | |
A diffusion limited aggregation class.
|
explicit |
Create the diffuse limited aggregation structure.
Set initial circle as empty, and list of particles as empty.
| r | Radius of particles. |
|
explicit |
Create a diffuse limited aggregation structure.
| c | Initial circle. |
| r | Radius of particles. |
Create a diffuse limited aggregation structure.
| c | Initial circle. |
| p | Set of seed points. |
| r | Radius of particles. |
| void Dla2::Add | ( | ) |
Add a new particle to the cluster.
The particle is generated inside the embedding disc.
| void Dla2::AddBorder | ( | ) |
Add a new particle to the cluster.
The particle is generated on the border of the embedding disc.
| void Dla2::Agregate | ( | const Vector2 & | start | ) |
Perform a random walk from an initial position, and aggregate particle if it hits the cluster.
| start | Initial position. |
| void Dla2::Draw | ( | QGraphicsScene & | scene | ) | const |
Draw the cluster.
| scene | Graphics scene. |
| bool Dla2::Hit | ( | const Vector2 & | p | ) | const |
Detect the intersection between a disc and the cluster.
| p | Center of the disc. |
| bool Dla2::Hit | ( | const Vector2 & | p, |
| int & | c ) const |
Detect the intersection between a disc and the cluster.
| p | Center of the disc. |
| c | Returned index of the first intersected disc. |
| void Dla2::Step | ( | int | n | ) |
Add several particles to the cluster.
| n | Number of particles. |
|
protected |
Perform a random walk until the particle either collides with the cluster, or until it reaches the maximum number of steps or escapes from the domain.
| p | Starting point. |
| c | Returned index of the particle collided. |
| steps | Maximum number of steps. |