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
c93a293e
Commit
c93a293e
authored
8 months ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
use it
parent
c890277d
No related branches found
No related tags found
1 merge request
!2675
simplification and renaming of catalog classes
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
GUI/Model/Beam/BeamDistributionItem.h
+4
-7
4 additions, 7 deletions
GUI/Model/Beam/BeamDistributionItem.h
GUI/Model/Detector/DetectorItem.h
+4
-7
4 additions, 7 deletions
GUI/Model/Detector/DetectorItem.h
GUI/Model/Sim/InstrumentItems.h
+5
-11
5 additions, 11 deletions
GUI/Model/Sim/InstrumentItems.h
with
13 additions
and
25 deletions
GUI/Model/Beam/BeamDistributionItem.h
+
4
−
7
View file @
c93a293e
...
...
@@ -36,7 +36,10 @@ public:
virtual
double
scaleFactor
()
const
;
template
<
typename
T
>
T
*
setDistributionItemType
();
template
<
typename
T
>
T
*
setDistributionItemType
()
{
return
m_distribution
.
createCertainItem
<
T
>
();
}
DistributionItem
*
distributionItem
()
const
{
return
m_distribution
.
certainItem
();
}
PolyItem
<
DistributionsCatalog
>&
distributionSelection
()
{
return
m_distribution
;
}
...
...
@@ -46,10 +49,4 @@ protected:
PolyItem
<
DistributionsCatalog
>
m_distribution
;
};
template
<
typename
T
>
T
*
BeamDistributionItem
::
setDistributionItemType
()
{
m_distribution
.
createCertainItem
<
T
>
();
return
dynamic_cast
<
T
*>
(
m_distribution
.
certainItem
());
}
#endif // BORNAGAIN_GUI_MODEL_BEAM_BEAMDISTRIBUTIONITEM_H
This diff is collapsed.
Click to expand it.
GUI/Model/Detector/DetectorItem.h
+
4
−
7
View file @
c93a293e
...
...
@@ -38,7 +38,10 @@ public:
return
m_resolution_function
;
}
template
<
typename
T
>
T
*
setResolutionFunctionType
();
template
<
typename
T
>
T
*
setResolutionFunctionType
()
{
return
m_resolution_function
.
createCertainItem
<
T
>
();
}
void
writeTo
(
QXmlStreamWriter
*
w
)
const
;
void
readFrom
(
QXmlStreamReader
*
r
);
...
...
@@ -63,10 +66,4 @@ private:
std
::
unique_ptr
<
MasksSet
>
m_prjns
;
//!< projections
};
template
<
typename
T
>
T
*
DetectorItem
::
setResolutionFunctionType
()
{
m_resolution_function
.
createCertainItem
<
T
>
();
return
dynamic_cast
<
T
*>
(
m_resolution_function
.
certainItem
());
}
#endif // BORNAGAIN_GUI_MODEL_DETECTOR_DETECTORITEM_H
This diff is collapsed.
Click to expand it.
GUI/Model/Sim/InstrumentItems.h
+
5
−
11
View file @
c93a293e
...
...
@@ -66,7 +66,11 @@ public:
template
<
typename
T
>
bool
is
()
const
{
return
dynamic_cast
<
const
T
*>
(
this
)
!=
nullptr
;
}
template
<
typename
T
>
T
*
setBackgroundItemType
();
template
<
typename
T
>
T
*
setBackgroundItemType
()
{
return
m_background
.
createCertainItem
<
T
>
();
}
PolyItem
<
BackgroundItemCatalog
>&
backgroundSelection
()
{
return
m_background
;
}
BackgroundItem
*
backgroundItem
()
const
{
return
m_background
.
certainItem
();
}
...
...
@@ -197,14 +201,4 @@ private:
AxisProperty
m_z_axis
;
};
// ************************************************************************************************
// templated functions implementation
// ************************************************************************************************
template
<
typename
T
>
T
*
InstrumentItem
::
setBackgroundItemType
()
{
return
m_background
.
createCertainItem
<
T
>
();
}
#endif // BORNAGAIN_GUI_MODEL_SIM_INSTRUMENTITEMS_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