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
93b28fa0
Commit
93b28fa0
authored
3 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
UnitConverter2D: delete default c'tor
parent
1ed7d105
No related branches found
No related tags found
1 merge request
!54
minor refactoring in UnitConverter context
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Device/Instrument/UnitConverter2D.cpp
+24
-24
24 additions, 24 deletions
Device/Instrument/UnitConverter2D.cpp
Device/Instrument/UnitConverter2D.h
+9
-5
9 additions, 5 deletions
Device/Instrument/UnitConverter2D.h
auto/Wrap/doxygenDevice.i
+12
-0
12 additions, 0 deletions
auto/Wrap/doxygenDevice.i
with
45 additions
and
29 deletions
Device/Instrument/UnitConverter2D.cpp
+
24
−
24
View file @
93b28fa0
...
@@ -43,6 +43,14 @@ UnitConverter2D::UnitConverter2D(const Beam& beam)
...
@@ -43,6 +43,14 @@ UnitConverter2D::UnitConverter2D(const Beam& beam)
{
{
}
}
UnitConverter2D
::
UnitConverter2D
(
const
UnitConverter2D
&
other
)
:
m_axis_data_table
(
other
.
m_axis_data_table
)
,
m_wavelength
(
other
.
m_wavelength
)
,
m_alpha_i
(
other
.
m_alpha_i
)
,
m_phi_i
(
other
.
m_phi_i
)
{
}
void
UnitConverter2D
::
addAxisData
(
std
::
string
name
,
double
min
,
double
max
,
void
UnitConverter2D
::
addAxisData
(
std
::
string
name
,
double
min
,
double
max
,
Axes
::
Units
default_units
,
size_t
nbins
)
Axes
::
Units
default_units
,
size_t
nbins
)
{
{
...
@@ -90,14 +98,6 @@ std::unique_ptr<const IAxis> UnitConverter2D::createConvertedAxis(size_t i_axis,
...
@@ -90,14 +98,6 @@ std::unique_ptr<const IAxis> UnitConverter2D::createConvertedAxis(size_t i_axis,
return
std
::
make_unique
<
FixedBinAxis
>
(
axis_name
,
axis_size
,
min
,
max
);
return
std
::
make_unique
<
FixedBinAxis
>
(
axis_name
,
axis_size
,
min
,
max
);
}
}
UnitConverter2D
::
UnitConverter2D
(
const
UnitConverter2D
&
other
)
:
m_axis_data_table
(
other
.
m_axis_data_table
)
,
m_wavelength
(
other
.
m_wavelength
)
,
m_alpha_i
(
other
.
m_alpha_i
)
,
m_phi_i
(
other
.
m_phi_i
)
{
}
void
UnitConverter2D
::
addDetectorAxis
(
const
IDetector
&
detector
,
size_t
i_axis
)
void
UnitConverter2D
::
addDetectorAxis
(
const
IDetector
&
detector
,
size_t
i_axis
)
{
{
const
auto
&
axis
=
detector
.
axis
(
i_axis
);
const
auto
&
axis
=
detector
.
axis
(
i_axis
);
...
@@ -138,6 +138,8 @@ SphericalConverter::SphericalConverter(const SphericalDetector& detector, const
...
@@ -138,6 +138,8 @@ SphericalConverter::SphericalConverter(const SphericalDetector& detector, const
addDetectorAxis
(
detector
,
1
);
addDetectorAxis
(
detector
,
1
);
}
}
SphericalConverter
::
SphericalConverter
(
const
SphericalConverter
&
other
)
:
UnitConverter2D
(
other
)
{}
SphericalConverter
::~
SphericalConverter
()
=
default
;
SphericalConverter
::~
SphericalConverter
()
=
default
;
SphericalConverter
*
SphericalConverter
::
clone
()
const
SphericalConverter
*
SphericalConverter
::
clone
()
const
...
@@ -152,8 +154,6 @@ std::vector<Axes::Units> SphericalConverter::availableUnits() const
...
@@ -152,8 +154,6 @@ std::vector<Axes::Units> SphericalConverter::availableUnits() const
return
result
;
return
result
;
}
}
SphericalConverter
::
SphericalConverter
(
const
SphericalConverter
&
other
)
:
UnitConverter2D
(
other
)
{}
double
SphericalConverter
::
calculateValue
(
size_t
i_axis
,
Axes
::
Units
units
,
double
value
)
const
double
SphericalConverter
::
calculateValue
(
size_t
i_axis
,
Axes
::
Units
units
,
double
value
)
const
{
{
switch
(
units
)
{
switch
(
units
)
{
...
@@ -210,6 +210,11 @@ RectangularConverter::RectangularConverter(const RectangularDetector& detector,
...
@@ -210,6 +210,11 @@ RectangularConverter::RectangularConverter(const RectangularDetector& detector,
m_detector_pixel
.
reset
(
detector
.
regionOfInterestPixel
());
m_detector_pixel
.
reset
(
detector
.
regionOfInterestPixel
());
}
}
RectangularConverter
::
RectangularConverter
(
const
RectangularConverter
&
other
)
:
UnitConverter2D
(
other
),
m_detector_pixel
(
other
.
m_detector_pixel
->
clone
())
{
}
RectangularConverter
::~
RectangularConverter
()
=
default
;
RectangularConverter
::~
RectangularConverter
()
=
default
;
RectangularConverter
*
RectangularConverter
::
clone
()
const
RectangularConverter
*
RectangularConverter
::
clone
()
const
...
@@ -225,11 +230,6 @@ std::vector<Axes::Units> RectangularConverter::availableUnits() const
...
@@ -225,11 +230,6 @@ std::vector<Axes::Units> RectangularConverter::availableUnits() const
return
result
;
return
result
;
}
}
RectangularConverter
::
RectangularConverter
(
const
RectangularConverter
&
other
)
:
UnitConverter2D
(
other
),
m_detector_pixel
(
other
.
m_detector_pixel
->
clone
())
{
}
double
RectangularConverter
::
calculateValue
(
size_t
i_axis
,
Axes
::
Units
units
,
double
value
)
const
double
RectangularConverter
::
calculateValue
(
size_t
i_axis
,
Axes
::
Units
units
,
double
value
)
const
{
{
if
(
units
==
Axes
::
Units
::
MM
)
if
(
units
==
Axes
::
Units
::
MM
)
...
@@ -307,6 +307,11 @@ OffSpecularConverter::OffSpecularConverter(const IDetector2D& detector, const Be
...
@@ -307,6 +307,11 @@ OffSpecularConverter::OffSpecularConverter(const IDetector2D& detector, const Be
addDetectorYAxis
(
detector
);
addDetectorYAxis
(
detector
);
}
}
OffSpecularConverter
::
OffSpecularConverter
(
const
OffSpecularConverter
&
other
)
:
UnitConverter2D
(
other
)
{
}
OffSpecularConverter
::~
OffSpecularConverter
()
=
default
;
OffSpecularConverter
::~
OffSpecularConverter
()
=
default
;
OffSpecularConverter
*
OffSpecularConverter
::
clone
()
const
OffSpecularConverter
*
OffSpecularConverter
::
clone
()
const
...
@@ -319,11 +324,6 @@ Axes::Units OffSpecularConverter::defaultUnits() const
...
@@ -319,11 +324,6 @@ Axes::Units OffSpecularConverter::defaultUnits() const
return
Axes
::
Units
::
DEGREES
;
return
Axes
::
Units
::
DEGREES
;
}
}
OffSpecularConverter
::
OffSpecularConverter
(
const
OffSpecularConverter
&
other
)
:
UnitConverter2D
(
other
)
{
}
double
OffSpecularConverter
::
calculateValue
(
size_t
,
Axes
::
Units
units
,
double
value
)
const
double
OffSpecularConverter
::
calculateValue
(
size_t
,
Axes
::
Units
units
,
double
value
)
const
{
{
switch
(
units
)
{
switch
(
units
)
{
...
@@ -388,6 +388,10 @@ DepthProbeConverter::DepthProbeConverter(const Beam& beam, const IAxis& alpha_ax
...
@@ -388,6 +388,10 @@ DepthProbeConverter::DepthProbeConverter(const Beam& beam, const IAxis& alpha_ax
z_axis
.
size
());
z_axis
.
size
());
}
}
DepthProbeConverter
::
DepthProbeConverter
(
const
DepthProbeConverter
&
other
)
:
UnitConverter2D
(
other
)
{
}
DepthProbeConverter
::~
DepthProbeConverter
()
=
default
;
DepthProbeConverter
::~
DepthProbeConverter
()
=
default
;
DepthProbeConverter
*
DepthProbeConverter
::
clone
()
const
DepthProbeConverter
*
DepthProbeConverter
::
clone
()
const
...
@@ -402,10 +406,6 @@ std::vector<Axes::Units> DepthProbeConverter::availableUnits() const
...
@@ -402,10 +406,6 @@ std::vector<Axes::Units> DepthProbeConverter::availableUnits() const
return
result
;
return
result
;
}
}
DepthProbeConverter
::
DepthProbeConverter
(
const
DepthProbeConverter
&
other
)
:
UnitConverter2D
(
other
)
{
}
double
DepthProbeConverter
::
calculateValue
(
size_t
i_axis
,
Axes
::
Units
units
,
double
value
)
const
double
DepthProbeConverter
::
calculateValue
(
size_t
i_axis
,
Axes
::
Units
units
,
double
value
)
const
{
{
checkUnits
(
units
);
checkUnits
(
units
);
...
...
This diff is collapsed.
Click to expand it.
Device/Instrument/UnitConverter2D.h
+
9
−
5
View file @
93b28fa0
...
@@ -87,8 +87,8 @@ private:
...
@@ -87,8 +87,8 @@ private:
class
SphericalConverter
:
public
UnitConverter2D
{
class
SphericalConverter
:
public
UnitConverter2D
{
public:
public:
SphericalConverter
()
=
delete
;
SphericalConverter
(
const
SphericalDetector
&
detector
,
const
Beam
&
beam
);
SphericalConverter
(
const
SphericalDetector
&
detector
,
const
Beam
&
beam
);
~
SphericalConverter
()
override
;
~
SphericalConverter
()
override
;
SphericalConverter
*
clone
()
const
override
;
SphericalConverter
*
clone
()
const
override
;
...
@@ -99,7 +99,7 @@ public:
...
@@ -99,7 +99,7 @@ public:
Axes
::
Units
defaultUnits
()
const
override
{
return
Axes
::
Units
::
DEGREES
;
}
Axes
::
Units
defaultUnits
()
const
override
{
return
Axes
::
Units
::
DEGREES
;
}
private
:
private
:
SphericalConverter
(
const
SphericalConverter
&
other
);
SphericalConverter
(
const
SphericalConverter
&
other
);
//!< used by clone()
double
calculateValue
(
size_t
i_axis
,
Axes
::
Units
units
,
double
value
)
const
override
;
double
calculateValue
(
size_t
i_axis
,
Axes
::
Units
units
,
double
value
)
const
override
;
std
::
vector
<
std
::
map
<
Axes
::
Units
,
std
::
string
>>
createNameMaps
()
const
override
;
std
::
vector
<
std
::
map
<
Axes
::
Units
,
std
::
string
>>
createNameMaps
()
const
override
;
};
};
...
@@ -111,6 +111,7 @@ private:
...
@@ -111,6 +111,7 @@ private:
class
RectangularConverter
:
public
UnitConverter2D
{
class
RectangularConverter
:
public
UnitConverter2D
{
public:
public:
RectangularConverter
()
=
delete
;
RectangularConverter
(
const
RectangularDetector
&
detector
,
const
Beam
&
beam
);
RectangularConverter
(
const
RectangularDetector
&
detector
,
const
Beam
&
beam
);
~
RectangularConverter
()
override
;
~
RectangularConverter
()
override
;
...
@@ -122,11 +123,12 @@ public:
...
@@ -122,11 +123,12 @@ public:
Axes
::
Units
defaultUnits
()
const
override
{
return
Axes
::
Units
::
MM
;
}
Axes
::
Units
defaultUnits
()
const
override
{
return
Axes
::
Units
::
MM
;
}
private
:
private
:
RectangularConverter
(
const
RectangularConverter
&
other
);
RectangularConverter
(
const
RectangularConverter
&
other
);
//!< used by clone()
double
calculateValue
(
size_t
i_axis
,
Axes
::
Units
units
,
double
value
)
const
override
;
double
calculateValue
(
size_t
i_axis
,
Axes
::
Units
units
,
double
value
)
const
override
;
std
::
vector
<
std
::
map
<
Axes
::
Units
,
std
::
string
>>
createNameMaps
()
const
override
;
std
::
vector
<
std
::
map
<
Axes
::
Units
,
std
::
string
>>
createNameMaps
()
const
override
;
kvector_t
normalizeToWavelength
(
kvector_t
vector
)
const
;
kvector_t
normalizeToWavelength
(
kvector_t
vector
)
const
;
double
axisAngle
(
size_t
i_axis
,
kvector_t
k_f
)
const
;
double
axisAngle
(
size_t
i_axis
,
kvector_t
k_f
)
const
;
std
::
unique_ptr
<
RectangularPixel
>
m_detector_pixel
;
std
::
unique_ptr
<
RectangularPixel
>
m_detector_pixel
;
};
};
...
@@ -138,6 +140,7 @@ private:
...
@@ -138,6 +140,7 @@ private:
class
OffSpecularConverter
:
public
UnitConverter2D
{
class
OffSpecularConverter
:
public
UnitConverter2D
{
public:
public:
OffSpecularConverter
()
=
delete
;
OffSpecularConverter
(
const
IDetector2D
&
detector
,
const
Beam
&
beam
,
const
IAxis
&
alpha_axis
);
OffSpecularConverter
(
const
IDetector2D
&
detector
,
const
Beam
&
beam
,
const
IAxis
&
alpha_axis
);
~
OffSpecularConverter
()
override
;
~
OffSpecularConverter
()
override
;
...
@@ -146,7 +149,7 @@ public:
...
@@ -146,7 +149,7 @@ public:
Axes
::
Units
defaultUnits
()
const
override
;
Axes
::
Units
defaultUnits
()
const
override
;
private:
private:
OffSpecularConverter
(
const
OffSpecularConverter
&
other
);
OffSpecularConverter
(
const
OffSpecularConverter
&
other
);
//!< used by clone()
double
calculateValue
(
size_t
i_axis
,
Axes
::
Units
units
,
double
value
)
const
override
;
double
calculateValue
(
size_t
i_axis
,
Axes
::
Units
units
,
double
value
)
const
override
;
std
::
vector
<
std
::
map
<
Axes
::
Units
,
std
::
string
>>
createNameMaps
()
const
override
;
std
::
vector
<
std
::
map
<
Axes
::
Units
,
std
::
string
>>
createNameMaps
()
const
override
;
void
addDetectorYAxis
(
const
IDetector2D
&
detector
);
void
addDetectorYAxis
(
const
IDetector2D
&
detector
);
...
@@ -159,6 +162,7 @@ private:
...
@@ -159,6 +162,7 @@ private:
class
DepthProbeConverter
:
public
UnitConverter2D
{
class
DepthProbeConverter
:
public
UnitConverter2D
{
public:
public:
DepthProbeConverter
()
=
delete
;
DepthProbeConverter
(
const
Beam
&
beam
,
const
IAxis
&
alpha_axis
,
const
IAxis
&
z_axis
);
DepthProbeConverter
(
const
Beam
&
beam
,
const
IAxis
&
alpha_axis
,
const
IAxis
&
z_axis
);
~
DepthProbeConverter
()
override
;
~
DepthProbeConverter
()
override
;
...
@@ -170,7 +174,7 @@ public:
...
@@ -170,7 +174,7 @@ public:
Axes
::
Units
defaultUnits
()
const
override
{
return
Axes
::
Units
::
DEGREES
;
}
Axes
::
Units
defaultUnits
()
const
override
{
return
Axes
::
Units
::
DEGREES
;
}
private
:
private
:
DepthProbeConverter
(
const
DepthProbeConverter
&
other
);
DepthProbeConverter
(
const
DepthProbeConverter
&
other
);
//!< used by clone()
double
calculateValue
(
size_t
,
Axes
::
Units
units
,
double
value
)
const
override
;
double
calculateValue
(
size_t
,
Axes
::
Units
units
,
double
value
)
const
override
;
std
::
vector
<
std
::
map
<
Axes
::
Units
,
std
::
string
>>
createNameMaps
()
const
override
;
std
::
vector
<
std
::
map
<
Axes
::
Units
,
std
::
string
>>
createNameMaps
()
const
override
;
void
checkUnits
(
Axes
::
Units
units
)
const
;
void
checkUnits
(
Axes
::
Units
units
)
const
;
...
...
This diff is collapsed.
Click to expand it.
auto/Wrap/doxygenDevice.i
+
12
−
0
View file @
93b28fa0
...
@@ -227,6 +227,9 @@ DepthProbeConverter class handles the unit translations for depth probe simulati
...
@@ -227,6 +227,9 @@ DepthProbeConverter class handles the unit translations for depth probe simulati
C++ includes: UnitConverter2D.h
C++ includes: UnitConverter2D.h
"
;
"
;
%
feature
(
"
docstring
"
)
DepthProbeConverter
::
DepthProbeConverter
"
DepthProbeConverter::DepthProbeConverter()=delete
"
;
%
feature
(
"
docstring
"
)
DepthProbeConverter
::
DepthProbeConverter
"
DepthProbeConverter::DepthProbeConverter(const Beam &beam, const IAxis &alpha_axis, const IAxis &z_axis)
%
feature
(
"
docstring
"
)
DepthProbeConverter
::
DepthProbeConverter
"
DepthProbeConverter::DepthProbeConverter(const Beam &beam, const IAxis &alpha_axis, const IAxis &z_axis)
"
;
"
;
...
@@ -1582,6 +1585,9 @@ IUnitConverter class that handles the unit translations for off-specular simulat
...
@@ -1582,6 +1585,9 @@ IUnitConverter class that handles the unit translations for off-specular simulat
C++ includes: UnitConverter2D.h
C++ includes: UnitConverter2D.h
"
;
"
;
%
feature
(
"
docstring
"
)
OffSpecularConverter
::
OffSpecularConverter
"
OffSpecularConverter::OffSpecularConverter()=delete
"
;
%
feature
(
"
docstring
"
)
OffSpecularConverter
::
OffSpecularConverter
"
OffSpecularConverter::OffSpecularConverter(const IDetector2D &detector, const Beam &beam, const IAxis &alpha_axis)
%
feature
(
"
docstring
"
)
OffSpecularConverter
::
OffSpecularConverter
"
OffSpecularConverter::OffSpecularConverter(const IDetector2D &detector, const Beam &beam, const IAxis &alpha_axis)
"
;
"
;
...
@@ -2146,6 +2152,9 @@ IUnitConverter class that handles the unit translations for rectangular detector
...
@@ -2146,6 +2152,9 @@ IUnitConverter class that handles the unit translations for rectangular detector
C++ includes: UnitConverter2D.h
C++ includes: UnitConverter2D.h
"
;
"
;
%
feature
(
"
docstring
"
)
RectangularConverter
::
RectangularConverter
"
RectangularConverter::RectangularConverter()=delete
"
;
%
feature
(
"
docstring
"
)
RectangularConverter
::
RectangularConverter
"
RectangularConverter::RectangularConverter(const RectangularDetector &detector, const Beam &beam)
%
feature
(
"
docstring
"
)
RectangularConverter
::
RectangularConverter
"
RectangularConverter::RectangularConverter(const RectangularDetector &detector, const Beam &beam)
"
;
"
;
...
@@ -2588,6 +2597,9 @@ IUnitConverter class that handles the unit translations for spherical detectors
...
@@ -2588,6 +2597,9 @@ IUnitConverter class that handles the unit translations for spherical detectors
C++ includes: UnitConverter2D.h
C++ includes: UnitConverter2D.h
"
;
"
;
%
feature
(
"
docstring
"
)
SphericalConverter
::
SphericalConverter
"
SphericalConverter::SphericalConverter()=delete
"
;
%
feature
(
"
docstring
"
)
SphericalConverter
::
SphericalConverter
"
SphericalConverter::SphericalConverter(const SphericalDetector &detector, const Beam &beam)
%
feature
(
"
docstring
"
)
SphericalConverter
::
SphericalConverter
"
SphericalConverter::SphericalConverter(const SphericalDetector &detector, const Beam &beam)
"
;
"
;
...
...
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