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
0a452a50
Commit
0a452a50
authored
1 year ago
by
Wuttke, Joachim
Committed by
Wuttke, Joachim
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
inline fcts itemXrange etc
parent
af811c76
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
GUI/View/PlotUtil/ColorMap.cpp
+10
-2
10 additions, 2 deletions
GUI/View/PlotUtil/ColorMap.cpp
GUI/View/PlotUtil/RangeUtil.cpp
+0
-23
0 additions, 23 deletions
GUI/View/PlotUtil/RangeUtil.cpp
GUI/View/PlotUtil/RangeUtil.h
+0
-6
0 additions, 6 deletions
GUI/View/PlotUtil/RangeUtil.h
with
10 additions
and
31 deletions
GUI/View/PlotUtil/ColorMap.cpp
+
10
−
2
View file @
0a452a50
...
...
@@ -31,6 +31,14 @@ const int replot_update_interval = 10;
const
int
colorbar_width_logz
=
50
;
const
int
colorbar_width
=
80
;
// Converts xmin (low edge of first bin) and xmax (upper edge of last bin) to the
// range expected by QCPColorMapData::setRange.
QCPRange
qcpRange
(
double
xmin
,
double
xmax
,
int
nbins
)
{
double
dx
=
(
xmax
-
xmin
)
/
nbins
;
return
QCPRange
(
xmin
+
dx
/
2.
,
xmax
-
dx
/
2.
);
}
}
// namespace
ColorMap
::
ColorMap
(
QWidget
*
parent
)
...
...
@@ -328,8 +336,8 @@ void ColorMap::setAxesRangeFromItem()
m_customPlot
->
setInteractions
(
QCP
::
iRangeDrag
|
QCP
::
iRangeZoom
);
m_customPlot
->
axisRect
()
->
setupFullAxesBox
(
true
);
m_colorMap
->
data
()
->
setSize
(
ii
->
xSize
(),
ii
->
ySize
());
m_colorMap
->
data
()
->
setRange
(
GUI
::
View
::
RangeUtil
::
itemXrange
(
ii
),
GUI
::
View
::
RangeUtil
::
itemYrange
(
ii
));
m_colorMap
->
data
()
->
setRange
(
qcpRange
(
ii
->
xMin
(),
ii
->
xMax
(),
ii
->
xSize
()
),
qcpRange
(
ii
->
yMin
(),
ii
->
yMax
(),
ii
->
ySize
()
));
replot
();
}
...
...
This diff is collapsed.
Click to expand it.
GUI/View/PlotUtil/RangeUtil.cpp
+
0
−
23
View file @
0a452a50
...
...
@@ -19,34 +19,11 @@
#include
"GUI/Support/Util/StyleUtil.h"
#include
<qcustomplot.h>
namespace
{
// Converts xmin (low edge of first bin) and xmax (upper edge of last bin) to the
// range expected by QCPColorMapData::setRange.
QCPRange
qcpRange
(
double
xmin
,
double
xmax
,
int
nbins
)
{
double
dx
=
(
xmax
-
xmin
)
/
nbins
;
return
QCPRange
(
xmin
+
dx
/
2.
,
xmax
-
dx
/
2.
);
}
}
// namespace
QCPRange
GUI
::
View
::
RangeUtil
::
itemXrange
(
const
IntensityDataItem
*
item
)
{
return
qcpRange
(
item
->
xMin
(),
item
->
xMax
(),
item
->
xSize
());
}
QCPRange
GUI
::
View
::
RangeUtil
::
itemZoomX
(
const
IntensityDataItem
*
item
)
{
return
QCPRange
(
item
->
lowerX
(),
item
->
upperX
());
}
QCPRange
GUI
::
View
::
RangeUtil
::
itemYrange
(
const
IntensityDataItem
*
item
)
{
return
qcpRange
(
item
->
yMin
(),
item
->
yMax
(),
item
->
ySize
());
}
QCPRange
GUI
::
View
::
RangeUtil
::
itemZoomY
(
const
IntensityDataItem
*
item
)
{
return
QCPRange
(
item
->
lowerY
(),
item
->
upperY
());
...
...
This diff is collapsed.
Click to expand it.
GUI/View/PlotUtil/RangeUtil.h
+
0
−
6
View file @
0a452a50
...
...
@@ -26,15 +26,9 @@ class QCPRange;
namespace
GUI
::
View
::
RangeUtil
{
//! Returns x-axis range.
QCPRange
itemXrange
(
const
IntensityDataItem
*
item
);
//! Returns x-axis vizible range (zoom).
QCPRange
itemZoomX
(
const
IntensityDataItem
*
item
);
//! Returns y-axis range.
QCPRange
itemYrange
(
const
IntensityDataItem
*
item
);
//! Returns y-axis vizible range (zoom).
QCPRange
itemZoomY
(
const
IntensityDataItem
*
item
);
...
...
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