mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-26 07:00:17 -05:00
Refactor import of radial grid
* Add radial display mode to preferences * Adds isRadial to grid * Improve mesh lines for radial cells For temporary radial LGRs, show mesh outline based on the aggregated geometry of all LGRs of the parent cell clicked on. * Improve warning message * Modify cell selection in pick event handler
This commit is contained in:
1 parent
4421536349
commit
6b7d93e2da
25 files changed
+399
-241
No files matched your search
@@ -38,6 +38,7 @@ set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaCloudDefines.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaWellFlowDefines.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaQuickAccessScheduler.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaGridDefines.h
|
||||
)
|
||||
|
||||
set(SOURCE_GROUP_SOURCE_FILES
|
||||
@@ -80,6 +81,7 @@ set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaCloudDefines.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaWellFlowDefines.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaQuickAccessScheduler.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaGridDefines.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RiaGridDefines.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template <>
|
||||
void caf::AppEnum<RiaGridDefines::RadialGridMode>::setUp()
|
||||
{
|
||||
addItem( RiaGridDefines::RadialGridMode::CARTESIAN, "CARTESIAN", "Show Cells as Cartesian Hex Elements" );
|
||||
addItem( RiaGridDefines::RadialGridMode::CYLINDRICAL, "CYLINDRICAL", "Show Cells as Cylinder Segments" );
|
||||
setDefault( RiaGridDefines::RadialGridMode::CYLINDRICAL );
|
||||
}
|
||||
|
||||
} // namespace caf
|
||||
@@ -0,0 +1,30 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace RiaGridDefines
|
||||
{
|
||||
|
||||
enum class RadialGridMode
|
||||
{
|
||||
CYLINDRICAL,
|
||||
CARTESIAN
|
||||
};
|
||||
|
||||
};
|
||||
@@ -97,6 +97,8 @@ RiaPreferencesGrid::RiaPreferencesGrid()
|
||||
|
||||
CAF_PDM_InitField( &m_invalidateLongThinCells, "invalidateLongThinCells", false, "Skip Long, Thin Cells" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_invalidateLongThinCells );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_radialGridMode, "radialGridMode", "Radial Grid Display Mode" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -146,6 +148,8 @@ void RiaPreferencesGrid::appendItems( caf::PdmUiOrdering& uiOrdering )
|
||||
egridGrp->add( &m_useResultIndexFile );
|
||||
}
|
||||
|
||||
egridGrp->add( &m_radialGridMode );
|
||||
|
||||
const bool setFaultImportSettingsReadOnly = !importFaults();
|
||||
|
||||
m_includeInactiveCellsInFaultGeometry.uiCapability()->setUiReadOnly( setFaultImportSettingsReadOnly );
|
||||
@@ -176,7 +180,7 @@ RifReaderSettings RiaPreferencesGrid::readerSettings()
|
||||
.includeFileAbsolutePathPrefix = m_includeFileAbsolutePathPrefix,
|
||||
.onlyLoadActiveCells = m_onlyLoadActiveCells,
|
||||
.invalidateLongThinCells = m_invalidateLongThinCells,
|
||||
.useCylindricalCoordinates = RiaPreferencesSystem::current()->useCylindricalCoordinates(),
|
||||
.useCylindricalCoordinates = m_radialGridMode == RiaGridDefines::RadialGridMode::CYLINDRICAL,
|
||||
.minimumAngularCellCount = RiaPreferencesSystem::current()->minimumAngularCellCount()
|
||||
|
||||
};
|
||||
@@ -327,3 +331,10 @@ RiaDefines::GridModelReader RiaPreferencesGrid::gridModelReaderOverride() const
|
||||
{
|
||||
return m_gridModelReaderOverride;
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaGridDefines::RadialGridMode RiaPreferencesGrid::radialGridMode() const
|
||||
{
|
||||
return m_radialGridMode();
|
||||
}
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
#include "RiaDefines.h"
|
||||
#include "RiaGridDefines.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
@@ -63,6 +64,8 @@ public:
|
||||
void setGridModelReaderOverride( const RiaDefines::GridModelReader readerType );
|
||||
RiaDefines::GridModelReader gridModelReaderOverride() const;
|
||||
|
||||
RiaGridDefines::RadialGridMode radialGridMode() const;
|
||||
|
||||
void appendItems( caf::PdmUiOrdering& uiOrdering );
|
||||
|
||||
private:
|
||||
@@ -80,4 +83,6 @@ private:
|
||||
caf::PdmField<bool> m_loadAndShowSoil;
|
||||
caf::PdmField<bool> m_onlyLoadActiveCells;
|
||||
caf::PdmField<bool> m_invalidateLongThinCells;
|
||||
|
||||
caf::PdmField<caf::AppEnum<RiaGridDefines::RadialGridMode>> m_radialGridMode;
|
||||
};
|
||||
@@ -77,9 +77,6 @@ RiaPreferencesSystem::RiaPreferencesSystem()
|
||||
CAF_PDM_InitField( &m_showPdfExportDialog, "showPdfExportDialog", true, "Show PDF Export Dialog" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showPdfExportDialog );
|
||||
|
||||
CAF_PDM_InitField( &m_useCylindricalCoordinates, "useCylindricalCoordinates", true, "Use Cylindrical Coords" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_useCylindricalCoordinates );
|
||||
|
||||
CAF_PDM_InitField( &m_mimimumAngularCellCount, "mimimumAngularCellCount", 40, "Minimum Angular Cell Count" );
|
||||
|
||||
CAF_PDM_InitField( &m_gtestFilter, "gtestFilter", QString(), "Unit Test Filter (gtest)" );
|
||||
@@ -244,14 +241,6 @@ std::optional<int> RiaPreferencesSystem::threadCount() const
|
||||
return text.toInt();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaPreferencesSystem::useCylindricalCoordinates() const
|
||||
{
|
||||
return m_useCylindricalCoordinates();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -312,7 +301,6 @@ void RiaPreferencesSystem::defineUiOrdering( QString uiConfigName, caf::PdmUiOrd
|
||||
|
||||
{
|
||||
caf::PdmUiGroup* group = uiOrdering.addNewGroup( "Radial Grid" );
|
||||
group->add( &m_useCylindricalCoordinates );
|
||||
group->add( &m_mimimumAngularCellCount );
|
||||
}
|
||||
|
||||
|
||||
@@ -59,8 +59,7 @@ public:
|
||||
|
||||
std::optional<int> threadCount() const;
|
||||
|
||||
bool useCylindricalCoordinates() const;
|
||||
int minimumAngularCellCount() const;
|
||||
int minimumAngularCellCount() const;
|
||||
|
||||
EclipseTextFileReaderMode eclipseTextFileReaderMode() const;
|
||||
|
||||
@@ -89,8 +88,7 @@ private:
|
||||
|
||||
caf::PdmField<bool> m_showProgressBar;
|
||||
|
||||
caf::PdmField<bool> m_useCylindricalCoordinates;
|
||||
caf::PdmField<int> m_mimimumAngularCellCount;
|
||||
caf::PdmField<int> m_mimimumAngularCellCount;
|
||||
|
||||
caf::PdmField<QString> m_gtestFilter;
|
||||
|
||||
|
||||
Reference in new issue
Block a user