2015-08-06 16:01:56 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
2015-08-14 09:45:57 +02:00
|
|
|
// Copyright (C) 2015- Statoil ASA
|
|
|
|
|
// Copyright (C) 2015- Ceetron Solutions AS
|
2015-08-06 16:01:56 +02:00
|
|
|
//
|
2015-08-14 09:45:57 +02:00
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
2015-08-06 16:01:56 +02:00
|
|
|
// 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.
|
|
|
|
|
//
|
2015-08-14 09:45:57 +02:00
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
2015-08-06 16:01:56 +02:00
|
|
|
// 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>
|
|
|
|
|
// for more details.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
#include "RicRangeFilterNewExec.h"
|
|
|
|
|
|
|
|
|
|
#include "RimCellRangeFilter.h"
|
|
|
|
|
#include "RimCellRangeFilterCollection.h"
|
2015-08-06 16:17:23 +02:00
|
|
|
#include "RimView.h"
|
2015-08-13 23:47:04 +02:00
|
|
|
#include "RiuMainWindow.h"
|
2015-08-06 16:01:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-08-20 18:15:58 +02:00
|
|
|
RicRangeFilterNewExec::RicRangeFilterNewExec(RimCellRangeFilterCollection* rangeFilterCollection, RimCellRangeFilter* rangeFilter)
|
|
|
|
|
: RicRangeFilterExecImpl(rangeFilterCollection, rangeFilter)
|
2015-08-06 16:01:56 +02:00
|
|
|
{
|
2015-08-07 09:13:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
RicRangeFilterNewExec::~RicRangeFilterNewExec()
|
|
|
|
|
{
|
2015-08-06 16:01:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
QString RicRangeFilterNewExec::name()
|
|
|
|
|
{
|
2015-08-06 20:54:29 +02:00
|
|
|
if (m_iSlice)
|
2015-08-07 08:37:29 +02:00
|
|
|
return "Create I Slice Filter";
|
2015-08-06 20:54:29 +02:00
|
|
|
else if (m_jSlice)
|
2015-08-07 08:37:29 +02:00
|
|
|
return "Create J Slice Filter";
|
2015-08-06 20:54:29 +02:00
|
|
|
else if (m_kSlice)
|
2015-08-07 08:37:29 +02:00
|
|
|
return "Create K Slice Filter";
|
2015-08-06 20:54:29 +02:00
|
|
|
|
2015-08-07 08:37:29 +02:00
|
|
|
return "Create Range Filter";
|
2015-08-06 16:01:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RicRangeFilterNewExec::redo()
|
|
|
|
|
{
|
2015-08-20 18:15:58 +02:00
|
|
|
RimCellRangeFilter* rangeFilter = createRangeFilter();
|
|
|
|
|
if (rangeFilter)
|
2015-08-06 16:01:56 +02:00
|
|
|
{
|
2015-08-20 18:15:58 +02:00
|
|
|
m_cellRangeFilterCollection->rangeFilters.push_back(rangeFilter);
|
2015-08-06 16:01:56 +02:00
|
|
|
|
2015-08-20 18:15:58 +02:00
|
|
|
rangeFilter->setDefaultValues();
|
2015-08-23 17:40:00 +02:00
|
|
|
applyCommandDataOnFilter(rangeFilter);
|
2015-08-07 08:37:29 +02:00
|
|
|
|
2015-10-19 12:10:18 +02:00
|
|
|
m_cellRangeFilterCollection->updateDisplayModeNotifyManagedViews(NULL);
|
2015-08-06 16:17:23 +02:00
|
|
|
|
2015-08-20 18:15:58 +02:00
|
|
|
m_cellRangeFilterCollection->updateConnectedEditors();
|
2015-08-13 23:47:04 +02:00
|
|
|
|
2015-12-07 10:07:51 +01:00
|
|
|
RiuMainWindow::instance()->selectAsCurrentItem(rangeFilter);
|
2015-08-20 18:15:58 +02:00
|
|
|
}
|
2015-08-06 16:01:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RicRangeFilterNewExec::undo()
|
|
|
|
|
{
|
2015-08-20 18:15:58 +02:00
|
|
|
assert(m_cellRangeFilterCollection);
|
2015-08-06 16:01:56 +02:00
|
|
|
|
2015-08-20 18:15:58 +02:00
|
|
|
m_cellRangeFilterCollection->rangeFilters.erase(m_cellRangeFilterCollection->rangeFilters.size() - 1);
|
2015-08-06 16:01:56 +02:00
|
|
|
|
2015-10-19 12:10:18 +02:00
|
|
|
m_cellRangeFilterCollection->updateDisplayModeNotifyManagedViews(NULL);
|
2015-08-12 11:10:10 +02:00
|
|
|
|
2015-08-20 18:15:58 +02:00
|
|
|
m_cellRangeFilterCollection->updateConnectedEditors();
|
2015-08-06 16:01:56 +02:00
|
|
|
}
|