21 IParticle::~IParticle() =
default;
30 throw std::runtime_error(
"IParticle::createSlicedParticle error: "
36 m_position += translation;
41 return mP_rotation.get();
47 registerChild(mP_rotation.get());
57 m_position =
rotation.transformed(m_position);
58 registerChild(mP_rotation.get());
63 return std::vector<const INode*>() << mP_rotation;
66 void IParticle::registerAbundance(
bool make_registered)
68 if (make_registered) {
70 registerParameter(
"Abundance", &m_abundance);
72 removeParameter(
"Abundance");
78 if (make_registered) {
79 if (!
parameter(XComponentName(
"Position"))) {
80 registerVector(
"Position", &m_position,
"nm");
83 removeVector(
"Position");
90 result.push_back(this->
clone());
97 std::unique_ptr<IRotation> P_rot(IRotation::createIdentity());
98 return {P_ff->bottomZ(*P_rot), P_ff->topZ(*P_rot)};
107 return p_rotation->clone();
110 return mP_rotation->clone();
119 return translation + p_rotation->transformed(m_position);
121 return translation + m_position;
Defines interface IParticle.
Defines class RealParameter.
IRotation * createProduct(const IRotation &left, const IRotation &right)
Returns concatenated rotation (first right, then left).
Defines IRotation classes.
Defines class SlicedParticle.
RealParameter * parameter(const std::string &name) const
Returns parameter with given 'name'.
void translate(kvector_t translation) override final
Translates the particle.
virtual SafePointerVector< IParticle > decompose() const
Decompose in constituent IParticle objects.
virtual SlicedParticle createSlicedParticle(ZLimits limits) const
Creates a sliced form factor for this particle.
void registerPosition(bool make_registered=true)
Registers the three components of its position.
std::vector< const INode * > getChildren() const override
Returns a vector of children (const).
void rotate(const IRotation &rotation) override final
Rotates the particle.
IRotation * createComposedRotation(const IRotation *p_rotation) const
Creates a composed IRotation object.
const IRotation * rotation() const
Returns rotation object.
kvector_t composedTranslation(const IRotation *p_rotation, kvector_t translation) const
Gets a composed translation vector.
IParticle * clone() const override=0
Returns a clone of this ISample object.
void setRotation(const IRotation &rotation)
Sets transformation.
virtual IFormFactor * createFormFactor() const
Creates a form factor for this particle.
virtual ParticleLimits bottomTopZ() const
Top and bottom z-coordinate.
void registerParticleProperties()
Registers abundance and position.
Pure virtual interface for rotations.
A vector of pointers, owned by *this, with methods to handle them safely.
Class that contains upper and lower limits of the z-coordinate for the slicing of form factors.
Vertical extension of a particle, specified by bottom and top z coordinate.
Struct that contains information on a sliced particle.