mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2392 3D View Context command: "Color Result"
This commit is contained in:
parent
c6846f0d57
commit
cf3a1ad43f
@ -35,6 +35,7 @@ ${CEE_CURRENT_LIST_DIR}RicNewSliceRangeFilterFeature.h
|
|||||||
${CEE_CURRENT_LIST_DIR}RicHideIntersectionFeature.h
|
${CEE_CURRENT_LIST_DIR}RicHideIntersectionFeature.h
|
||||||
${CEE_CURRENT_LIST_DIR}RicHideIntersectionBoxFeature.h
|
${CEE_CURRENT_LIST_DIR}RicHideIntersectionBoxFeature.h
|
||||||
${CEE_CURRENT_LIST_DIR}RicImportElementPropertyFeature.h
|
${CEE_CURRENT_LIST_DIR}RicImportElementPropertyFeature.h
|
||||||
|
${CEE_CURRENT_LIST_DIR}RicSelectColorResult.h
|
||||||
|
|
||||||
${CEE_CURRENT_LIST_DIR}RicWellLogsImportFileFeature.h
|
${CEE_CURRENT_LIST_DIR}RicWellLogsImportFileFeature.h
|
||||||
|
|
||||||
@ -118,6 +119,7 @@ ${CEE_CURRENT_LIST_DIR}RicNewSliceRangeFilterFeature.cpp
|
|||||||
${CEE_CURRENT_LIST_DIR}RicHideIntersectionFeature.cpp
|
${CEE_CURRENT_LIST_DIR}RicHideIntersectionFeature.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RicHideIntersectionBoxFeature.cpp
|
${CEE_CURRENT_LIST_DIR}RicHideIntersectionBoxFeature.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RicImportElementPropertyFeature.cpp
|
${CEE_CURRENT_LIST_DIR}RicImportElementPropertyFeature.cpp
|
||||||
|
${CEE_CURRENT_LIST_DIR}RicSelectColorResult.cpp
|
||||||
|
|
||||||
${CEE_CURRENT_LIST_DIR}RicTogglePerspectiveViewFeature.cpp
|
${CEE_CURRENT_LIST_DIR}RicTogglePerspectiveViewFeature.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RicImportGeoMechCaseFeature.cpp
|
${CEE_CURRENT_LIST_DIR}RicImportGeoMechCaseFeature.cpp
|
||||||
|
72
ApplicationCode/Commands/RicSelectColorResult.cpp
Normal file
72
ApplicationCode/Commands/RicSelectColorResult.cpp
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2018- 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>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "RicSelectColorResult.h"
|
||||||
|
|
||||||
|
#include "RiaApplication.h"
|
||||||
|
#include "RicWellLogTools.h"
|
||||||
|
#include "RimEclipseCellColors.h"
|
||||||
|
#include "RimEclipseView.h"
|
||||||
|
#include "RimGeoMechCellColors.h"
|
||||||
|
#include "RimGeoMechView.h"
|
||||||
|
#include "RimGridView.h"
|
||||||
|
#include "RiuMainWindow.h"
|
||||||
|
|
||||||
|
#include <QAction>
|
||||||
|
|
||||||
|
CAF_CMD_SOURCE_INIT(RicSelectColorResult, "RicSelectColorResult");
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicSelectColorResult::setupActionLook(QAction* actionToSetup)
|
||||||
|
{
|
||||||
|
actionToSetup->setText("Color Result");
|
||||||
|
actionToSetup->setIcon(QIcon(":/CellResult.png"));
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RicSelectColorResult::isCommandEnabled()
|
||||||
|
{
|
||||||
|
if (RicWellLogTools::isWellPathOrSimWellSelectedInView()) return false;
|
||||||
|
|
||||||
|
return RiaApplication::instance()->activeGridView() != nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicSelectColorResult::onActionTriggered(bool isChecked)
|
||||||
|
{
|
||||||
|
RimGridView* activeView = RiaApplication::instance()->activeGridView();
|
||||||
|
|
||||||
|
RimEclipseView* eclView = dynamic_cast<RimEclipseView*>(activeView);
|
||||||
|
if (eclView)
|
||||||
|
{
|
||||||
|
RiuMainWindow::instance()->selectAsCurrentItem(eclView->cellResult());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
RimGeoMechView* geoMechView = dynamic_cast<RimGeoMechView*>(activeView);
|
||||||
|
if (geoMechView)
|
||||||
|
{
|
||||||
|
RiuMainWindow::instance()->selectAsCurrentItem(geoMechView->cellResult());
|
||||||
|
}
|
||||||
|
}
|
34
ApplicationCode/Commands/RicSelectColorResult.h
Normal file
34
ApplicationCode/Commands/RicSelectColorResult.h
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2018- 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>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "cafCmdFeature.h"
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
///
|
||||||
|
//==================================================================================================
|
||||||
|
class RicSelectColorResult : public caf::CmdFeature
|
||||||
|
{
|
||||||
|
CAF_CMD_HEADER_INIT;
|
||||||
|
|
||||||
|
private:
|
||||||
|
virtual bool isCommandEnabled() override;
|
||||||
|
virtual void onActionTriggered(bool isChecked) override;
|
||||||
|
virtual void setupActionLook(QAction* actionToSetup) override;
|
||||||
|
};
|
@ -421,6 +421,7 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
|
|||||||
menuBuilder << "RicShowFlowCharacteristicsPlotFeature";
|
menuBuilder << "RicShowFlowCharacteristicsPlotFeature";
|
||||||
menuBuilder << "RicSaveEclipseInputActiveVisibleCellsFeature";
|
menuBuilder << "RicSaveEclipseInputActiveVisibleCellsFeature";
|
||||||
menuBuilder << "RicShowGridStatisticsFeature";
|
menuBuilder << "RicShowGridStatisticsFeature";
|
||||||
|
menuBuilder << "RicSelectColorResult";
|
||||||
|
|
||||||
menuBuilder.appendToMenu(&menu);
|
menuBuilder.appendToMenu(&menu);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user