Skip to content
Snippets Groups Projects
Commit 90292729 authored by Van Herck, Walter's avatar Van Herck, Walter
Browse files

Moved ParticleDistribution to IAbstractParticle

parent 120aac55
No related branches found
No related tags found
No related merge requests found
...@@ -27,7 +27,7 @@ class ParticleInfo; ...@@ -27,7 +27,7 @@ class ParticleInfo;
//! @ingroup samples //! @ingroup samples
//! @brief A particle with a form factor and refractive index //! @brief A particle with a form factor and refractive index
class BA_CORE_API_ ParticleDistribution : public IParticle class BA_CORE_API_ ParticleDistribution : public IAbstractParticle
{ {
public: public:
ParticleDistribution(const IParticle &prototype, const ParameterDistribution &par_distr); ParticleDistribution(const IParticle &prototype, const ParameterDistribution &par_distr);
...@@ -59,14 +59,6 @@ public: ...@@ -59,14 +59,6 @@ public:
return mP_particle->getAmbientMaterial(); return mP_particle->getAmbientMaterial();
} }
//! Should not be called for objects of this class:
//! The object should spawn particles that will create the
//! required form factors
virtual IFormFactor *createTransformedFormFactor(complex_t wavevector_scattering_factor,
const IRotation* p_rotation,
kvector_t translation) const;
//! Initializes list of new particles generated according to a distribution //! Initializes list of new particles generated according to a distribution
virtual void generateParticleInfos(std::vector<const IParticle*>& particle_vector, virtual void generateParticleInfos(std::vector<const IParticle*>& particle_vector,
std::vector<double>& abundance_vector, std::vector<double>& abundance_vector,
...@@ -90,9 +82,6 @@ public: ...@@ -90,9 +82,6 @@ public:
} }
private: private:
//! Checks if particle's type is suitable for adding
void checkParticleType(const IParticle& p_particle);
boost::scoped_ptr<IParticle> mP_particle; boost::scoped_ptr<IParticle> mP_particle;
ParameterDistribution m_par_distribution; ParameterDistribution m_par_distribution;
}; };
......
...@@ -23,10 +23,6 @@ ParticleDistribution::ParticleDistribution(const IParticle &prototype, ...@@ -23,10 +23,6 @@ ParticleDistribution::ParticleDistribution(const IParticle &prototype,
: m_par_distribution(par_distr) : m_par_distribution(par_distr)
{ {
setName("ParticleDistribution"); setName("ParticleDistribution");
registerParameter("position_x", &m_position[0]);
registerParameter("position_y", &m_position[1]);
registerParameter("position_z", &m_position[2]);
checkParticleType(prototype);
mP_particle.reset(prototype.clone()); mP_particle.reset(prototype.clone());
registerChild(mP_particle.get()); registerChild(mP_particle.get());
} }
...@@ -44,14 +40,6 @@ ParticleDistribution *ParticleDistribution::cloneInvertB() const ...@@ -44,14 +40,6 @@ ParticleDistribution *ParticleDistribution::cloneInvertB() const
"cloneInvertB: should never be called"); "cloneInvertB: should never be called");
} }
IFormFactor *ParticleDistribution::createTransformedFormFactor(complex_t, const IRotation *,
kvector_t) const
{
throw Exceptions::NotImplementedException(
"ParticleDistribution::"
"createTransformedFormFactor: should never be called");
}
void ParticleDistribution::generateParticleInfos(std::vector<const IParticle*> &particle_vector, void ParticleDistribution::generateParticleInfos(std::vector<const IParticle*> &particle_vector,
std::vector<double> &abundance_vector, double abundance) const std::vector<double> &abundance_vector, double abundance) const
{ {
...@@ -110,12 +98,3 @@ void ParticleDistribution::generateParticleInfos(std::vector<const IParticle*> & ...@@ -110,12 +98,3 @@ void ParticleDistribution::generateParticleInfos(std::vector<const IParticle*> &
abundance_vector.push_back(particle_abundance); abundance_vector.push_back(particle_abundance);
} }
} }
void ParticleDistribution::checkParticleType(const IParticle &p_particle)
{
const ParticleDistribution *p_distr = dynamic_cast<const ParticleDistribution*>(&p_particle);
if (p_distr) {
throw Exceptions::ClassInitializationException("ParticleDistribution::checkParticleType: "
"cannot add ParticleDistribution!");
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment