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
Merge requests
!518
rm node visitor
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
rm node visitor
rmNodeVisitor
into
develop
Overview
0
Commits
5
Pipelines
26
Changes
1
Merged
Wuttke, Joachim
requested to merge
rmNodeVisitor
into
develop
3 years ago
Overview
0
Commits
5
Pipelines
26
Changes
1
Expand
0
0
Merge request reports
Viewing commit
7e66ae50
Show latest version
1 file
+
10
−
0
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
7e66ae50
+ deb msg in MaterialKeyHandler
· 7e66ae50
Wuttke, Joachim
authored
3 years ago
Core/Export/MaterialKeyHandler.cpp
+
10
−
0
Options
@@ -16,24 +16,34 @@
@@ -16,24 +16,34 @@
#include
"Base/Util/Assert.h"
#include
"Base/Util/Assert.h"
#include
"Sample/Material/Material.h"
#include
"Sample/Material/Material.h"
#include
<algorithm>
#include
<algorithm>
#include
<iostream>
#include
<set>
#include
<set>
#include
<stdexcept>
#include
<stdexcept>
void
MaterialKeyHandler
::
insertMaterial
(
const
Material
*
mat
)
void
MaterialKeyHandler
::
insertMaterial
(
const
Material
*
mat
)
{
{
std
::
cout
<<
"MKH 0"
<<
std
::
endl
;
ASSERT
(
mat
);
std
::
cout
<<
"MKH insert "
<<
mat
->
materialName
()
<<
std
::
endl
;
for
(
const
auto
&
it
:
m_Mat2Unique
)
for
(
const
auto
&
it
:
m_Mat2Unique
)
if
(
*
it
.
second
==
*
mat
)
{
if
(
*
it
.
second
==
*
mat
)
{
m_Mat2Unique
.
emplace
(
mat
,
it
.
second
);
m_Mat2Unique
.
emplace
(
mat
,
it
.
second
);
std
::
cout
<<
"MKH duplicate entry"
<<
std
::
endl
;
return
;
return
;
}
}
std
::
cout
<<
"MKH 1"
<<
std
::
endl
;
m_Mat2Unique
.
emplace
(
mat
,
mat
);
m_Mat2Unique
.
emplace
(
mat
,
mat
);
std
::
cout
<<
"MKH 2"
<<
std
::
endl
;
const
std
::
string
key
=
"material_"
+
mat
->
materialName
();
const
std
::
string
key
=
"material_"
+
mat
->
materialName
();
std
::
cout
<<
"MKH key = "
<<
key
<<
std
::
endl
;
if
(
m_Key2Mat
.
count
(
key
))
if
(
m_Key2Mat
.
count
(
key
))
throw
std
::
runtime_error
(
throw
std
::
runtime_error
(
"Material name "
+
mat
->
materialName
()
"Material name "
+
mat
->
materialName
()
+
" used more than once, which is not supported by Python exporter"
);
+
" used more than once, which is not supported by Python exporter"
);
std
::
cout
<<
"MKH 3"
<<
std
::
endl
;
m_Key2Mat
.
emplace
(
key
,
mat
);
m_Key2Mat
.
emplace
(
key
,
mat
);
std
::
cout
<<
"MKH 4"
<<
std
::
endl
;
}
}
const
std
::
string
&
MaterialKeyHandler
::
mat2key
(
const
Material
*
mat
)
const
const
std
::
string
&
MaterialKeyHandler
::
mat2key
(
const
Material
*
mat
)
const
Loading