Core 1.0
|
A diffusion limited aggregation class. More...
#include <dla.h>
Public Member Functions | |
Dla2 (const double &) | |
Create the diffuse limited aggregation structure. More... | |
Dla2 (const Circle2 &, const double &) | |
Create a diffuse limited aggregation structure. More... | |
Dla2 (const Circle2 &, const QVector< Vector2 > &, const double &) | |
Create a diffuse limited aggregation structure. More... | |
~Dla2 () | |
Empty. | |
void | Add () |
Add a new particle to the cluster. More... | |
void | AddBorder () |
Add a new particle to the cluster. More... | |
void | Step (int) |
Add several particles to the cluster. More... | |
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. More... | |
QVector< int > | GetIndices () const |
Return the indices. | |
Box2 | GetBox () const |
Return the bounding box of the cluster. | |
void | Draw (QGraphicsScene &) const |
Draw the cluster. More... | |
bool | Hit (const Vector2 &, int &) const |
Detect the intersection between a disc and the cluster. More... | |
bool | Hit (const Vector2 &) const |
Detect the intersection between a disc and the cluster. More... | |
Public Member Functions inherited from ParticleSet2 | |
ParticleSet2 () | |
Empty constructor. | |
ParticleSet2 (const double &) | |
Create an empty set of particles. More... | |
ParticleSet2 (const Vector2 &, const double &) | |
Create a set of particles. More... | |
ParticleSet2 (const QVector< Vector2 > &, const double &) | |
Create a set of particles. More... | |
Circle2 | At (int) const |
Get the k-th particle. More... | |
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. More... | |
bool | Intersect (const Circle2 &) const |
Check the intersection between the cluster and a circle. More... | |
bool | Intersect (const Box2 &) const |
Check the intersection between the cluster and a box. More... | |
void | Draw (QGraphicsScene &) const |
Draw the set of particles. More... | |
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. More... | |
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 |
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. |