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
2eb5487b
Commit
2eb5487b
authored
1 year ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
format
parent
8dbd599a
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!2420
mask item owned by detector instead of data
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/View/Canvas/MaskEditorCanvas.cpp
+20
-20
20 additions, 20 deletions
GUI/View/Canvas/MaskEditorCanvas.cpp
GUI/View/Setup/MasksPanel.cpp
+1
-1
1 addition, 1 deletion
GUI/View/Setup/MasksPanel.cpp
with
21 additions
and
21 deletions
GUI/View/Canvas/MaskEditorCanvas.cpp
+
20
−
20
View file @
2eb5487b
...
@@ -39,18 +39,18 @@ Datafield* createMaskedField(const Data2DItem* data)
...
@@ -39,18 +39,18 @@ Datafield* createMaskedField(const Data2DItem* data)
MaskStack
detectorMask
;
MaskStack
detectorMask
;
if
(
const
InstrumentItem
*
ii
=
gDoc
->
instruments
()
->
currentItem
())
if
(
const
InstrumentItem
*
ii
=
gDoc
->
instruments
()
->
currentItem
())
if
(
const
MasksSet
*
s
=
ii
->
masks
())
if
(
const
MasksSet
*
s
=
ii
->
masks
())
// no longer reverse???
// no longer reverse???
for
(
const
MaskItem
*
t
:
*
s
)
{
for
(
const
MaskItem
*
t
:
*
s
)
{
if
(
t
->
isVisible
())
{
if
(
t
->
isVisible
())
{
if
(
auto
*
roiItem
=
dynamic_cast
<
const
RegionOfInterestItem
*>
(
t
))
if
(
auto
*
roiItem
=
dynamic_cast
<
const
RegionOfInterestItem
*>
(
t
))
roi
=
roiItem
->
createShape
();
roi
=
roiItem
->
createShape
();
else
{
else
{
std
::
unique_ptr
<
IShape2D
>
shape
(
t
->
createShape
());
std
::
unique_ptr
<
IShape2D
>
shape
(
t
->
createShape
());
detectorMask
.
pushMask
(
*
shape
,
t
->
maskValue
(),
false
);
detectorMask
.
pushMask
(
*
shape
,
t
->
maskValue
(),
false
);
}
}
}
}
}
}
// ROI mask has to be the last one, it can not be "unmasked" by other shapes
// ROI mask has to be the last one, it can not be "unmasked" by other shapes
if
(
roi
)
if
(
roi
)
...
@@ -161,9 +161,9 @@ void MaskEditorCanvas::onPresentationChange(bool pixelized)
...
@@ -161,9 +161,9 @@ void MaskEditorCanvas::onPresentationChange(bool pixelized)
}
}
if
(
const
InstrumentItem
*
ii
=
gDoc
->
instruments
()
->
currentItem
())
if
(
const
InstrumentItem
*
ii
=
gDoc
->
instruments
()
->
currentItem
())
if
(
const
MasksSet
*
s
=
ii
->
masks
())
if
(
const
MasksSet
*
s
=
ii
->
masks
())
for
(
MaskItem
*
t
:
*
s
)
for
(
MaskItem
*
t
:
*
s
)
t
->
setIsVisible
(
!
pixelized
&&
t
->
wasVisible
());
t
->
setIsVisible
(
!
pixelized
&&
t
->
wasVisible
());
}
}
//! Saves plot into project directory.
//! Saves plot into project directory.
...
@@ -198,11 +198,11 @@ void MaskEditorCanvas::onResetViewRequest()
...
@@ -198,11 +198,11 @@ void MaskEditorCanvas::onResetViewRequest()
void
MaskEditorCanvas
::
setZoomToROI
()
void
MaskEditorCanvas
::
setZoomToROI
()
{
{
if
(
const
InstrumentItem
*
ii
=
gDoc
->
instruments
()
->
currentItem
())
if
(
const
InstrumentItem
*
ii
=
gDoc
->
instruments
()
->
currentItem
())
if
(
const
MasksSet
*
s
=
ii
->
masks
())
if
(
const
MasksSet
*
s
=
ii
->
masks
())
if
(
auto
*
roiItem
=
s
->
regionOfInterestItem
())
{
if
(
auto
*
roiItem
=
s
->
regionOfInterestItem
())
{
m_data_item
->
setXrange
(
roiItem
->
xLow
(),
roiItem
->
xUp
());
m_data_item
->
setXrange
(
roiItem
->
xLow
(),
roiItem
->
xUp
());
m_data_item
->
setYrange
(
roiItem
->
yLow
(),
roiItem
->
yUp
());
m_data_item
->
setYrange
(
roiItem
->
yLow
(),
roiItem
->
yUp
());
}
}
}
}
void
MaskEditorCanvas
::
onEnteringColorMap
()
void
MaskEditorCanvas
::
onEnteringColorMap
()
...
...
This diff is collapsed.
Click to expand it.
GUI/View/Setup/MasksPanel.cpp
+
1
−
1
View file @
2eb5487b
...
@@ -84,7 +84,7 @@ QSize MasksPanel::minimumSizeHint() const
...
@@ -84,7 +84,7 @@ QSize MasksPanel::minimumSizeHint() const
void
MasksPanel
::
updateMasksPanel
()
void
MasksPanel
::
updateMasksPanel
()
{
{
if
(
InstrumentItem
*
ii
=
gDoc
->
instrumentsRW
()
->
currentItem
())
if
(
InstrumentItem
*
ii
=
gDoc
->
instrumentsRW
()
->
currentItem
())
m_qlistmodel
=
ii
->
masksRW
();
m_qlistmodel
=
ii
->
masksRW
();
m_qlistview
->
setModel
(
m_qlistmodel
->
model
());
m_qlistview
->
setModel
(
m_qlistmodel
->
model
());
m_qlistview
->
setSelectionMode
(
QAbstractItemView
::
ExtendedSelection
);
m_qlistview
->
setSelectionMode
(
QAbstractItemView
::
ExtendedSelection
);
...
...
This diff is collapsed.
Click to expand it.
Wuttke, Joachim
@j.wuttke
mentioned in commit
102e3fcf
·
1 year ago
mentioned in commit
102e3fcf
mentioned in commit 102e3fcfa874515ba2115ecf31b55a95f41f12af
Toggle commit list
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