32 setTitle(
"Meso crystal");
33 setObjectName(
"MesoCrystal");
47 connect(
m_basisCombo, QOverload<int>::of(&QComboBox::currentIndexChanged),
this,
56 collapser->addAction(showInRealSpaceAction);
67 auto* combo =
new QComboBox(parent);
69 combo->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
71 uint32_t currentData = 0;
74 combo->addItem(QIcon(ui.iconPath), ui.menuEntry,
static_cast<uint32_t
>(type));
77 currentData =
static_cast<uint32_t
>(type);
81 combo->addItem(QIcon(ui.iconPath), ui.menuEntry, 1000 +
static_cast<uint32_t
>(type));
83 currentData = 1000 +
static_cast<uint32_t
>(type);
86 combo->setMaxVisibleItems(combo->count());
88 const auto currentIndex = combo->findData(currentData);
89 ASSERT(currentIndex >= 0);
90 combo->setCurrentIndex(currentIndex);
100 const auto currentData =
m_basisCombo->currentData().toUInt();
101 if (currentData < 1000)
Defines class ActionFactory.
Defines class GroupBoxCollapser.
Defines class MesoCrystalItem.
Defines class ParticleItem.
Defines class VectorDescriptor.
static QAction * createShowInRealSpaceAction(QObject *parent, const QString &what, std::function< void()> slot=nullptr)
Create "show in RealSpace" action.
static QAction * createRemoveAction(QObject *parent, const QString &what, std::function< void()> slot=nullptr)
Create "remove" action.
static GroupBoxCollapser * installIntoGroupBox(QGroupBox *groupBox, bool expanded=true)
static Type type(const ItemWithParticles *item)
Returns the enum type of the given item.
static QVector< Type > assemblyTypes()
Available types of assembly items, sorted as expected in the UI (e.g. in combo box)
static UiInfo uiInfo(Type t)
UiInfo on the given type.
DoubleDescriptor abundance() const
SelectionDescriptor< RotationItem * > rotation()
Returns selection descriptor for rotation methods.
VectorDescriptor positionVector() const
VectorDescriptor vectorB() const
VectorDescriptor vectorC() const
VectorDescriptor vectorA() const
SelectionDescriptor< FormFactorItem * > outerShape() const
ItemWithParticles * basisParticle() const
Class to modify a sample from the layer oriented sample editor.
void setMesoCrystalBasis(MesoCrystalForm *widget, ItemWithParticlesCatalog::Type type)
void requestViewInRealSpace(SampleItem item)
void removeParticle(ItemWithParticles *item)
static void install(QObject *obj)
QWidget * createWidgetForItemWithParticles(QWidget *parentWidget, ItemWithParticles *itemWithParticles, bool allowAbundance, SampleEditorController *ec, bool allowRemove=true)