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
0aebfd7c
Commit
0aebfd7c
authored
7 months ago
by
Mikhail Svechnikov
Browse files
Options
Downloads
Patches
Plain Diff
add RoughnessModelCatalog
parent
6f655bb8
No related branches found
No related tags found
1 merge request
!2703
Allow changing roughness height statistics in GUI
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
GUI/Model/Sample/RoughnessCatalog.cpp
+41
-0
41 additions, 0 deletions
GUI/Model/Sample/RoughnessCatalog.cpp
GUI/Model/Sample/RoughnessCatalog.h
+21
-0
21 additions, 0 deletions
GUI/Model/Sample/RoughnessCatalog.h
GUI/View/Sample/RoughnessForm.cpp
+2
-56
2 additions, 56 deletions
GUI/View/Sample/RoughnessForm.cpp
with
64 additions
and
56 deletions
GUI/Model/Sample/RoughnessCatalog.cpp
+
41
−
0
View file @
0aebfd7c
...
...
@@ -15,6 +15,7 @@
#include
"GUI/Model/Sample/RoughnessCatalog.h"
#include
"Base/Util/Assert.h"
#include
"GUI/Model/Sample/RoughnessItems.h"
#include
"Sample/Interface/RoughnessModels.h"
RoughnessItem
*
RoughnessCatalog
::
create
(
Type
type
)
{
...
...
@@ -53,3 +54,43 @@ RoughnessCatalog::Type RoughnessCatalog::type(const RoughnessItem* item)
ASSERT_NEVER
;
}
//--------------------------------------------------------------------------
RoughnessModel
*
RoughnessModelCatalog
::
create
(
Type
type
)
{
switch
(
type
)
{
case
Type
::
Erf
:
return
new
ErfRoughness
();
case
Type
::
Tanh
:
return
new
TanhRoughness
();
}
ASSERT_NEVER
;
}
QVector
<
RoughnessModelCatalog
::
Type
>
RoughnessModelCatalog
::
types
()
{
return
{
Type
::
Erf
,
Type
::
Tanh
};
}
UiInfo
RoughnessModelCatalog
::
uiInfo
(
Type
type
)
{
switch
(
type
)
{
case
Type
::
Erf
:
return
{
"Erf"
,
"Laterally averaged depth profile is Erf function"
,
""
};
case
Type
::
Tanh
:
return
{
"Tanh"
,
"Laterally averaged depth profile is Tanh function"
,
""
};
}
ASSERT_NEVER
;
}
RoughnessModelCatalog
::
Type
RoughnessModelCatalog
::
type
(
const
RoughnessModel
*
model
)
{
if
(
dynamic_cast
<
const
ErfRoughness
*>
(
model
))
return
Type
::
Erf
;
if
(
dynamic_cast
<
const
TanhRoughness
*>
(
model
))
return
Type
::
Tanh
;
ASSERT_NEVER
;
}
This diff is collapsed.
Click to expand it.
GUI/Model/Sample/RoughnessCatalog.h
+
21
−
0
View file @
0aebfd7c
...
...
@@ -19,6 +19,7 @@
#include
<QVector>
class
RoughnessItem
;
class
RoughnessModel
;
class
RoughnessCatalog
{
public:
...
...
@@ -38,4 +39,24 @@ public:
static
Type
type
(
const
RoughnessItem
*
item
);
};
//--------------------------------------------------------------------------
class
RoughnessModelCatalog
{
public:
// Do not change the numbering! It is serialized!
enum
class
Type
:
uint8_t
{
Erf
=
0
,
Tanh
=
1
};
//! Creates the item of the given type.
static
RoughnessModel
*
create
(
Type
type
);
//! List of available types, sorted as expected in the UI.
static
QVector
<
Type
>
types
();
//! UiInfo on the given type.
static
UiInfo
uiInfo
(
Type
t
);
//! Returns the enum type of the given item.
static
Type
type
(
const
RoughnessModel
*
model
);
};
#endif // BORNAGAIN_GUI_MODEL_SAMPLE_ROUGHNESSCATALOG_H
This diff is collapsed.
Click to expand it.
GUI/View/Sample/RoughnessForm.cpp
+
2
−
56
View file @
0aebfd7c
...
...
@@ -58,61 +58,7 @@ void RoughnessForm::createRoughnessWidgets()
{
RoughnessItem
*
roughness
=
m_rs
.
certainItem
();
if
(
auto
*
rsi
=
dynamic_cast
<
BasicRoughnessItem
*>
(
roughness
))
{
if
(
auto
*
rsi
=
dynamic_cast
<
BasicRoughnessItem
*>
(
roughness
))
m_layout
->
addGroupOfValues
(
"Parameters"
,
rsi
->
roughnessProperties
());
// m_layout->addValue(itf->positionVariance());
// m_layout->addValue(itf->length());
// m_layout->addValue(itf->rotationAngle());
// m_layout->addSelection(itf->decayFunctionSelection());
}
// else if (auto* itf = dynamic_cast<InterferenceRadialParacrystalItem*>(interference)) {
// m_layout->addValue(itf->positionVariance());
// m_layout->addValue(itf->peakDistance());
// m_layout->addValue(itf->dampingLength());
// m_layout->addValue(itf->domainSize());
// m_layout->addValue(itf->kappa());
// m_layout->addSelection(itf->probabilityDistributionSelection());
// } else if (auto* itf = dynamic_cast<InterferenceHardDiskItem*>(interference)) {
// m_layout->addValue(itf->positionVariance());
// m_layout->addValue(itf->radius());
// addDensityRelatedValue(itf->density());
// } else if (auto* itf = dynamic_cast<Interference2DLatticeItem*>(interference)) {
// m_layout->addValue(itf->positionVariance());
// auto* w = new LatticeTypeSelectionForm(this, itf, m_ec);
// m_layout->addBoldRow(itf->latticeTypeSelection().piLabel(), w);
// m_layout->addSelection(itf->decayFunctionSelection());
// } else if (auto* itf = dynamic_cast<InterferenceFinite2DLatticeItem*>(interference)) {
// m_layout->addValue(itf->positionVariance());
// m_layout->addBoldRow("Domain size 1:",
// GUI::Util::createIntSpinBox([itf] { return itf->domainSize1(); },
// [itf](int v) {
// itf->setDomainSize1(v);
// emit gDoc->sampleChanged();
// },
// RealLimits::lowerLimited(1),
// "Domain size 1 in number of unit
// cells"));
// m_layout->addBoldRow("Domain size 2:",
// GUI::Util::createIntSpinBox([itf] { return itf->domainSize2(); },
// [itf](int v) {
// itf->setDomainSize2(v);
// emit gDoc->sampleChanged();
// },
// RealLimits::lowerLimited(1),
// "Domain size 2 in number of unit
// cells"));
// auto* w = new LatticeTypeSelectionForm(this, itf, m_ec);
// m_layout->addBoldRow(itf->latticeTypeSelection().piLabel(), w);
// } else if (auto* itf = dynamic_cast<Interference2DParacrystalItem*>(interference)) {
// m_layout->addValue(itf->positionVariance());
// m_layout->addValue(itf->dampingLength());
// m_layout->addValue(itf->domainSize1());
// m_layout->addValue(itf->domainSize2());
// auto* w = new LatticeTypeSelectionForm(this, itf, m_ec);
// m_layout->addBoldRow(itf->latticeTypeSelection().piLabel(), w);
// m_layout->addSelection(itf->probabilityDistributionSelection1());
// m_layout->addSelection(itf->probabilityDistributionSelection2());
// }
// m_layout->addGroupOfValues("Parameters", rsi->roughnessProperties());
}
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