|
Core 1.0
|
Off-lattice Eden growth. More...
#include <eden.h>
Public Member Functions | |
| EdenGrowth2 (const double &, int=37) | |
| Create an Eden growth structure. | |
| EdenGrowth2 (const Vector2 &, const double &, int=37) | |
| Create an Eden growth structure. | |
| EdenGrowth2 (const QVector< Vector2 > &, const double &, int=37) | |
| Create an Eden growth structure. | |
| EdenGrowth2 (const ParticleSet2 &, int=37) | |
| Create an Eden growth structure. | |
| ~EdenGrowth2 () | |
| Empty. | |
| virtual bool | Collide (const Vector2 &) const |
| Test if a candidate particle collides with an obstacle. | |
| virtual void | Step () |
| Add a new particle to the cluster. | |
| virtual void | Step (int) |
| Perform several growth steps. | |
| void | AddCell (const Vector &) |
| Add a new particle to the cluster. | |
| Box2 | GetBox () const |
| Compute the bounding box of the cluster. | |
| QVector< int > | GetIndices () const |
| Return the indices. | |
| QVector< int > | Strahler () const |
| Compute the Strahler numbers of the particles of the cluster. | |
| QVector< int > | Topology () const |
| Compute the topology of the tree. | |
| QVector< int > | Seeds () const |
| Return the indexes of the seeds that for the connex parts of the clusters. | |
| ParticleSet2 | Cluster (int) const |
| Compute the set of particles linked to a given particle. | |
| void | Multi (int) |
| Shrink the radius of the particles, inserting necessary particles in between previously connected particles. | |
| Polygon2 | Contour () const |
| Compute the polygonal contour of the cluster. | |
| void | Draw (QGraphicsScene &) const |
| Draw the cluster. | |
| void | DrawSimple (QGraphicsScene &, const double &=0.025) const |
| Draw the cluster. | |
| void | DrawStrahler (QGraphicsScene &) const |
| Draw the cluster using s Strahler-based coloring. | |
| 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 | |
| virtual int | GrowthSites (const Vector2 &, Vector2 *) const |
| Find candidate growth directions from a particle. | |
| virtual int | Select () const |
| Select a random particle in the front list. | |
| int | Ancestor (int) const |
| Compute the ancestor of a given particle. | |
Protected Attributes | |
| Circle2 | circle |
| Bounding circle of the domain. | |
| QVector< int > | v |
| Tree structure topology, i.e., index of the ancestor particle during growth. | |
| QVector< int > | s |
| Set of indexes referencing boundary cells. | |
| int | SamplingN = 37 |
| Sampling: generate N evenly distributed cells around a given cell, with angle \(2\pi/N\), 37 approximate off lattice, 4 and 6 are the square and hexagonal lattices respectively. | |
| Protected Attributes inherited from ParticleSet2 | |
| QVector< Vector2 > | points |
| Set of particles. | |
| double | r = 0.0 |
| Radius of particles. | |
Static Protected Attributes | |
| static Random | random |
| Random number generator. | |
| static RandomFast | fastrandom |
| Fast random number generator. | |
Off-lattice Eden growth.
Inherited classes may implement collision with obstacles, simply implementing default member function EdenGrowth2::Collide. Open-Eden models may be coded by changing the selection of random particles, simply by re-implementing the default member function EdenGrowth2::Select.
|
explicit |
Create an Eden growth structure.
Set initial circle as empty, and list of particles as empty.
| r | Radius of particles. |
| n | Lattice or pseudo off lattice parameter. |
|
explicit |
Create an Eden growth structure.
| c | Initial particle position. |
| r | Radius of particles. |
| n | Lattice or pseudo off lattice parameter. |
|
explicit |
Create an Eden growth structure.
| p | Set of seed points. |
| r | Radius of particles. |
| n | Lattice or pseudo off lattice parameter. |
|
explicit |
Create an Eden growth structure.
| particles | Set of particles. |
| n | Lattice or pseudo off lattice parameter. |
| void EdenGrowth2::AddCell | ( | const Vector & | c | ) |
Add a new particle to the cluster.
If the particle intersects the cluster, it automatically dies and is not added to the cluster.
Otherwise, it is added as a living particle.
|
protected |
Compute the ancestor of a given particle.
| k | Index. |
| ParticleSet2 EdenGrowth2::Cluster | ( | int | k | ) | const |
Compute the set of particles linked to a given particle.
| k | Index. |
|
virtual |
Test if a candidate particle collides with an obstacle.
This is a default member function that always returns false.
| p | Point, center of particle. |
| Polygon2 EdenGrowth2::Contour | ( | ) | const |
Compute the polygonal contour of the cluster.
Perform a Delaunay triangulation, and remove some triangles.
| void EdenGrowth2::Draw | ( | QGraphicsScene & | scene | ) | const |
Draw the cluster.
| scene | Graphics scene. |
| void EdenGrowth2::DrawSimple | ( | QGraphicsScene & | scene, |
| const double & | width = 0.025 ) const |
Draw the cluster.
| scene | Graphics scene. |
| width | Pen width. |
| void EdenGrowth2::DrawStrahler | ( | QGraphicsScene & | scene | ) | const |
Draw the cluster using s Strahler-based coloring.
| scene | Graphics scene. |
Find candidate growth directions from a particle.
This function has an O(n) complexity.
| q | Position of the candidate particle. |
| sites | Array of returned growth positions. |
| void EdenGrowth2::Multi | ( | int | m | ) |
Shrink the radius of the particles, inserting necessary particles in between previously connected particles.
| m | Shrinking factor, should be ≤ 16. |
| QVector< int > EdenGrowth2::Seeds | ( | ) | const |
Return the indexes of the seeds that for the connex parts of the clusters.
|
virtual |
Add a new particle to the cluster.
Select a random particle in the existing cluster, and compute candidate growth directions. Repeat random selection until a valid particle is found. Then select a randomly generated growth direction and update the cluster.
This function has an O(n) complexity.
Reimplemented in EdenAnisotropicGrowth2.
|
virtual |
Perform several growth steps.
| n | Number of growth steps. |
Reimplemented in EdenAnisotropicGrowth2.
| QVector< int > EdenGrowth2::Topology | ( | ) | const |
Compute the topology of the tree.