Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
0efd9c7f
Commit
0efd9c7f
authored
3 years ago
by
Matthias Puchner
Browse files
Options
Downloads
Patches
Plain Diff
free ParticleCoreShellForm from SessionItem
parent
766e36ea
No related branches found
Branches containing commit
No related tags found
1 merge request
!570
remove SessionModel/Item from SampleModel and all related items
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
GUI/View/SampleDesigner/ParticleCoreShellForm.cpp
+12
-20
12 additions, 20 deletions
GUI/View/SampleDesigner/ParticleCoreShellForm.cpp
with
12 additions
and
20 deletions
GUI/View/SampleDesigner/ParticleCoreShellForm.cpp
+
12
−
20
View file @
0efd9c7f
...
...
@@ -13,6 +13,7 @@
// ************************************************************************************************
#include
"GUI/View/SampleDesigner/ParticleCoreShellForm.h"
#include
"GUI/Model/Sample/FormFactorItemCatalog.h"
#include
"GUI/Model/Sample/FormFactorItems.h"
#include
"GUI/Model/Sample/ParticleCoreShellItem.h"
#include
"GUI/Model/Sample/ParticleItem.h"
...
...
@@ -22,7 +23,6 @@
#include
"GUI/View/SampleDesigner/SampleEditorController.h"
#include
"GUI/View/SampleDesigner/SelectionContainerForm.h"
#include
"GUI/View/Tool/GroupBoxCollapser.h"
#include
<QAction>
#include
<QComboBox>
#include
<memory>
...
...
@@ -31,21 +31,17 @@ namespace {
QComboBox
*
createFormFactorCombo
(
QWidget
*
parent
,
FormFactorItem
*
current
)
{
ASSERT
(
current
);
auto
*
combo
=
new
QComboBox
(
parent
);
WheelEventEater
::
install
(
combo
);
combo
->
setSizePolicy
(
QSizePolicy
::
Minimum
,
QSizePolicy
::
Fixed
);
combo
->
addItem
(
QIcon
(),
"None"
,
""
);
for
(
const
auto
&
modelType
:
ItemCatalog
::
formfactorTypes
())
{
const
auto
ui
=
ItemCatalog
::
instance
().
uiInfo
(
modelType
);
combo
->
addItem
(
QIcon
(
ui
.
iconPath
),
ui
.
menuEntry
,
modelType
);
for
(
const
auto
type
:
FormFactorItemCatalog
::
types
())
{
const
auto
ui
=
FormFactorItemCatalog
::
uiInfo
(
type
);
combo
->
addItem
(
QIcon
(
ui
.
iconPath
),
ui
.
menuEntry
,
(
uint8_t
)
type
);
}
combo
->
setMaxVisibleItems
(
combo
->
count
());
if
(
current
==
nullptr
)
combo
->
setCurrentIndex
(
0
);
else
combo
->
setCurrentIndex
(
combo
->
findData
(
current
->
modelType
()));
combo
->
setCurrentIndex
(
combo
->
findData
((
uint8_t
)
FormFactorItemCatalog
::
type
(
current
)));
return
combo
;
}
...
...
@@ -131,8 +127,8 @@ void ParticleCoreShellForm::onCoreComboChanged()
while
(
core
.
layouter
->
layout
()
->
rowCount
()
>
1
)
core
.
layouter
->
layout
()
->
removeRow
(
1
);
const
QString
newClassName
=
core
.
formfactorCombo
->
currentData
().
to
String
();
m_ec
->
setCoreFormFactor
(
this
,
newClassNam
e
);
const
auto
type
=
(
FormFactorItemCatalog
::
Type
)
core
.
formfactorCombo
->
currentData
().
to
UInt
();
m_ec
->
setCoreFormFactor
(
this
,
typ
e
);
}
void
ParticleCoreShellForm
::
onShellComboChanged
()
...
...
@@ -140,8 +136,8 @@ void ParticleCoreShellForm::onShellComboChanged()
while
(
shell
.
layouter
->
layout
()
->
rowCount
()
>
1
)
shell
.
layouter
->
layout
()
->
removeRow
(
1
);
const
QString
newClassName
=
shell
.
formfactorCombo
->
currentData
().
to
String
();
m_ec
->
setShellFormFactor
(
this
,
newClassNam
e
);
const
auto
type
=
(
FormFactorItemCatalog
::
Type
)
shell
.
formfactorCombo
->
currentData
().
to
UInt
();
m_ec
->
setShellFormFactor
(
this
,
typ
e
);
}
void
ParticleCoreShellForm
::
showCoreInRealSpace
()
...
...
@@ -161,9 +157,7 @@ void ParticleCoreShellForm::createCoreWidgets()
QString
groupTitle
=
"Core"
;
if
(
ParticleItem
*
particle
=
m_item
->
core
())
{
const
QString
formfactor
=
particle
->
formfactorItem
()
->
value
().
value
<
ComboProperty
>
().
getValue
();
const
QString
formfactor
=
FormFactorItemCatalog
::
menuEntry
(
particle
->
formfactor
());
groupTitle
+=
" ("
+
formfactor
+
")"
;
core
.
layouter
->
addGroupOfValues
(
"Geometry"
,
particle
->
formfactor
()
->
geometryValues
());
...
...
@@ -180,9 +174,7 @@ void ParticleCoreShellForm::createShellWidgets()
QString
groupTitle
=
"Shell"
;
if
(
ParticleItem
*
particle
=
m_item
->
shell
())
{
const
QString
formfactor
=
particle
->
formfactorItem
()
->
value
().
value
<
ComboProperty
>
().
getValue
();
const
QString
formfactor
=
FormFactorItemCatalog
::
menuEntry
(
particle
->
formfactor
());
groupTitle
+=
" ("
+
formfactor
+
")"
;
shell
.
layouter
->
addGroupOfValues
(
"Geometry"
,
particle
->
formfactor
()
->
geometryValues
());
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment