32 QComboBox* createFormFactorCombo(QWidget* parent,
FormFactorItem* current)
35 auto* combo =
new QComboBox(parent);
37 combo->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
41 combo->addItem(QIcon(ui.iconPath), ui.menuEntry, (uint8_t)type);
43 combo->setMaxVisibleItems(combo->count());
58 setTitle(
"Sim/shell particle");
67 auto* coreParticleGroup =
new QGroupBox(
this);
68 coreParticleGroup->setObjectName(
"Particle");
70 core.
layouter = std::make_unique<FormLayouter>(coreParticleGroup, ec);
80 auto* showInRealSpaceAction =
82 connect(showInRealSpaceAction, &QAction::triggered,
this,
88 layouter.
addRow(coreParticleGroup);
93 auto* shellParticleGroup =
new QGroupBox(
this);
94 shellParticleGroup->setObjectName(
"Particle");
95 shell.
layouter = std::make_unique<FormLayouter>(shellParticleGroup, ec);
104 auto* showInRealSpaceAction =
106 connect(showInRealSpaceAction, &QAction::triggered,
this,
112 layouter.
addRow(shellParticleGroup);
120 mainCollapser->addAction(showInRealSpaceAction);
161 QString groupTitle =
"Core";
164 const QString formfactor =
166 groupTitle +=
" (" + formfactor +
")";
169 particle->formfactor_at_bottom()->geometryValues());
170 core.
layouter->addVector(particle->positionVector(),
false);
180 QString groupTitle =
"Shell";
183 const QString formfactor =
185 groupTitle +=
" (" + formfactor +
")";
188 particle->formfactor_at_bottom()->geometryValues());
Defines class ActionFactory.
Defines class GroupBoxCollapser.
Defines class ParticleCoreShellForm.
Defines class ParticleCoreShellItem.
Defines class ParticleItem.
Defines class SampleEditorController.
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.
void addAction(QAction *action)
Add a tool button to the title bar, connected to the given action.
static GroupBoxCollapser * installIntoGroupBox(QGroupBox *groupBox, bool expanded=true)
void setTitle(const QString &title)
Set the title of the group box. Do not use the method groupBox->setTitle() any more once the add-on i...
DoubleDescriptor abundance() const
SelectionDescriptor< RotationItem * > rotation()
Returns selection descriptor for rotation methods.
VectorDescriptor positionVector() const
void enableStructureEditing(bool b)
void showShellInRealSpace()
SampleEditorController * m_ec
void onShellComboChanged()
ParticleCoreShellItem * coreShellItem() const
void showCoreInRealSpace()
ParticleCoreShellItem * m_item
ParticleCoreShellForm(QWidget *parent, ParticleCoreShellItem *item, SampleEditorController *ec, bool allowRemove=true)
void onCoreComboChanged()
void createShellWidgets()
ParticleItem * shell() const
ParticleItem * core() const
FormFactorItem * formfactor_at_bottom() const
Class to modify a sample from the layer oriented sample editor.
void setCoreFormFactor(ParticleCoreShellForm *widget, FormFactorItemCatalog::Type type)
void requestViewInRealSpace(SampleItem item)
void setShellFormFactor(ParticleCoreShellForm *widget, FormFactorItemCatalog::Type type)
void removeParticle(ItemWithParticles *item)
static void install(QObject *obj)
QComboBox * formfactorCombo
std::unique_ptr< FormLayouter > layouter
GroupBoxCollapser * collapser