#3924 Measurements : Remove double mouse click event handling

This commit is contained in:
Magne Sjaastad
2019-01-03 07:33:54 +01:00
parent 8f85e49849
commit 3543ba7cf3
5 changed files with 9 additions and 162 deletions

View File

@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016- Statoil ASA
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -21,11 +21,8 @@
#include "RiaApplication.h"
#include "Rim3dView.h"
#include "RimProject.h"
#include "RimMeasurement.h"
#include "RiuMeasurementViewEventFilter.h"
#include "RiuViewer.h"
#include "RimProject.h"
#include "cafPdmUiPropertyViewDialog.h"
#include "cafSelectionManager.h"
@@ -33,7 +30,6 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicToggleMeasurementModeFeature, "RicToggleMeasurementModeFeature");
//--------------------------------------------------------------------------------------------------
@@ -45,7 +41,7 @@ void RicToggleMeasurementModeFeature::refreshActionLook()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicToggleMeasurementModeFeature::isCommandEnabled()
{
@@ -53,34 +49,24 @@ bool RicToggleMeasurementModeFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicToggleMeasurementModeFeature::onActionTriggered(bool isChecked)
{
auto meas = measurement();
meas->setMeasurementMode(!meas->isInMeasurementMode());
refreshActionLook();
auto* view = activeView();
if (meas->isInMeasurementMode())
{
view->viewer()->installEventFilter(eventFilter(this));
}
else
{
view->viewer()->removeEventFilter(eventFilter(this));
}
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicToggleMeasurementModeFeature::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setText("Measurement Mode");
auto* meas = measurement();
if(meas && meas->isInMeasurementMode())
if (meas && meas->isInMeasurementMode())
actionToSetup->setIcon(QIcon(":/NoRuler16x16.png"));
else
actionToSetup->setIcon(QIcon(":/Ruler16x16.png"));
@@ -102,12 +88,3 @@ Rim3dView* RicToggleMeasurementModeFeature::activeView() const
auto view = RiaApplication::instance()->activeReservoirView();
return view;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiuMeasurementViewEventFilter* RicToggleMeasurementModeFeature::eventFilter(QObject* parent)
{
static auto* filter = new RiuMeasurementViewEventFilter(parent);
return filter;
}