-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add RimPolygon and RimPolygonInView - add new define ItemIn3dView used to identify surface or polygon data
- Loading branch information
Showing
38 changed files
with
1,801 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
ApplicationLibCode/Commands/PolygonCommands/CMakeLists_files.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
set(SOURCE_GROUP_HEADER_FILES | ||
${CMAKE_CURRENT_LIST_DIR}/RicAppendPolygonFeature.h | ||
${CMAKE_CURRENT_LIST_DIR}/RicAppendPolygonFileFeature.h | ||
) | ||
|
||
set(SOURCE_GROUP_SOURCE_FILES | ||
${CMAKE_CURRENT_LIST_DIR}/RicAppendPolygonFeature.cpp | ||
${CMAKE_CURRENT_LIST_DIR}/RicAppendPolygonFileFeature.cpp | ||
) | ||
|
||
list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) | ||
|
||
list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) | ||
|
||
source_group( | ||
"CommandFeature\\Polygons" | ||
FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} | ||
${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake | ||
) |
54 changes: 54 additions & 0 deletions
54
ApplicationLibCode/Commands/PolygonCommands/RicAppendPolygonFeature.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
//////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Copyright (C) 2022 Equinor 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 "RicAppendPolygonFeature.h" | ||
|
||
#include "Polygons/RimPolygon.h" | ||
#include "Polygons/RimPolygonCollection.h" | ||
#include "RimOilField.h" | ||
#include "RimProject.h" | ||
|
||
#include "RiuPlotMainWindowTools.h" | ||
|
||
#include <QAction> | ||
|
||
CAF_CMD_SOURCE_INIT( RicAppendPolygonFeature, "RicAppendPolygonFeature" ); | ||
|
||
//-------------------------------------------------------------------------------------------------- | ||
/// | ||
//-------------------------------------------------------------------------------------------------- | ||
void RicAppendPolygonFeature::onActionTriggered( bool isChecked ) | ||
{ | ||
auto proj = RimProject::current(); | ||
auto polygonCollection = proj->activeOilField()->polygonCollection(); | ||
|
||
auto newPolygon = polygonCollection->appendUserDefinedPolygon(); | ||
polygonCollection->uiCapability()->updateAllRequiredEditors(); | ||
|
||
RiuPlotMainWindowTools::setExpanded( newPolygon ); | ||
RiuPlotMainWindowTools::selectAsCurrentItem( newPolygon ); | ||
} | ||
|
||
//-------------------------------------------------------------------------------------------------- | ||
/// | ||
//-------------------------------------------------------------------------------------------------- | ||
void RicAppendPolygonFeature::setupActionLook( QAction* actionToSetup ) | ||
{ | ||
actionToSetup->setText( "Append Polygon" ); | ||
actionToSetup->setIcon( QIcon( ":/PolylinesFromFile16x16.png" ) ); | ||
} |
33 changes: 33 additions & 0 deletions
33
ApplicationLibCode/Commands/PolygonCommands/RicAppendPolygonFeature.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
//////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Copyright (C) 2022 Equinor 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 RicAppendPolygonFeature : public caf::CmdFeature | ||
{ | ||
CAF_CMD_HEADER_INIT; | ||
|
||
protected: | ||
void onActionTriggered( bool isChecked ) override; | ||
void setupActionLook( QAction* actionToSetup ) override; | ||
}; |
57 changes: 57 additions & 0 deletions
57
ApplicationLibCode/Commands/PolygonCommands/RicAppendPolygonFileFeature.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
//////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Copyright (C) 2022 Equinor 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 "RicAppendPolygonFileFeature.h" | ||
|
||
#include "Polygons/RimPolygon.h" | ||
#include "Polygons/RimPolygonCollection.h" | ||
#include "Polygons/RimPolygonFile.h" | ||
#include "RimOilField.h" | ||
#include "RimProject.h" | ||
|
||
#include "RiuPlotMainWindowTools.h" | ||
|
||
#include <QAction> | ||
|
||
CAF_CMD_SOURCE_INIT( RicAppendPolygonFileFeature, "RicAppendPolygonFileFeature" ); | ||
|
||
//-------------------------------------------------------------------------------------------------- | ||
/// | ||
//-------------------------------------------------------------------------------------------------- | ||
void RicAppendPolygonFileFeature::onActionTriggered( bool isChecked ) | ||
{ | ||
auto proj = RimProject::current(); | ||
auto polygonCollection = proj->activeOilField()->polygonCollection(); | ||
|
||
auto newPolygonFile = new RimPolygonFile(); | ||
newPolygonFile->setName( "File Polygon " + QString::number( polygonCollection->polygonFiles().size() + 1 ) ); | ||
polygonCollection->addPolygonFile( newPolygonFile ); | ||
polygonCollection->uiCapability()->updateAllRequiredEditors(); | ||
|
||
RiuPlotMainWindowTools::setExpanded( newPolygonFile ); | ||
RiuPlotMainWindowTools::selectAsCurrentItem( newPolygonFile ); | ||
} | ||
|
||
//-------------------------------------------------------------------------------------------------- | ||
/// | ||
//-------------------------------------------------------------------------------------------------- | ||
void RicAppendPolygonFileFeature::setupActionLook( QAction* actionToSetup ) | ||
{ | ||
actionToSetup->setText( "Append File Polygon" ); | ||
actionToSetup->setIcon( QIcon( ":/PolylinesFromFile16x16.png" ) ); | ||
} |
33 changes: 33 additions & 0 deletions
33
ApplicationLibCode/Commands/PolygonCommands/RicAppendPolygonFileFeature.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
//////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Copyright (C) 2022 Equinor 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 RicAppendPolygonFileFeature : public caf::CmdFeature | ||
{ | ||
CAF_CMD_HEADER_INIT; | ||
|
||
protected: | ||
void onActionTriggered( bool isChecked ) override; | ||
void setupActionLook( QAction* actionToSetup ) override; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
ApplicationLibCode/ProjectDataModel/Polygons/CMakeLists_files.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
set(SOURCE_GROUP_HEADER_FILES | ||
${CMAKE_CURRENT_LIST_DIR}/RimPolygon.h | ||
${CMAKE_CURRENT_LIST_DIR}/RimPolygonFile.h | ||
${CMAKE_CURRENT_LIST_DIR}/RimPolygonCollection.h | ||
${CMAKE_CURRENT_LIST_DIR}/RimPolygonInView.h | ||
${CMAKE_CURRENT_LIST_DIR}/RimPolygonInViewCollection.h | ||
${CMAKE_CURRENT_LIST_DIR}/RimPolygonAppearance.h | ||
) | ||
|
||
set(SOURCE_GROUP_SOURCE_FILES | ||
${CMAKE_CURRENT_LIST_DIR}/RimPolygon.cpp | ||
${CMAKE_CURRENT_LIST_DIR}/RimPolygonFile.cpp | ||
${CMAKE_CURRENT_LIST_DIR}/RimPolygonCollection.cpp | ||
${CMAKE_CURRENT_LIST_DIR}/RimPolygonInView.cpp | ||
${CMAKE_CURRENT_LIST_DIR}/RimPolygonInViewCollection.cpp | ||
${CMAKE_CURRENT_LIST_DIR}/RimPolygonAppearance.cpp | ||
) | ||
|
||
list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) | ||
|
||
list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) | ||
|
||
source_group( | ||
"ProjectDataModel\\Polygons" | ||
FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} | ||
${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake | ||
) |
Oops, something went wrong.