-
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.
Change how sampling resolution is specified in statistics contourmap ui
- Loading branch information
1 parent
b999faf
commit 1542830
Showing
6 changed files
with
117 additions
and
17 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
11 changes: 11 additions & 0 deletions
11
ApplicationLibCode/ProjectDataModel/ContourMap/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,11 @@ | ||
set(SOURCE_GROUP_HEADER_FILES | ||
${CMAKE_CURRENT_LIST_DIR}/RimContourMapResolutionTools.h | ||
) | ||
|
||
set(SOURCE_GROUP_SOURCE_FILES | ||
${CMAKE_CURRENT_LIST_DIR}/RimContourMapResolutionTools.cpp | ||
) | ||
|
||
list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) | ||
|
||
list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) |
56 changes: 56 additions & 0 deletions
56
ApplicationLibCode/ProjectDataModel/ContourMap/RimContourMapResolutionTools.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,56 @@ | ||
///////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Copyright (C) 2025 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 "RimContourMapResolutionTools.h" | ||
|
||
#include "cafAppEnum.h" | ||
|
||
namespace caf | ||
{ | ||
template <> | ||
void caf::AppEnum<RimContourMapResolutionTools::SamplingResolution>::setUp() | ||
{ | ||
addItem( RimContourMapResolutionTools::SamplingResolution::EXTRA_FINE, "Extra Fine", "Extra Fine" ); | ||
addItem( RimContourMapResolutionTools::SamplingResolution::FINE, "Fine", "Fine" ); | ||
addItem( RimContourMapResolutionTools::SamplingResolution::BASE, "Base", "Normal" ); | ||
addItem( RimContourMapResolutionTools::SamplingResolution::COARSE, "Coarse", "Coarse" ); | ||
addItem( RimContourMapResolutionTools::SamplingResolution::EXTRA_COARSE, "Extra Coarse", "Extra Coarse" ); | ||
setDefault( RimContourMapResolutionTools::SamplingResolution::BASE ); | ||
} | ||
}; // namespace caf | ||
|
||
//-------------------------------------------------------------------------------------------------- | ||
/// | ||
//-------------------------------------------------------------------------------------------------- | ||
double RimContourMapResolutionTools::resolutionFromEnumValue( SamplingResolution resEnumVal ) | ||
{ | ||
switch ( resEnumVal ) | ||
{ | ||
case RimContourMapResolutionTools::SamplingResolution::EXTRA_FINE: | ||
return 0.5; | ||
case RimContourMapResolutionTools::SamplingResolution::FINE: | ||
return 1.0; | ||
case RimContourMapResolutionTools::SamplingResolution::COARSE: | ||
return 5.0; | ||
case RimContourMapResolutionTools::SamplingResolution::EXTRA_COARSE: | ||
return 8.0; | ||
case RimContourMapResolutionTools::SamplingResolution::BASE: | ||
default: | ||
return 2.0; | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
ApplicationLibCode/ProjectDataModel/ContourMap/RimContourMapResolutionTools.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,35 @@ | ||
///////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Copyright (C) 2025 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. | ||
// | ||
///////////////////////////////////////////////////////////////////////////////// | ||
|
||
class RimContourMapResolutionTools | ||
{ | ||
public: | ||
enum class SamplingResolution | ||
{ | ||
EXTRA_FINE, | ||
FINE, | ||
BASE, | ||
COARSE, | ||
EXTRA_COARSE | ||
}; | ||
|
||
static double resolutionFromEnumValue( RimContourMapResolutionTools::SamplingResolution resEnumVal ); | ||
|
||
private: | ||
RimContourMapResolutionTools(){}; | ||
}; |
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