Skip to content
Snippets Groups Projects
Commit c4fef82f authored by Matthias Puchner's avatar Matthias Puchner
Browse files

rm obsolete TransformationItem

parent feb37a8d
No related branches found
No related tags found
1 merge request!570remove SessionModel/Item from SampleModel and all related items
// ************************************************************************************************
//
// BornAgain: simulate and fit reflection and scattering
//
//! @file GUI/Model/Trafo/TransformationItem.cpp
//! @brief Implements class TransformationItem
//!
//! @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/Trafo/TransformationItem.h"
#include "GUI/Model/Group/GroupInfo.h"
#include "GUI/Model/Trafo/RotationItems.h"
TransformationItem::TransformationItem() : SessionItem(M_TYPE)
{
setToolTip("Rotation applied to particles");
GroupInfo info;
info.add(XRotationItem::M_TYPE, "X axis Rotation");
info.add(YRotationItem::M_TYPE, "Y axis Rotation");
info.add(ZRotationItem::M_TYPE, "Z axis Rotation");
info.add(EulerRotationItem::M_TYPE, "Euler Rotation");
info.setDefaultType(ZRotationItem::M_TYPE);
addGroupProperty(P_ROT, info);
}
RotationItem* TransformationItem::rotationItem() const
{
return dynamic_cast<RotationItem*>(getGroupItem(P_ROT));
}
void TransformationItem::setRotationType(const QString& modelType)
{
setGroupProperty(P_ROT, modelType);
}
// ************************************************************************************************
//
// BornAgain: simulate and fit reflection and scattering
//
//! @file GUI/Model/Trafo/TransformationItem.h
//! @brief Defines class TransformationItem
//!
//! @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)
//
// ************************************************************************************************
#ifndef BORNAGAIN_GUI_MODEL_TRAFO_TRANSFORMATIONITEM_H
#define BORNAGAIN_GUI_MODEL_TRAFO_TRANSFORMATIONITEM_H
#include "GUI/Model/Session/SessionItem.h"
class RotationItem;
class BA_CORE_API_ TransformationItem : public SessionItem {
private:
static constexpr auto P_ROT{"Rotation type"};
public:
static constexpr auto M_TYPE{"Rotation"};
TransformationItem();
RotationItem* rotationItem() const;
template <typename T> T* setRotationType();
void setRotationType(const QString& modelType);
};
template <typename T> T* TransformationItem::setRotationType()
{
static_assert(std::is_base_of<RotationItem, T>::value,
"Class must be derived from RotationItem");
return setGroupPropertyType<T>(P_ROT);
}
#endif // BORNAGAIN_GUI_MODEL_TRAFO_TRANSFORMATIONITEM_H
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