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
931be650
Commit
931be650
authored
7 months ago
by
Mikhail Svechnikov
Browse files
Options
Downloads
Patches
Plain Diff
upd RoughnessModelCatalog
parent
ee2c2a4a
No related branches found
No related tags found
1 merge request
!2704
Serialize RoughnessModel in GUI
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/Model/Sample/RoughnessCatalog.cpp
+7
-7
7 additions, 7 deletions
GUI/Model/Sample/RoughnessCatalog.cpp
GUI/Model/Sample/RoughnessCatalog.h
+3
-3
3 additions, 3 deletions
GUI/Model/Sample/RoughnessCatalog.h
with
10 additions
and
10 deletions
GUI/Model/Sample/RoughnessCatalog.cpp
+
7
−
7
View file @
931be650
...
...
@@ -15,7 +15,7 @@
#include
"GUI/Model/Sample/RoughnessCatalog.h"
#include
"Base/Util/Assert.h"
#include
"GUI/Model/Sample/RoughnessItems.h"
#include
"
Sample/Interfac
e/RoughnessModels.h"
#include
"
GUI/Model/Sampl
e/RoughnessModel
Item
s.h"
RoughnessItem
*
RoughnessCatalog
::
create
(
Type
type
)
{
...
...
@@ -57,13 +57,13 @@ RoughnessCatalog::Type RoughnessCatalog::type(const RoughnessItem* item)
//--------------------------------------------------------------------------
RoughnessModel
*
RoughnessModelCatalog
::
create
(
Type
type
)
RoughnessModel
Item
*
RoughnessModelCatalog
::
create
(
Type
type
)
{
switch
(
type
)
{
case
Type
::
Erf
:
return
new
ErfRoughness
();
return
new
ErfRoughness
Item
();
case
Type
::
Tanh
:
return
new
TanhRoughness
();
return
new
TanhRoughness
Item
();
}
ASSERT_NEVER
;
}
...
...
@@ -84,12 +84,12 @@ UiInfo RoughnessModelCatalog::uiInfo(Type type)
ASSERT_NEVER
;
}
RoughnessModelCatalog
::
Type
RoughnessModelCatalog
::
type
(
const
RoughnessModel
*
model
)
RoughnessModelCatalog
::
Type
RoughnessModelCatalog
::
type
(
const
RoughnessModel
Item
*
model
)
{
if
(
dynamic_cast
<
const
ErfRoughness
*>
(
model
))
if
(
dynamic_cast
<
const
ErfRoughness
Item
*>
(
model
))
return
Type
::
Erf
;
if
(
dynamic_cast
<
const
TanhRoughness
*>
(
model
))
if
(
dynamic_cast
<
const
TanhRoughness
Item
*>
(
model
))
return
Type
::
Tanh
;
ASSERT_NEVER
;
...
...
This diff is collapsed.
Click to expand it.
GUI/Model/Sample/RoughnessCatalog.h
+
3
−
3
View file @
931be650
...
...
@@ -19,7 +19,7 @@
#include
<QVector>
class
RoughnessItem
;
class
RoughnessModel
;
class
RoughnessModel
Item
;
class
RoughnessCatalog
{
public:
...
...
@@ -47,7 +47,7 @@ public:
enum
class
Type
:
uint8_t
{
Erf
=
0
,
Tanh
=
1
};
//! Creates the item of the given type.
static
RoughnessModel
*
create
(
Type
type
);
static
RoughnessModel
Item
*
create
(
Type
type
);
//! List of available types, sorted as expected in the UI.
static
QVector
<
Type
>
types
();
...
...
@@ -56,7 +56,7 @@ public:
static
UiInfo
uiInfo
(
Type
t
);
//! Returns the enum type of the given item.
static
Type
type
(
const
RoughnessModel
*
model
);
static
Type
type
(
const
RoughnessModel
Item
*
model
);
};
#endif // BORNAGAIN_GUI_MODEL_SAMPLE_ROUGHNESSCATALOG_H
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