Newer
Older
// ************************************************************************************************
// BornAgain: simulate and fit reflection and scattering
//! @file GUI/Model/Sample/ParticleItem.cpp
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
// ************************************************************************************************
#include "GUI/Model/Sample/ParticleItem.h"
#include "GUI/Model/Group/GroupItem.h"
#include "GUI/Model/Job/JobItem.h"
#include "GUI/Model/Job/JobModelFunctions.h"
#include "GUI/Model/Sample/FormFactorItems.h"
#include "GUI/Model/Sample/ParticleCoreShellItem.h"
#include "GUI/Model/Sample/ParticleLayoutItem.h"
#include "GUI/Model/Session/SessionItemUtils.h"
#include "GUI/Model/Types/VectorItem.h"
#include "Sample/Scattering/IFormFactor.h"
Van Herck, Walter
committed
const QString abundance_tooltip = "Proportion of this type of particles normalized to the \n"
"total number of particles in the layout";
const QString position_tooltip = "Relative position of the particle's reference point \n"
"in the coordinate system of the parent (nm)";
Pospelov, Gennady
committed
ParticleItem::ParticleItem()
, ItemWithMaterial(M_TYPE)
, ItemWithParticles(M_TYPE, abundance_tooltip, position_tooltip)
addGroupProperty(P_FORM_FACTOR, formFactorGroupInfo());
setDefaultTagTransformation();
std::unique_ptr<Particle> ParticleItem::createParticle() const
{
auto& ffItem = groupItem<FormFactorItem>(P_FORM_FACTOR);
auto particle = std::make_unique<Particle>(*domainMaterial, *ffItem.createFormFactor());
particle->setAbundance(abundance());
void ParticleItem::setFormFactor(const QString& model_type)
}
FormFactorItem* ParticleItem::formFactor() const
{
return dynamic_cast<FormFactorItem*>(getGroupItem(P_FORM_FACTOR));