mirror of
				https://github.com/OPM/ResInsight.git
				synced 2025-02-25 18:55:39 -06:00 
			
		
		
		
	Added some new command features for the treeview context menu (WIP)
This commit is contained in:
		@@ -5,11 +5,24 @@ if (${CMAKE_VERSION} VERSION_GREATER "2.8.2")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
set (SOURCE_GROUP_HEADER_FILES
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicEclipseCaseClose.h
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicEclipseCaseCopy.h
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicEclipseCaseExecuteScript.h
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicEclipseCaseNewGroup.h
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicEclipseCaseNewView.h
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicEclipseCasePaste.h
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicEclipseCellResultSave.h
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicEclipseFaultResultSave.h
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicEclipsePropertyFilterNew.h
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicEclipseViewCopy.h
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicEclipseViewDelete.h
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicEclipseViewNew.h
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicEclipseViewPaste.h
 | 
			
		||||
#${CEE_CURRENT_LIST_DIR}RicGridModelsCreateCaseGroupFromFiles.h
 | 
			
		||||
#${CEE_CURRENT_LIST_DIR}RicGridModelsImport.h
 | 
			
		||||
#${CEE_CURRENT_LIST_DIR}RicGridModelsImportInput.h
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicRangeFilterDelete.h
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicRangeFilterInsert.h
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicRangeFilterNew.h
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicRangeFilterNewExec.h
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicRangeFilterNewSliceI.h
 | 
			
		||||
@@ -18,12 +31,24 @@ ${CEE_CURRENT_LIST_DIR}RicRangeFilterNewSliceK.h
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
set (SOURCE_GROUP_SOURCE_FILES
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicEclipseCaseClose.cpp
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicEclipseCaseCopy.cpp
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicEclipseCaseExecuteScript.cpp
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicEclipseCaseNewGroup.cpp
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicEclipseCaseNewView.cpp
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicEclipseCasePaste.cpp
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicEclipseCellResultSave.cpp
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicEclipseFaultResultSave.cpp
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicEclipsePropertyFilterNew.cpp
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicEclipseViewNew.cpp
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicEclipseViewCopy.cpp
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicEclipseViewDelete.cpp
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicEclipseViewNew.cpp
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicEclipseViewPaste.cpp
 | 
			
		||||
#${CEE_CURRENT_LIST_DIR}RicGridModelsCreateCaseGroupFromFiles.cpp
 | 
			
		||||
#${CEE_CURRENT_LIST_DIR}RicGridModelsImport.cpp
 | 
			
		||||
#${CEE_CURRENT_LIST_DIR}RicGridModelsImportInput.cpp
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicRangeFilterDelete.cpp
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicRangeFilterInsert.cpp
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicRangeFilterNew.cpp
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicRangeFilterNewExec.cpp
 | 
			
		||||
${CEE_CURRENT_LIST_DIR}RicRangeFilterNewSliceI.cpp
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										63
									
								
								ApplicationCode/Commands/RicEclipseCaseClose.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								ApplicationCode/Commands/RicEclipseCaseClose.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,63 @@
 | 
			
		||||
/////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
//
 | 
			
		||||
//  Copyright (C) 2015-     Statoil ASA
 | 
			
		||||
//  Copyright (C) 2015-     Ceetron Solutions AS
 | 
			
		||||
// 
 | 
			
		||||
//  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 "RicEclipseCaseClose.h"
 | 
			
		||||
 | 
			
		||||
#include "RimCase.h"
 | 
			
		||||
 | 
			
		||||
#include "cafSelectionManager.h"
 | 
			
		||||
 | 
			
		||||
#include <QAction>
 | 
			
		||||
 | 
			
		||||
CAF_CMD_SOURCE_INIT(RicEclipseCaseClose, "RicEclipseCaseClose");
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
bool RicEclipseCaseClose::isCommandEnabled()
 | 
			
		||||
{
 | 
			
		||||
    std::vector<RimCase*> selection;
 | 
			
		||||
    caf::SelectionManager::instance()->objectsByType(&selection);
 | 
			
		||||
 | 
			
		||||
    if (selection.size() > 0)
 | 
			
		||||
    {
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
    {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
void RicEclipseCaseClose::onActionTriggered(bool isChecked)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
void RicEclipseCaseClose::setupActionLook(QAction* actionToSetup)
 | 
			
		||||
{
 | 
			
		||||
    actionToSetup->setText("Close");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										39
									
								
								ApplicationCode/Commands/RicEclipseCaseClose.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								ApplicationCode/Commands/RicEclipseCaseClose.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,39 @@
 | 
			
		||||
/////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
//
 | 
			
		||||
//  Copyright (C) 2015-     Statoil ASA
 | 
			
		||||
//  Copyright (C) 2015-     Ceetron Solutions AS
 | 
			
		||||
// 
 | 
			
		||||
//  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 RicEclipseCaseClose : public caf::CmdFeature
 | 
			
		||||
{
 | 
			
		||||
    CAF_CMD_HEADER_INIT;
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
    // Overrides
 | 
			
		||||
    virtual bool isCommandEnabled();
 | 
			
		||||
    virtual void onActionTriggered( bool isChecked );
 | 
			
		||||
    virtual void setupActionLook( QAction* actionToSetup );
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										63
									
								
								ApplicationCode/Commands/RicEclipseCaseCopy.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								ApplicationCode/Commands/RicEclipseCaseCopy.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,63 @@
 | 
			
		||||
/////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
//
 | 
			
		||||
//  Copyright (C) 2015-     Statoil ASA
 | 
			
		||||
//  Copyright (C) 2015-     Ceetron Solutions AS
 | 
			
		||||
// 
 | 
			
		||||
//  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 "RicEclipseCaseCopy.h"
 | 
			
		||||
 | 
			
		||||
#include "RimCase.h"
 | 
			
		||||
 | 
			
		||||
#include "cafSelectionManager.h"
 | 
			
		||||
 | 
			
		||||
#include <QAction>
 | 
			
		||||
 | 
			
		||||
CAF_CMD_SOURCE_INIT(RicEclipseCaseCopy, "RicEclipseCaseCopy");
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
bool RicEclipseCaseCopy::isCommandEnabled()
 | 
			
		||||
{
 | 
			
		||||
    std::vector<RimCase*> selection;
 | 
			
		||||
    caf::SelectionManager::instance()->objectsByType(&selection);
 | 
			
		||||
 | 
			
		||||
    if (selection.size() > 0)
 | 
			
		||||
    {
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
    {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
void RicEclipseCaseCopy::onActionTriggered(bool isChecked)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
void RicEclipseCaseCopy::setupActionLook(QAction* actionToSetup)
 | 
			
		||||
{
 | 
			
		||||
    actionToSetup->setText("Copy");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										39
									
								
								ApplicationCode/Commands/RicEclipseCaseCopy.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								ApplicationCode/Commands/RicEclipseCaseCopy.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,39 @@
 | 
			
		||||
/////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
//
 | 
			
		||||
//  Copyright (C) 2015-     Statoil ASA
 | 
			
		||||
//  Copyright (C) 2015-     Ceetron Solutions AS
 | 
			
		||||
// 
 | 
			
		||||
//  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 RicEclipseCaseCopy : public caf::CmdFeature
 | 
			
		||||
{
 | 
			
		||||
    CAF_CMD_HEADER_INIT;
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
    // Overrides
 | 
			
		||||
    virtual bool isCommandEnabled();
 | 
			
		||||
    virtual void onActionTriggered( bool isChecked );
 | 
			
		||||
    virtual void setupActionLook( QAction* actionToSetup );
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										61
									
								
								ApplicationCode/Commands/RicEclipseCaseExecuteScript.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										61
									
								
								ApplicationCode/Commands/RicEclipseCaseExecuteScript.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,61 @@
 | 
			
		||||
/////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
//
 | 
			
		||||
//  Copyright (C) 2015-     Statoil ASA
 | 
			
		||||
//  Copyright (C) 2015-     Ceetron Solutions AS
 | 
			
		||||
// 
 | 
			
		||||
//  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 "RicEclipseCaseExecuteScript.h"
 | 
			
		||||
 | 
			
		||||
#include "RimCase.h"
 | 
			
		||||
 | 
			
		||||
#include "cafSelectionManager.h"
 | 
			
		||||
 | 
			
		||||
#include <QAction>
 | 
			
		||||
 | 
			
		||||
CAF_CMD_SOURCE_INIT(RicEclipseCaseExecuteScript, "RicEclipseCaseExecuteScript");
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
bool RicEclipseCaseExecuteScript::isCommandEnabled()
 | 
			
		||||
{
 | 
			
		||||
    std::vector<RimCase*> selection;
 | 
			
		||||
    caf::SelectionManager::instance()->objectsByType(&selection);
 | 
			
		||||
 | 
			
		||||
    if (selection.size() > 0)
 | 
			
		||||
    {
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
    {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
void RicEclipseCaseExecuteScript::onActionTriggered(bool isChecked)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
void RicEclipseCaseExecuteScript::setupActionLook(QAction* actionToSetup)
 | 
			
		||||
{
 | 
			
		||||
    actionToSetup->setText("Execute Script");
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										39
									
								
								ApplicationCode/Commands/RicEclipseCaseExecuteScript.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								ApplicationCode/Commands/RicEclipseCaseExecuteScript.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,39 @@
 | 
			
		||||
/////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
//
 | 
			
		||||
//  Copyright (C) 2015-     Statoil ASA
 | 
			
		||||
//  Copyright (C) 2015-     Ceetron Solutions AS
 | 
			
		||||
// 
 | 
			
		||||
//  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 RicEclipseCaseExecuteScript : public caf::CmdFeature
 | 
			
		||||
{
 | 
			
		||||
    CAF_CMD_HEADER_INIT;
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
    // Overrides
 | 
			
		||||
    virtual bool isCommandEnabled();
 | 
			
		||||
    virtual void onActionTriggered( bool isChecked );
 | 
			
		||||
    virtual void setupActionLook( QAction* actionToSetup );
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										63
									
								
								ApplicationCode/Commands/RicEclipseCaseNewGroup.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								ApplicationCode/Commands/RicEclipseCaseNewGroup.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,63 @@
 | 
			
		||||
/////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
//
 | 
			
		||||
//  Copyright (C) 2015-     Statoil ASA
 | 
			
		||||
//  Copyright (C) 2015-     Ceetron Solutions AS
 | 
			
		||||
// 
 | 
			
		||||
//  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 "RicEclipseCaseNewGroup.h"
 | 
			
		||||
 | 
			
		||||
#include "RimCase.h"
 | 
			
		||||
 | 
			
		||||
#include "cafSelectionManager.h"
 | 
			
		||||
 | 
			
		||||
#include <QAction>
 | 
			
		||||
 | 
			
		||||
CAF_CMD_SOURCE_INIT(RicEclipseCaseNewGroup, "RicEclipseCaseNewGroup");
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
bool RicEclipseCaseNewGroup::isCommandEnabled()
 | 
			
		||||
{
 | 
			
		||||
    std::vector<RimCase*> selection;
 | 
			
		||||
    caf::SelectionManager::instance()->objectsByType(&selection);
 | 
			
		||||
 | 
			
		||||
    if (selection.size() > 0)
 | 
			
		||||
    {
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
    {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
void RicEclipseCaseNewGroup::onActionTriggered(bool isChecked)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
void RicEclipseCaseNewGroup::setupActionLook(QAction* actionToSetup)
 | 
			
		||||
{
 | 
			
		||||
    actionToSetup->setText("New Grid Case Group");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										39
									
								
								ApplicationCode/Commands/RicEclipseCaseNewGroup.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								ApplicationCode/Commands/RicEclipseCaseNewGroup.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,39 @@
 | 
			
		||||
/////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
//
 | 
			
		||||
//  Copyright (C) 2015-     Statoil ASA
 | 
			
		||||
//  Copyright (C) 2015-     Ceetron Solutions AS
 | 
			
		||||
// 
 | 
			
		||||
//  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 RicEclipseCaseNewGroup : public caf::CmdFeature
 | 
			
		||||
{
 | 
			
		||||
    CAF_CMD_HEADER_INIT;
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
    // Overrides
 | 
			
		||||
    virtual bool isCommandEnabled();
 | 
			
		||||
    virtual void onActionTriggered( bool isChecked );
 | 
			
		||||
    virtual void setupActionLook( QAction* actionToSetup );
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										61
									
								
								ApplicationCode/Commands/RicEclipseCaseNewView.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										61
									
								
								ApplicationCode/Commands/RicEclipseCaseNewView.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,61 @@
 | 
			
		||||
/////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
//
 | 
			
		||||
//  Copyright (C) 2015-     Statoil ASA
 | 
			
		||||
//  Copyright (C) 2015-     Ceetron Solutions AS
 | 
			
		||||
// 
 | 
			
		||||
//  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 "RicEclipseCaseNewView.h"
 | 
			
		||||
 | 
			
		||||
#include "RimCase.h"
 | 
			
		||||
 | 
			
		||||
#include "cafSelectionManager.h"
 | 
			
		||||
 | 
			
		||||
#include <QAction>
 | 
			
		||||
 | 
			
		||||
CAF_CMD_SOURCE_INIT(RicEclipseCaseNewView, "RicEclipseCaseNewView");
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
bool RicEclipseCaseNewView::isCommandEnabled()
 | 
			
		||||
{
 | 
			
		||||
    std::vector<RimCase*> selection;
 | 
			
		||||
    caf::SelectionManager::instance()->objectsByType(&selection);
 | 
			
		||||
 | 
			
		||||
    if (selection.size() > 0)
 | 
			
		||||
    {
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
    {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
void RicEclipseCaseNewView::onActionTriggered(bool isChecked)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
void RicEclipseCaseNewView::setupActionLook(QAction* actionToSetup)
 | 
			
		||||
{
 | 
			
		||||
    actionToSetup->setText("New View");
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										39
									
								
								ApplicationCode/Commands/RicEclipseCaseNewView.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								ApplicationCode/Commands/RicEclipseCaseNewView.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,39 @@
 | 
			
		||||
/////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
//
 | 
			
		||||
//  Copyright (C) 2015-     Statoil ASA
 | 
			
		||||
//  Copyright (C) 2015-     Ceetron Solutions AS
 | 
			
		||||
// 
 | 
			
		||||
//  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 RicEclipseCaseNewView : public caf::CmdFeature
 | 
			
		||||
{
 | 
			
		||||
    CAF_CMD_HEADER_INIT;
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
    // Overrides
 | 
			
		||||
    virtual bool isCommandEnabled();
 | 
			
		||||
    virtual void onActionTriggered( bool isChecked );
 | 
			
		||||
    virtual void setupActionLook( QAction* actionToSetup );
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										61
									
								
								ApplicationCode/Commands/RicEclipseCasePaste.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										61
									
								
								ApplicationCode/Commands/RicEclipseCasePaste.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,61 @@
 | 
			
		||||
/////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
//
 | 
			
		||||
//  Copyright (C) 2015-     Statoil ASA
 | 
			
		||||
//  Copyright (C) 2015-     Ceetron Solutions AS
 | 
			
		||||
// 
 | 
			
		||||
//  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 "RicEclipseCasePaste.h"
 | 
			
		||||
 | 
			
		||||
#include "RimCase.h"
 | 
			
		||||
 | 
			
		||||
#include "cafSelectionManager.h"
 | 
			
		||||
 | 
			
		||||
#include <QAction>
 | 
			
		||||
 | 
			
		||||
CAF_CMD_SOURCE_INIT(RicEclipseCasePaste, "RicEclipseCasePaste");
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
bool RicEclipseCasePaste::isCommandEnabled()
 | 
			
		||||
{
 | 
			
		||||
    std::vector<RimCase*> selection;
 | 
			
		||||
    caf::SelectionManager::instance()->objectsByType(&selection);
 | 
			
		||||
 | 
			
		||||
    if (selection.size() > 0)
 | 
			
		||||
    {
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
    {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
void RicEclipseCasePaste::onActionTriggered(bool isChecked)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
void RicEclipseCasePaste::setupActionLook(QAction* actionToSetup)
 | 
			
		||||
{
 | 
			
		||||
    actionToSetup->setText("Paste");
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										39
									
								
								ApplicationCode/Commands/RicEclipseCasePaste.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								ApplicationCode/Commands/RicEclipseCasePaste.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,39 @@
 | 
			
		||||
/////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
//
 | 
			
		||||
//  Copyright (C) 2015-     Statoil ASA
 | 
			
		||||
//  Copyright (C) 2015-     Ceetron Solutions AS
 | 
			
		||||
// 
 | 
			
		||||
//  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 RicEclipseCasePaste : public caf::CmdFeature
 | 
			
		||||
{
 | 
			
		||||
    CAF_CMD_HEADER_INIT;
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
    // Overrides
 | 
			
		||||
    virtual bool isCommandEnabled();
 | 
			
		||||
    virtual void onActionTriggered( bool isChecked );
 | 
			
		||||
    virtual void setupActionLook( QAction* actionToSetup );
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										64
									
								
								ApplicationCode/Commands/RicEclipseCellResultSave.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										64
									
								
								ApplicationCode/Commands/RicEclipseCellResultSave.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,64 @@
 | 
			
		||||
/////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
//
 | 
			
		||||
//  Copyright (C) 2015-     Statoil ASA
 | 
			
		||||
//  Copyright (C) 2015-     Ceetron Solutions AS
 | 
			
		||||
// 
 | 
			
		||||
//  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 "RicEclipseCellResultSave.h"
 | 
			
		||||
 | 
			
		||||
#include "RimView.h"
 | 
			
		||||
#include "RimEclipseCellColors.h"
 | 
			
		||||
 | 
			
		||||
#include "cafSelectionManager.h"
 | 
			
		||||
 | 
			
		||||
#include <QAction>
 | 
			
		||||
 | 
			
		||||
CAF_CMD_SOURCE_INIT(RicEclipseCellResultSave, "RicEclipseCellResultSave");
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
bool RicEclipseCellResultSave::isCommandEnabled()
 | 
			
		||||
{
 | 
			
		||||
    std::vector<RimEclipseCellColors*> selection;
 | 
			
		||||
    caf::SelectionManager::instance()->objectsByType(&selection);
 | 
			
		||||
 | 
			
		||||
    if (selection.size() > 0)
 | 
			
		||||
    {
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
    {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
void RicEclipseCellResultSave::onActionTriggered(bool isChecked)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
void RicEclipseCellResultSave::setupActionLook(QAction* actionToSetup)
 | 
			
		||||
{
 | 
			
		||||
    actionToSetup->setText("Save Property To File");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										39
									
								
								ApplicationCode/Commands/RicEclipseCellResultSave.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								ApplicationCode/Commands/RicEclipseCellResultSave.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,39 @@
 | 
			
		||||
/////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
//
 | 
			
		||||
//  Copyright (C) 2015-     Statoil ASA
 | 
			
		||||
//  Copyright (C) 2015-     Ceetron Solutions AS
 | 
			
		||||
// 
 | 
			
		||||
//  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 RicEclipseCellResultSave : public caf::CmdFeature
 | 
			
		||||
{
 | 
			
		||||
    CAF_CMD_HEADER_INIT;
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
    // Overrides
 | 
			
		||||
    virtual bool isCommandEnabled();
 | 
			
		||||
    virtual void onActionTriggered( bool isChecked );
 | 
			
		||||
    virtual void setupActionLook( QAction* actionToSetup );
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										64
									
								
								ApplicationCode/Commands/RicEclipseFaultResultSave.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										64
									
								
								ApplicationCode/Commands/RicEclipseFaultResultSave.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,64 @@
 | 
			
		||||
/////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
//
 | 
			
		||||
//  Copyright (C) 2015-     Statoil ASA
 | 
			
		||||
//  Copyright (C) 2015-     Ceetron Solutions AS
 | 
			
		||||
// 
 | 
			
		||||
//  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 "RicEclipseFaultResultSave.h"
 | 
			
		||||
 | 
			
		||||
//#include "RimView.h"
 | 
			
		||||
#include "RimEclipseFaultColors.h"
 | 
			
		||||
 | 
			
		||||
#include "cafSelectionManager.h"
 | 
			
		||||
 | 
			
		||||
#include <QAction>
 | 
			
		||||
 | 
			
		||||
CAF_CMD_SOURCE_INIT(RicEclipseFaultResultSave, "RicEclipseFaultResultSave");
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
bool RicEclipseFaultResultSave::isCommandEnabled()
 | 
			
		||||
{
 | 
			
		||||
    std::vector<RimEclipseFaultColors*> selection;
 | 
			
		||||
    caf::SelectionManager::instance()->objectsByType(&selection);
 | 
			
		||||
 | 
			
		||||
    if (selection.size() > 0)
 | 
			
		||||
    {
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
    {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
void RicEclipseFaultResultSave::onActionTriggered(bool isChecked)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
void RicEclipseFaultResultSave::setupActionLook(QAction* actionToSetup)
 | 
			
		||||
{
 | 
			
		||||
    actionToSetup->setText("Save Property To File");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										39
									
								
								ApplicationCode/Commands/RicEclipseFaultResultSave.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								ApplicationCode/Commands/RicEclipseFaultResultSave.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,39 @@
 | 
			
		||||
/////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
//
 | 
			
		||||
//  Copyright (C) 2015-     Statoil ASA
 | 
			
		||||
//  Copyright (C) 2015-     Ceetron Solutions AS
 | 
			
		||||
// 
 | 
			
		||||
//  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 RicEclipseFaultResultSave : public caf::CmdFeature
 | 
			
		||||
{
 | 
			
		||||
    CAF_CMD_HEADER_INIT;
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
    // Overrides
 | 
			
		||||
    virtual bool isCommandEnabled();
 | 
			
		||||
    virtual void onActionTriggered( bool isChecked );
 | 
			
		||||
    virtual void setupActionLook( QAction* actionToSetup );
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										65
									
								
								ApplicationCode/Commands/RicRangeFilterDelete.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										65
									
								
								ApplicationCode/Commands/RicRangeFilterDelete.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,65 @@
 | 
			
		||||
/////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
//
 | 
			
		||||
//  Copyright (C) 2015-     Statoil ASA
 | 
			
		||||
//  Copyright (C) 2015-     Ceetron Solutions AS
 | 
			
		||||
// 
 | 
			
		||||
//  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 "RicRangeFilterDelete.h"
 | 
			
		||||
 | 
			
		||||
#include "RimCellRangeFilter.h"
 | 
			
		||||
 | 
			
		||||
#include "cafSelectionManager.h"
 | 
			
		||||
 | 
			
		||||
#include "cafCmdFeatureManager.h"
 | 
			
		||||
#include "cafCmdExecCommandManager.h"
 | 
			
		||||
 | 
			
		||||
#include <QAction>
 | 
			
		||||
 | 
			
		||||
CAF_CMD_SOURCE_INIT(RicRangeFilterDelete, "RicRangeFilterDelete");
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
bool RicRangeFilterDelete::isCommandEnabled()
 | 
			
		||||
{
 | 
			
		||||
    std::vector<RimCellRangeFilter*> selectedRangeFilter;
 | 
			
		||||
    caf::SelectionManager::instance()->objectsByType(&selectedRangeFilter);
 | 
			
		||||
 | 
			
		||||
    if (selectedRangeFilter.size() > 0)
 | 
			
		||||
    {
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
    {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
void RicRangeFilterDelete::onActionTriggered(bool isChecked)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
void RicRangeFilterDelete::setupActionLook(QAction* actionToSetup)
 | 
			
		||||
{
 | 
			
		||||
    actionToSetup->setText("Delete");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										39
									
								
								ApplicationCode/Commands/RicRangeFilterDelete.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								ApplicationCode/Commands/RicRangeFilterDelete.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,39 @@
 | 
			
		||||
/////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
//
 | 
			
		||||
//  Copyright (C) 2015-     Statoil ASA
 | 
			
		||||
//  Copyright (C) 2015-     Ceetron Solutions AS
 | 
			
		||||
// 
 | 
			
		||||
//  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 RicRangeFilterDelete : public caf::CmdFeature
 | 
			
		||||
{
 | 
			
		||||
    CAF_CMD_HEADER_INIT;
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
    // Overrides
 | 
			
		||||
    virtual bool isCommandEnabled();
 | 
			
		||||
    virtual void onActionTriggered( bool isChecked );
 | 
			
		||||
    virtual void setupActionLook( QAction* actionToSetup );
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										65
									
								
								ApplicationCode/Commands/RicRangeFilterInsert.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										65
									
								
								ApplicationCode/Commands/RicRangeFilterInsert.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,65 @@
 | 
			
		||||
/////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
//
 | 
			
		||||
//  Copyright (C) 2015-     Statoil ASA
 | 
			
		||||
//  Copyright (C) 2015-     Ceetron Solutions AS
 | 
			
		||||
// 
 | 
			
		||||
//  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 "RicRangeFilterInsert.h"
 | 
			
		||||
 | 
			
		||||
#include "RimCellRangeFilter.h"
 | 
			
		||||
 | 
			
		||||
#include "cafSelectionManager.h"
 | 
			
		||||
 | 
			
		||||
#include "cafCmdFeatureManager.h"
 | 
			
		||||
#include "cafCmdExecCommandManager.h"
 | 
			
		||||
 | 
			
		||||
#include <QAction>
 | 
			
		||||
 | 
			
		||||
CAF_CMD_SOURCE_INIT(RicRangeFilterInsert, "RicRangeFilterInsert");
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
bool RicRangeFilterInsert::isCommandEnabled()
 | 
			
		||||
{
 | 
			
		||||
    std::vector<RimCellRangeFilter*> selectedRangeFilter;
 | 
			
		||||
    caf::SelectionManager::instance()->objectsByType(&selectedRangeFilter);
 | 
			
		||||
 | 
			
		||||
    if (selectedRangeFilter.size() > 0)
 | 
			
		||||
    {
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
    {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
void RicRangeFilterInsert::onActionTriggered(bool isChecked)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
void RicRangeFilterInsert::setupActionLook(QAction* actionToSetup)
 | 
			
		||||
{
 | 
			
		||||
    actionToSetup->setText("Insert Range Filter");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										39
									
								
								ApplicationCode/Commands/RicRangeFilterInsert.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								ApplicationCode/Commands/RicRangeFilterInsert.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,39 @@
 | 
			
		||||
/////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
//
 | 
			
		||||
//  Copyright (C) 2015-     Statoil ASA
 | 
			
		||||
//  Copyright (C) 2015-     Ceetron Solutions AS
 | 
			
		||||
// 
 | 
			
		||||
//  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 RicRangeFilterInsert : public caf::CmdFeature
 | 
			
		||||
{
 | 
			
		||||
    CAF_CMD_HEADER_INIT;
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
    // Overrides
 | 
			
		||||
    virtual bool isCommandEnabled();
 | 
			
		||||
    virtual void onActionTriggered( bool isChecked );
 | 
			
		||||
    virtual void setupActionLook( QAction* actionToSetup );
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -518,6 +518,8 @@ void RimProject::computeUtmAreaOfInterest()
 | 
			
		||||
#include "RimCellRangeFilter.h"
 | 
			
		||||
#include "RimEclipsePropertyFilterCollection.h"
 | 
			
		||||
#include "RimEclipsePropertyFilter.h"
 | 
			
		||||
#include "RimEclipseCellColors.h"
 | 
			
		||||
#include "RimEclipseFaultColors.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
@@ -532,21 +534,47 @@ void RimProject::actionsBasedOnSelection(std::vector<QAction*>& actions)
 | 
			
		||||
 | 
			
		||||
    if (uiItems.size() == 1)
 | 
			
		||||
    {
 | 
			
		||||
        if (dynamic_cast<RimEclipseView*>(uiItems[0]))
 | 
			
		||||
        if (dynamic_cast<RimEclipseCase*>(uiItems[0]))
 | 
			
		||||
        {
 | 
			
		||||
            actions.push_back(commandManager->action("RicEclipseCaseCopy"));
 | 
			
		||||
            actions.push_back(commandManager->action("RicEclipseCasePaste"));
 | 
			
		||||
            actions.push_back(commandManager->action("RicEclipseCaseClose"));
 | 
			
		||||
            actions.push_back(commandManager->action("RicEclipseCaseNewView"));
 | 
			
		||||
            actions.push_back(commandManager->action("RicEclipseCaseNewGroup"));
 | 
			
		||||
            actions.push_back(commandManager->action("RicEclipseCaseExecuteScript"));
 | 
			
		||||
        }
 | 
			
		||||
        else if (dynamic_cast<RimEclipseView*>(uiItems[0]))
 | 
			
		||||
        {
 | 
			
		||||
            actions.push_back(commandManager->action("RicEclipseViewNew"));
 | 
			
		||||
            actions.push_back(commandManager->action("RicEclipseViewCopy"));
 | 
			
		||||
            actions.push_back(commandManager->action("RicEclipseViewPaste"));
 | 
			
		||||
            actions.push_back(commandManager->action("RicEclipseViewDelete"));
 | 
			
		||||
        }
 | 
			
		||||
        else if (dynamic_cast<RimCellRangeFilterCollection*>(uiItems[0])
 | 
			
		||||
            || dynamic_cast<RimCellRangeFilter*>(uiItems[0]))
 | 
			
		||||
        // MODTODO: Find out why this cast doesn't work
 | 
			
		||||
        else if (dynamic_cast<RimEclipseCellColors*>(uiItems[0]))
 | 
			
		||||
        {
 | 
			
		||||
            actions.push_back(commandManager->action("RicEclipseCellResultSave"));
 | 
			
		||||
        }
 | 
			
		||||
        // MODTODO: Make sure that "Custom Fault Result" appears in the treeview
 | 
			
		||||
        else if (dynamic_cast<RimEclipseFaultColors*>(uiItems[0]))
 | 
			
		||||
        {
 | 
			
		||||
            actions.push_back(commandManager->action("RicEclipseFaultResultSave"));
 | 
			
		||||
        }
 | 
			
		||||
        else if (dynamic_cast<RimCellRangeFilterCollection*>(uiItems[0]))
 | 
			
		||||
        {
 | 
			
		||||
            actions.push_back(commandManager->action("RicRangeFilterNew"));
 | 
			
		||||
            actions.push_back(commandManager->action("RicRangeFilterNewSliceI"));
 | 
			
		||||
            actions.push_back(commandManager->action("RicRangeFilterNewSliceJ"));
 | 
			
		||||
            actions.push_back(commandManager->action("RicRangeFilterNewSliceK"));
 | 
			
		||||
        }
 | 
			
		||||
        else if (dynamic_cast<RimCellRangeFilter*>(uiItems[0]))
 | 
			
		||||
        {
 | 
			
		||||
            actions.push_back(commandManager->action("RicRangeFilterInsert"));
 | 
			
		||||
            actions.push_back(commandManager->action("RicRangeFilterNewSliceI"));
 | 
			
		||||
            actions.push_back(commandManager->action("RicRangeFilterNewSliceJ"));
 | 
			
		||||
            actions.push_back(commandManager->action("RicRangeFilterNewSliceK"));
 | 
			
		||||
            actions.push_back(commandManager->action("RicRangeFilterDelete"));
 | 
			
		||||
        }
 | 
			
		||||
        else if (dynamic_cast<RimEclipsePropertyFilterCollection*>(uiItems[0])
 | 
			
		||||
            || dynamic_cast<RimEclipsePropertyFilter*>(uiItems[0]))
 | 
			
		||||
        {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user