Skip to content
Snippets Groups Projects
Commit 97c71a5e authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

rm member

parent cc76c45b
No related branches found
No related tags found
1 merge request!2289make mask and projection classes more similar
......@@ -77,7 +77,10 @@ void ProjectionsEditorCanvas::updateCanvas(Data2DItem* data2DItem)
m_data2DItem = data2DItem;
setColorMap(m_scene->colorMap());
setConnected(true);
m_statusLabel->reset();
m_statusLabel->addPlot(m_scene->colorMap());
onLeavingColorMap();
m_scene->onActivityChanged(m_currentActivity);
......@@ -87,7 +90,6 @@ void ProjectionsEditorCanvas::resetCanvas()
{
setConnected(false);
m_data2DItem = nullptr;
m_colorMap = nullptr;
m_scene->dissociateItems();
}
......@@ -140,41 +142,30 @@ void ProjectionsEditorCanvas::setProjectionsCanvasMode(MaskFlags::MaskMode mask_
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)
{
if (!m_colorMap)
auto* cm = m_scene->colorMap();
if (!cm)
return;
if (isConnected) {
connect(m_colorMap->eventHelper(), &PlotEventHelper::enteringPlot, this,
connect(cm->eventHelper(), &PlotEventHelper::enteringPlot, this,
&ProjectionsEditorCanvas::onEnteringColorMap, Qt::UniqueConnection);
connect(m_colorMap->eventHelper(), &PlotEventHelper::leavingPlot, this,
connect(cm->eventHelper(), &PlotEventHelper::leavingPlot, this,
&ProjectionsEditorCanvas::onLeavingColorMap, Qt::UniqueConnection);
connect(m_colorMap->eventHelper(), &PlotEventHelper::positionChanged, this,
connect(cm->eventHelper(), &PlotEventHelper::positionChanged, this,
&ProjectionsEditorCanvas::onPositionChanged, Qt::UniqueConnection);
connect(m_colorMap, &ColorMap::marginsChanged, this,
&ProjectionsEditorCanvas::marginsChanged, Qt::UniqueConnection);
connect(cm, &ColorMap::marginsChanged, this, &ProjectionsEditorCanvas::marginsChanged,
Qt::UniqueConnection);
}
else {
disconnect(m_colorMap->eventHelper(), &PlotEventHelper::enteringPlot, this,
disconnect(cm->eventHelper(), &PlotEventHelper::enteringPlot, this,
&ProjectionsEditorCanvas::onEnteringColorMap);
disconnect(m_colorMap->eventHelper(), &PlotEventHelper::leavingPlot, this,
disconnect(cm->eventHelper(), &PlotEventHelper::leavingPlot, this,
&ProjectionsEditorCanvas::onLeavingColorMap);
disconnect(m_colorMap->eventHelper(), &PlotEventHelper::positionChanged, this,
disconnect(cm->eventHelper(), &PlotEventHelper::positionChanged, this,
&ProjectionsEditorCanvas::onPositionChanged);
disconnect(m_colorMap, &ColorMap::marginsChanged, this,
&ProjectionsEditorCanvas::marginsChanged);
disconnect(cm, &ColorMap::marginsChanged, this, &ProjectionsEditorCanvas::marginsChanged);
}
}
......@@ -19,7 +19,6 @@
#include <QWidget>
#include <memory>
class ColorMap;
class Data2DItem;
class LineItem;
class MaskGraphicsScene;
......@@ -58,14 +57,12 @@ private slots:
void onPositionChanged(double x, double y);
private:
void setColorMap(ColorMap* colorMap);
void setConnected(bool isConnected);
MaskGraphicsScene* m_scene;
MaskGraphicsView* m_view;
PlotStatusLabel* m_statusLabel;
Data2DItem* m_data2DItem;
ColorMap* m_colorMap;
std::unique_ptr<LineItem> m_liveProjection; //!< temporary, matching mouse move
MaskFlags::MaskMode m_currentActivity;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment