Core 1.0
ParticleSet Class Reference

Core particle set. More...

#include <particle.h>

Inheritance diagram for ParticleSet:
Dla EdenGrowth

Public Member Functions

 ParticleSet ()
 Empty constructor.
 ParticleSet (const double &)
 Create an empty set of particles.
 ParticleSet (const Vector &, const double &)
 Create a set of particles.
 ParticleSet (const QVector< Vector > &, const double &)
 Create a set of particles.
int Size () const
 Return the number of particles.
Sphere At (int) const
 Get the k-th particle.
double Radius () const
 Return the radius of the particles.
QVector< Vector > GetCenters () const
 Return the centers of the particles.
Sphere GetSphere () const
 Computes the bounding sphere of the centers of the particles.
Box GetBox () const
 Computes the bounding box of the centers of the particles.
void Append (const Vector &)
 Add a new particle to the set.
bool Intersect (const Sphere &) const
 Check the intersection between the cluster and a sphere.
bool Intersect (const Box &) const
 Check the intersection between the cluster and a box.

Protected Attributes

QVector< Vector > points
 Set of particles.
double r = 0.0
 Radius of particles.

Detailed Description

Core particle set.

The particles have the same radius.

Constructor & Destructor Documentation

◆ ParticleSet() [1/3]

ParticleSet::ParticleSet ( const double & r)
explicit

Create an empty set of particles.

Parameters
rRadius.

◆ ParticleSet() [2/3]

ParticleSet::ParticleSet ( const Vector & p,
const double & r )
explicit

Create a set of particles.

Parameters
rRadius.
pFirst particle.

◆ ParticleSet() [3/3]

ParticleSet::ParticleSet ( const QVector< Vector > & s,
const double & r )
explicit

Create a set of particles.

Parameters
rRadius.
sSet of particles.

Member Function Documentation

◆ Append()

void ParticleSet::Append ( const Vector & p)

Add a new particle to the set.

Parameters
pPoint.

◆ At()

Sphere ParticleSet::At ( int k) const

Get the k-th particle.

Parameters
kIndex.

◆ GetBox()

Box ParticleSet::GetBox ( ) const

Computes the bounding box of the centers of the particles.

See also
GetSphere()

◆ GetSphere()

Sphere ParticleSet::GetSphere ( ) const

Computes the bounding sphere of the centers of the particles.

The exact embedding sphere can be computed as:

ParticleSet particles;
Sphere s=particles.GetSphere().Extended(particles.Radius());
Sphere GetSphere() const
Computes the bounding sphere of the centers of the particles.
Definition particle.cpp:101
ParticleSet()
Empty constructor.
Definition particle.h:37
double Radius() const
Return the radius of the particles.
Definition particle.h:42
Spheres.
Definition sphere.h:11
Sphere Extended(const double &) const
Extend the sphere, i.e. increase the radius of the sphere.
Definition sphere.cpp:469

◆ Intersect() [1/2]

bool ParticleSet::Intersect ( const Box & box) const

Check the intersection between the cluster and a box.

Parameters
boxThe box.

◆ Intersect() [2/2]

bool ParticleSet::Intersect ( const Sphere & sphere) const

Check the intersection between the cluster and a sphere.

Parameters
sphereThe sphere.