Core 1.0
Public Member Functions | Protected Attributes | List of all members
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. 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< Vector2GetCenters () 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 Attributes

QVector< Vector2points
 Set of particles.
 
double r
 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

◆ At()

Circle2 ParticleSet2::At ( int  k) const

Get the k-th particle.

Parameters
kIndex.

◆ Draw()

void ParticleSet2::Draw ( QGraphicsScene &  scene) const

Draw the set of particles.

Parameters
sceneGraphics scene.

◆ 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:115
Circle2 Extended(const double &) const
Extend the radius of the circle.
Definition: circle2.cpp:330
Core particle set in the plane.
Definition: particle.h:9
double Radius() const
Return the radius of the particles.
Definition: particle.h:38
Circle2 GetCircle() const
Computes the bounding circle of the centers of the particles.
Definition: particle2.cpp:105
Parameters
circleThe circle.

◆ 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.