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
cc85eacd
Commit
cc85eacd
authored
3 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
local namespace to top
parent
972e1c79
No related branches found
No related tags found
1 merge request
!226
Annotations to GUIDomainSampleVisitor and other copy edits
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
GUI/Models/GUIObjectBuilder.cpp
+39
-47
39 additions, 47 deletions
GUI/Models/GUIObjectBuilder.cpp
with
39 additions
and
47 deletions
GUI/Models/GUIObjectBuilder.cpp
+
39
−
47
View file @
cc85eacd
...
...
@@ -24,19 +24,55 @@
#include
"GUI/Models/TransformFromDomain.h"
namespace
{
GISASInstrumentItem
*
createGISASInstrumentItem
(
InstrumentModel
*
model
,
const
GISASSimulation
&
simulation
,
const
QString
&
name
);
const
QString
&
name
)
{
auto
result
=
model
->
insertItem
<
GISASInstrumentItem
>
();
result
->
setItemName
(
name
);
GUI
::
Transform
::
FromDomain
::
setGISASBeamItem
(
result
->
beamItem
(),
simulation
);
GUI
::
Transform
::
FromDomain
::
setDetector
(
result
,
simulation
);
GUI
::
Transform
::
FromDomain
::
setBackground
(
result
,
simulation
);
return
result
;
}
OffSpecularInstrumentItem
*
createOffSpecularInstrumentItem
(
InstrumentModel
*
model
,
const
OffSpecularSimulation
&
simulation
,
const
QString
&
name
);
const
QString
&
name
)
{
auto
result
=
model
->
insertItem
<
OffSpecularInstrumentItem
>
();
result
->
setItemName
(
name
);
GUI
::
Transform
::
FromDomain
::
setOffSpecularBeamItem
(
result
->
beamItem
(),
simulation
);
GUI
::
Transform
::
FromDomain
::
setDetector
(
result
,
simulation
);
GUI
::
Transform
::
FromDomain
::
setBackground
(
result
,
simulation
);
BasicAxisItem
*
axisItem
=
result
->
alphaAxis
();
ASSERT
(
axisItem
);
GUI
::
Transform
::
FromDomain
::
setAxisItem
(
axisItem
,
*
simulation
.
beamAxis
(),
1.
/
Units
::
deg
);
return
result
;
}
SpecularInstrumentItem
*
createSpecularInstrumentItem
(
InstrumentModel
*
model
,
const
SpecularSimulation
&
simulation
,
const
QString
&
name
);
const
QString
&
name
)
{
auto
result
=
model
->
insertItem
<
SpecularInstrumentItem
>
();
result
->
setItemName
(
name
);
GUI
::
Transform
::
FromDomain
::
setSpecularBeamItem
(
result
->
beamItem
(),
simulation
);
GUI
::
Transform
::
FromDomain
::
setBackground
(
result
,
simulation
);
return
result
;
}
}
// namespace
// ************************************************************************************************
// class implementation
// ************************************************************************************************
SessionItem
*
GUI
::
Model
::
ObjectBuilder
::
populateSampleModel
(
SampleModel
*
sampleModel
,
MaterialModel
*
materialModel
,
const
MultiLayer
&
sample
,
...
...
@@ -83,47 +119,3 @@ SessionItem* GUI::Model::ObjectBuilder::populateDocumentModel(DocumentModel* p_d
return
item
;
}
namespace
{
GISASInstrumentItem
*
createGISASInstrumentItem
(
InstrumentModel
*
model
,
const
GISASSimulation
&
simulation
,
const
QString
&
name
)
{
auto
result
=
model
->
insertItem
<
GISASInstrumentItem
>
();
result
->
setItemName
(
name
);
GUI
::
Transform
::
FromDomain
::
setGISASBeamItem
(
result
->
beamItem
(),
simulation
);
GUI
::
Transform
::
FromDomain
::
setDetector
(
result
,
simulation
);
GUI
::
Transform
::
FromDomain
::
setBackground
(
result
,
simulation
);
return
result
;
}
OffSpecularInstrumentItem
*
createOffSpecularInstrumentItem
(
InstrumentModel
*
model
,
const
OffSpecularSimulation
&
simulation
,
const
QString
&
name
)
{
auto
result
=
model
->
insertItem
<
OffSpecularInstrumentItem
>
();
result
->
setItemName
(
name
);
GUI
::
Transform
::
FromDomain
::
setOffSpecularBeamItem
(
result
->
beamItem
(),
simulation
);
GUI
::
Transform
::
FromDomain
::
setDetector
(
result
,
simulation
);
GUI
::
Transform
::
FromDomain
::
setBackground
(
result
,
simulation
);
BasicAxisItem
*
axisItem
=
result
->
alphaAxis
();
ASSERT
(
axisItem
);
GUI
::
Transform
::
FromDomain
::
setAxisItem
(
axisItem
,
*
simulation
.
beamAxis
(),
1.
/
Units
::
deg
);
return
result
;
}
SpecularInstrumentItem
*
createSpecularInstrumentItem
(
InstrumentModel
*
model
,
const
SpecularSimulation
&
simulation
,
const
QString
&
name
)
{
auto
result
=
model
->
insertItem
<
SpecularInstrumentItem
>
();
result
->
setItemName
(
name
);
GUI
::
Transform
::
FromDomain
::
setSpecularBeamItem
(
result
->
beamItem
(),
simulation
);
GUI
::
Transform
::
FromDomain
::
setBackground
(
result
,
simulation
);
return
result
;
}
}
// namespace
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