2015-09-15 09:28:17 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2015- Statoil ASA
|
|
|
|
// Copyright (C) 2015- Ceetron Solutions AS
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2015-09-15 09:28:17 -05:00
|
|
|
// 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2015-09-15 09:28:17 -05:00
|
|
|
// 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2015-09-15 09:28:17 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "RicShowLinkOptionsFeature.h"
|
|
|
|
|
|
|
|
#include "RiaApplication.h"
|
2018-01-09 03:11:28 -06:00
|
|
|
#include "Rim3dView.h"
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "RimProject.h"
|
2015-10-13 03:24:11 -05:00
|
|
|
#include "RimViewController.h"
|
2015-09-15 09:28:17 -05:00
|
|
|
#include "RimViewLinker.h"
|
2018-02-27 08:21:14 -06:00
|
|
|
#include "Riu3DMainWindowTools.h"
|
2015-09-15 09:28:17 -05:00
|
|
|
|
|
|
|
#include "cafSelectionManager.h"
|
|
|
|
|
|
|
|
#include <QAction>
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_CMD_SOURCE_INIT( RicShowLinkOptionsFeature, "RicShowLinkOptionsFeature" );
|
2015-09-15 09:28:17 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-09-15 09:28:17 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RicShowLinkOptionsFeature::isCommandEnabled()
|
|
|
|
{
|
2018-01-09 03:11:28 -06:00
|
|
|
Rim3dView* activeView = RiaApplication::instance()->activeReservoirView();
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !activeView ) return false;
|
2015-09-15 09:28:17 -05:00
|
|
|
|
2015-09-25 04:01:41 -05:00
|
|
|
RimViewController* viewController = activeView->viewController();
|
2019-09-06 03:40:57 -05:00
|
|
|
|
|
|
|
if ( viewController )
|
2015-09-15 09:28:17 -05:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-09-15 09:28:17 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RicShowLinkOptionsFeature::onActionTriggered( bool isChecked )
|
2015-09-15 09:28:17 -05:00
|
|
|
{
|
2018-01-09 03:11:28 -06:00
|
|
|
Rim3dView* activeView = RiaApplication::instance()->activeReservoirView();
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !activeView ) return;
|
2015-09-15 09:28:17 -05:00
|
|
|
|
2015-09-25 04:01:41 -05:00
|
|
|
RimViewController* viewController = activeView->viewController();
|
2015-09-15 09:28:17 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
Riu3DMainWindowTools::selectAsCurrentItem( viewController );
|
2015-09-15 09:28:17 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-09-15 09:28:17 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RicShowLinkOptionsFeature::setupActionLook( QAction* actionToSetup )
|
2015-09-15 09:28:17 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
actionToSetup->setText( "Show Link Options" );
|
2015-09-15 09:28:17 -05:00
|
|
|
}
|