mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-26 15:10:22 -05:00
Promote sector-export refinement from inline wizard fields to first-class PDM objects so users can create, edit, and preview refinement regions in the 3D view before opening the export dialog.
101 lines
3.1 KiB
C++
101 lines
3.1 KiB
C++
/////////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// Copyright (C) 2026 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 "cafPdmField.h"
|
|
#include "cafPdmObject.h"
|
|
#include "cafVecIjk.h"
|
|
|
|
#include "RigRefinement.h"
|
|
|
|
#include <QString>
|
|
|
|
#include <map>
|
|
#include <memory>
|
|
|
|
class RigNonUniformRefinement;
|
|
|
|
//==================================================================================================
|
|
///
|
|
/// Settings for non-uniform grid refinement of a RimRefinementRegion.
|
|
///
|
|
//==================================================================================================
|
|
class RicRefinementSettings : public caf::PdmObject
|
|
{
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
public:
|
|
enum NonUniformSubMode
|
|
{
|
|
CUSTOM_WIDTHS,
|
|
LINEAR_EQUAL_SPLIT,
|
|
LOGARITHMIC_CENTER
|
|
};
|
|
|
|
using NonUniformSubModeEnum = caf::AppEnum<NonUniformSubMode>;
|
|
|
|
RicRefinementSettings();
|
|
|
|
void setSectorBounds( const caf::VecIjk0& min, const caf::VecIjk0& max );
|
|
|
|
// Data access
|
|
std::unique_ptr<RigRefinement> effectiveRefinement() const;
|
|
std::unique_ptr<RigNonUniformRefinement> nonUniformRefinement() const;
|
|
bool hasNonUniformRefinement() const;
|
|
|
|
// UI integration
|
|
void addToUiOrdering( caf::PdmUiOrdering& uiOrdering );
|
|
std::map<QString, QString> validateSettings() const;
|
|
|
|
protected:
|
|
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
|
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
|
|
|
private:
|
|
static std::vector<double> parseWidths( const QString& text );
|
|
|
|
private:
|
|
caf::PdmField<bool> m_nonUniformEnableI;
|
|
caf::PdmField<QString> m_nonUniformIntervalsI;
|
|
|
|
caf::PdmField<bool> m_nonUniformEnableJ;
|
|
caf::PdmField<QString> m_nonUniformIntervalsJ;
|
|
|
|
caf::PdmField<bool> m_nonUniformEnableK;
|
|
caf::PdmField<QString> m_nonUniformIntervalsK;
|
|
|
|
caf::PdmField<NonUniformSubModeEnum> m_nonUniformSubMode;
|
|
|
|
caf::PdmField<int> m_nonUniformSubcellCountI;
|
|
caf::PdmField<int> m_nonUniformSubcellCountJ;
|
|
caf::PdmField<int> m_nonUniformSubcellCountK;
|
|
|
|
caf::PdmField<int> m_nonUniformTotalCellsI;
|
|
caf::PdmField<int> m_nonUniformTotalCellsJ;
|
|
caf::PdmField<int> m_nonUniformTotalCellsK;
|
|
|
|
// Sector bounds (1-based) for coordinate conversion
|
|
int m_sectorMinI;
|
|
int m_sectorMinJ;
|
|
int m_sectorMinK;
|
|
int m_sectorMaxI;
|
|
int m_sectorMaxJ;
|
|
int m_sectorMaxK;
|
|
};
|