Core 1.0
ParticleSet2 Class Reference

Core particle set in the plane. More...

#include <particle.h>

Inheritance diagram for ParticleSet2:
Dla2 EdenGrowth2 EdenAnisotropicGrowth2

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< Vector2GetCenters () 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< Vector2points
 Set of particles.
 
double r = 0.0
 Radius of particles.
 

Detailed Description

Core particle set in the plane.

The particles have the same radius.

Constructor & Destructor Documentation

◆ ParticleSet2() [1/3]

ParticleSet2::ParticleSet2 ( const double & r)
explicit

Create an empty set of particles.

Parameters
rRadius.

◆ ParticleSet2() [2/3]

ParticleSet2::ParticleSet2 ( const Vector2 & p,
const double & r )
explicit

Create a set of particles.

Parameters
rRadius.
pFirst particle.

◆ ParticleSet2() [3/3]

ParticleSet2::ParticleSet2 ( const QVector< Vector2 > & s,
const double & r )
explicit

Create a set of particles.

Parameters
rRadius.
sSet of particles.

Member Function Documentation

◆ Append()

void ParticleSet2::Append ( const Vector2 & p)

Add a new particle to the set.

Parameters
pPoint.

◆ At()

Circle2 ParticleSet2::At ( int k) const

Get the k-th particle.

Parameters
kIndex.

◆ Draw()

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.

Parameters
sceneGraphics scene.
penThe pen.
brushThe brush.

◆ GetBox()

Box2 ParticleSet2::GetBox ( ) const

Computes the bounding box of the centers of the particles.

See also
GetCircle()

◆ GetCircle()

Circle2 ParticleSet2::GetCircle ( ) const

Computes the bounding circle of the centers of the particles.

The exact embedding circle can be computed as:

ParticleSet2 particles;
Circle2 c=particles.GetCircle().Extended(particles.Radius());
Circles in the plane.
Definition circle.h:116
Circle2 Extended(const double &) const
Extend the radius of the circle.
Definition circle2.cpp:343
double Radius() const
Return the radius of the particles.
Definition particle.h:98
Circle2 GetCircle() const
Computes the bounding circle of the centers of the particles.
Definition particle2.cpp:115
ParticleSet2()
Empty constructor.
Definition particle.h:93

◆ Intersect() [1/2]

bool ParticleSet2::Intersect ( const Box2 & box) const

Check the intersection between the cluster and a box.

Parameters
boxThe box.

◆ Intersect() [2/2]

bool ParticleSet2::Intersect ( const Circle2 & circle) const

Check the intersection between the cluster and a circle.

Parameters
circleThe circle.