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
97c71a5e
Commit
97c71a5e
authored
1 year ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
rm member
parent
cc76c45b
No related branches found
No related tags found
1 merge request
!2289
make mask and projection classes more similar
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/View/Canvas/ProjectionsEditorCanvas.cpp
+15
-24
15 additions, 24 deletions
GUI/View/Canvas/ProjectionsEditorCanvas.cpp
GUI/View/Canvas/ProjectionsEditorCanvas.h
+0
-3
0 additions, 3 deletions
GUI/View/Canvas/ProjectionsEditorCanvas.h
with
15 additions
and
27 deletions
GUI/View/Canvas/ProjectionsEditorCanvas.cpp
+
15
−
24
View file @
97c71a5e
...
@@ -77,7 +77,10 @@ void ProjectionsEditorCanvas::updateCanvas(Data2DItem* data2DItem)
...
@@ -77,7 +77,10 @@ void ProjectionsEditorCanvas::updateCanvas(Data2DItem* data2DItem)
m_data2DItem
=
data2DItem
;
m_data2DItem
=
data2DItem
;
setColorMap
(
m_scene
->
colorMap
());
setConnected
(
true
);
m_statusLabel
->
reset
();
m_statusLabel
->
addPlot
(
m_scene
->
colorMap
());
onLeavingColorMap
();
onLeavingColorMap
();
m_scene
->
onActivityChanged
(
m_currentActivity
);
m_scene
->
onActivityChanged
(
m_currentActivity
);
...
@@ -87,7 +90,6 @@ void ProjectionsEditorCanvas::resetCanvas()
...
@@ -87,7 +90,6 @@ void ProjectionsEditorCanvas::resetCanvas()
{
{
setConnected
(
false
);
setConnected
(
false
);
m_data2DItem
=
nullptr
;
m_data2DItem
=
nullptr
;
m_colorMap
=
nullptr
;
m_scene
->
dissociateItems
();
m_scene
->
dissociateItems
();
}
}
...
@@ -140,41 +142,30 @@ void ProjectionsEditorCanvas::setProjectionsCanvasMode(MaskFlags::MaskMode mask_
...
@@ -140,41 +142,30 @@ void ProjectionsEditorCanvas::setProjectionsCanvasMode(MaskFlags::MaskMode mask_
onLeavingColorMap
();
onLeavingColorMap
();
}
}
void
ProjectionsEditorCanvas
::
setColorMap
(
ColorMap
*
colorMap
)
{
ASSERT
(
colorMap
);
m_colorMap
=
colorMap
;
setConnected
(
true
);
m_statusLabel
->
reset
();
m_statusLabel
->
addPlot
(
colorMap
);
}
void
ProjectionsEditorCanvas
::
setConnected
(
bool
isConnected
)
void
ProjectionsEditorCanvas
::
setConnected
(
bool
isConnected
)
{
{
if
(
!
m_colorMap
)
auto
*
cm
=
m_scene
->
colorMap
();
if
(
!
cm
)
return
;
return
;
if
(
isConnected
)
{
if
(
isConnected
)
{
connect
(
m
_colorMap
->
eventHelper
(),
&
PlotEventHelper
::
enteringPlot
,
this
,
connect
(
c
m
->
eventHelper
(),
&
PlotEventHelper
::
enteringPlot
,
this
,
&
ProjectionsEditorCanvas
::
onEnteringColorMap
,
Qt
::
UniqueConnection
);
&
ProjectionsEditorCanvas
::
onEnteringColorMap
,
Qt
::
UniqueConnection
);
connect
(
m
_colorMap
->
eventHelper
(),
&
PlotEventHelper
::
leavingPlot
,
this
,
connect
(
c
m
->
eventHelper
(),
&
PlotEventHelper
::
leavingPlot
,
this
,
&
ProjectionsEditorCanvas
::
onLeavingColorMap
,
Qt
::
UniqueConnection
);
&
ProjectionsEditorCanvas
::
onLeavingColorMap
,
Qt
::
UniqueConnection
);
connect
(
m
_colorMap
->
eventHelper
(),
&
PlotEventHelper
::
positionChanged
,
this
,
connect
(
c
m
->
eventHelper
(),
&
PlotEventHelper
::
positionChanged
,
this
,
&
ProjectionsEditorCanvas
::
onPositionChanged
,
Qt
::
UniqueConnection
);
&
ProjectionsEditorCanvas
::
onPositionChanged
,
Qt
::
UniqueConnection
);
connect
(
m
_colorMap
,
&
ColorMap
::
marginsChanged
,
this
,
connect
(
c
m
,
&
ColorMap
::
marginsChanged
,
this
,
&
ProjectionsEditorCanvas
::
marginsChanged
,
&
ProjectionsEditorCanvas
::
marginsChanged
,
Qt
::
UniqueConnection
);
Qt
::
UniqueConnection
);
}
}
else
{
else
{
disconnect
(
m
_colorMap
->
eventHelper
(),
&
PlotEventHelper
::
enteringPlot
,
this
,
disconnect
(
c
m
->
eventHelper
(),
&
PlotEventHelper
::
enteringPlot
,
this
,
&
ProjectionsEditorCanvas
::
onEnteringColorMap
);
&
ProjectionsEditorCanvas
::
onEnteringColorMap
);
disconnect
(
m
_colorMap
->
eventHelper
(),
&
PlotEventHelper
::
leavingPlot
,
this
,
disconnect
(
c
m
->
eventHelper
(),
&
PlotEventHelper
::
leavingPlot
,
this
,
&
ProjectionsEditorCanvas
::
onLeavingColorMap
);
&
ProjectionsEditorCanvas
::
onLeavingColorMap
);
disconnect
(
m
_colorMap
->
eventHelper
(),
&
PlotEventHelper
::
positionChanged
,
this
,
disconnect
(
c
m
->
eventHelper
(),
&
PlotEventHelper
::
positionChanged
,
this
,
&
ProjectionsEditorCanvas
::
onPositionChanged
);
&
ProjectionsEditorCanvas
::
onPositionChanged
);
disconnect
(
m_colorMap
,
&
ColorMap
::
marginsChanged
,
this
,
disconnect
(
cm
,
&
ColorMap
::
marginsChanged
,
this
,
&
ProjectionsEditorCanvas
::
marginsChanged
);
&
ProjectionsEditorCanvas
::
marginsChanged
);
}
}
}
}
This diff is collapsed.
Click to expand it.
GUI/View/Canvas/ProjectionsEditorCanvas.h
+
0
−
3
View file @
97c71a5e
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
#include
<QWidget>
#include
<QWidget>
#include
<memory>
#include
<memory>
class
ColorMap
;
class
Data2DItem
;
class
Data2DItem
;
class
LineItem
;
class
LineItem
;
class
MaskGraphicsScene
;
class
MaskGraphicsScene
;
...
@@ -58,14 +57,12 @@ private slots:
...
@@ -58,14 +57,12 @@ private slots:
void
onPositionChanged
(
double
x
,
double
y
);
void
onPositionChanged
(
double
x
,
double
y
);
private:
private:
void
setColorMap
(
ColorMap
*
colorMap
);
void
setConnected
(
bool
isConnected
);
void
setConnected
(
bool
isConnected
);
MaskGraphicsScene
*
m_scene
;
MaskGraphicsScene
*
m_scene
;
MaskGraphicsView
*
m_view
;
MaskGraphicsView
*
m_view
;
PlotStatusLabel
*
m_statusLabel
;
PlotStatusLabel
*
m_statusLabel
;
Data2DItem
*
m_data2DItem
;
Data2DItem
*
m_data2DItem
;
ColorMap
*
m_colorMap
;
std
::
unique_ptr
<
LineItem
>
m_liveProjection
;
//!< temporary, matching mouse move
std
::
unique_ptr
<
LineItem
>
m_liveProjection
;
//!< temporary, matching mouse move
MaskFlags
::
MaskMode
m_currentActivity
;
MaskFlags
::
MaskMode
m_currentActivity
;
};
};
...
...
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