mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-24 22:27:55 -05:00
- Add RimViewWindow_exportSnapshot on RimViewWindow (3D views and plots) with explicit ExportFolder, Prefix, Width, Height and FileFormat parameters. Generated as ViewWindow.export_snapshot(). - Add RimProject_exportSnapshots for exporting all views and/or plots with a ContentType parameter. Generated as Project.export_snapshots(). - Add RiaDefines::SnapshotFileFormat and SnapshotContentType enums, registered as Python StrEnums. - Extract single-item exportSnapshotOfView()/exportSnapshotOfPlot() from the RicSnapshotAll*ToFileFeature loops so the object methods and the legacy loops share the implementation. - RicfExportSnapshots resolves the export folder from the command file executor and forwards to the object methods. Python: the hand-written ViewWindow.export_snapshot() wrapper is removed (generated method is compatible). PlotWindow.export_snapshot() and Project.export_snapshots() keep their legacy argument names (file_prefix, output_format, snapshot_type, plot_format) as deprecated aliases. Case.export_snapshots_of_all_views() is deprecated in favor of View.export_snapshot(). Also fix Case.views(), which compared the view id to the case id and therefore never returned any views.
299 lines
6.6 KiB
C++
299 lines
6.6 KiB
C++
/////////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// Copyright (C) 2011- Statoil ASA
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
// Copyright (C) 2011-2012 Ceetron 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 "enum_bitmask.hpp"
|
|
|
|
#include <QString>
|
|
#include <vector>
|
|
|
|
namespace RiaDefines
|
|
{
|
|
enum class EclipseUnitSystem
|
|
{
|
|
UNITS_METRIC,
|
|
UNITS_FIELD,
|
|
UNITS_LAB,
|
|
UNITS_UNKNOWN,
|
|
};
|
|
|
|
enum class ResultCatType
|
|
{
|
|
DYNAMIC_NATIVE,
|
|
STATIC_NATIVE,
|
|
SOURSIMRL,
|
|
GENERATED,
|
|
INPUT_PROPERTY,
|
|
FORMATION_NAMES,
|
|
ALLAN_DIAGRAMS,
|
|
FLOW_DIAGNOSTICS,
|
|
INJECTION_FLOODING,
|
|
REMOVED,
|
|
|
|
UNDEFINED = 999
|
|
};
|
|
|
|
enum class ResultDataType
|
|
{
|
|
UNKNOWN,
|
|
FLOAT,
|
|
DOUBLE,
|
|
INTEGER
|
|
};
|
|
|
|
// WARNING: DO NOT CHANGE THE ORDER WITHOUT KNOWING WHAT YOU ARE DOING!
|
|
// You may well change the behaviour of property filters.
|
|
enum class WellPathComponentType
|
|
{
|
|
// Production Tube
|
|
WELL_PATH,
|
|
// Well path flow completions
|
|
PERFORATION_INTERVAL,
|
|
FISHBONES,
|
|
FRACTURE,
|
|
ICD,
|
|
AICD,
|
|
ICV,
|
|
// Well path construction features
|
|
CASING,
|
|
LINER,
|
|
PACKER,
|
|
// MSW segments from WELSEGS
|
|
MSW_SEGMENT,
|
|
// More valves
|
|
SICD,
|
|
UNDEFINED_COMPONENT
|
|
};
|
|
|
|
enum class MeshModeType
|
|
{
|
|
FULL_MESH,
|
|
FAULTS_MESH,
|
|
NO_MESH
|
|
};
|
|
|
|
// Mock model text identifiers
|
|
QString mockModelBasic();
|
|
QString mockModelBasicWithResults();
|
|
QString mockModelLargeWithResults();
|
|
QString mockModelCustomized();
|
|
QString mockModelBasicInputCase();
|
|
|
|
// Units and conversions
|
|
enum class DepthUnitType
|
|
{
|
|
UNIT_METER,
|
|
UNIT_FEET,
|
|
UNIT_NONE
|
|
};
|
|
|
|
DepthUnitType fromEclipseUnit( EclipseUnitSystem eclipseUnit );
|
|
EclipseUnitSystem fromDepthUnit( DepthUnitType depthUnit );
|
|
|
|
// Depth types used for well log plots
|
|
enum class DepthType
|
|
{
|
|
MEASURED_DEPTH,
|
|
TRUE_VERTICAL_DEPTH,
|
|
PSEUDO_LENGTH,
|
|
CONNECTION_NUMBER,
|
|
TRUE_VERTICAL_DEPTH_RKB
|
|
};
|
|
|
|
enum class PhaseType
|
|
{
|
|
OIL_PHASE,
|
|
GAS_PHASE,
|
|
WATER_PHASE,
|
|
PHASE_NOT_APPLICABLE
|
|
};
|
|
|
|
enum class ImportFileType : uint32_t
|
|
{
|
|
NOT_A_VALID_IMPORT_FILE = 1 << 0,
|
|
ECLIPSE_GRID_FILE = 1 << 1,
|
|
ECLIPSE_EGRID_FILE = 1 << 2,
|
|
ECLIPSE_INPUT_FILE = 1 << 3,
|
|
ECLIPSE_SUMMARY_FILE = 1 << 4,
|
|
GEOMECH_ODB_FILE = 1 << 5,
|
|
RESINSIGHT_PROJECT_FILE = 1 << 6,
|
|
GEOMECH_INP_FILE = 1 << 7,
|
|
EM_H5GRID = 1 << 8,
|
|
ROFF_FILE = 1 << 9,
|
|
GEOMECH_VTK_FILE = 1 << 10,
|
|
ECLIPSE_RESULT_GRID = ECLIPSE_GRID_FILE | ECLIPSE_EGRID_FILE,
|
|
ANY_ECLIPSE_FILE = ECLIPSE_RESULT_GRID | ECLIPSE_INPUT_FILE | ECLIPSE_SUMMARY_FILE | ROFF_FILE | EM_H5GRID,
|
|
ANY_GEOMECH_FILE = GEOMECH_ODB_FILE | GEOMECH_INP_FILE | GEOMECH_VTK_FILE,
|
|
ANY_IMPORT_FILE = ANY_ECLIPSE_FILE | ANY_GEOMECH_FILE | RESINSIGHT_PROJECT_FILE
|
|
};
|
|
|
|
bool isGeoMechFileType( ImportFileType fileType );
|
|
bool isEclipseResultFileType( ImportFileType fileType );
|
|
bool isEclipseFileType( ImportFileType fileType );
|
|
|
|
ImportFileType obtainFileTypeFromFileName( const QString& fileName );
|
|
QString defaultDirectoryLabel( ImportFileType fileTypes );
|
|
|
|
enum class CaseType
|
|
{
|
|
UNDEFINED_CASE = -1,
|
|
ECLIPSE_RESULT_CASE = 1,
|
|
ECLIPSE_INPUT_CASE = 2,
|
|
ECLIPSE_STAT_CASE = 3,
|
|
ECLIPSE_SOURCE_CASE = 4,
|
|
GEOMECH_ODB_CASE = 5
|
|
};
|
|
|
|
enum class FontSettingType
|
|
{
|
|
SCENE_FONT,
|
|
ANNOTATION_FONT,
|
|
WELL_LABEL_FONT,
|
|
PLOT_FONT
|
|
};
|
|
|
|
enum class GridCaseAxis
|
|
{
|
|
AXIS_I,
|
|
AXIS_J,
|
|
AXIS_K,
|
|
UNDEFINED_AXIS
|
|
};
|
|
|
|
enum class GridModelReader
|
|
{
|
|
RESDATA,
|
|
OPM_COMMON,
|
|
NOT_SET
|
|
};
|
|
|
|
enum class ThemeEnum
|
|
{
|
|
DEFAULT,
|
|
DARK,
|
|
UNDEFINED
|
|
};
|
|
|
|
enum class RINavigationPolicy : short
|
|
{
|
|
NAVIGATION_POLICY_CEETRON,
|
|
NAVIGATION_POLICY_CAD,
|
|
NAVIGATION_POLICY_GEOQUEST,
|
|
NAVIGATION_POLICY_RMS
|
|
};
|
|
|
|
enum class WellProductionType : short
|
|
{
|
|
PRODUCER,
|
|
OIL_INJECTOR,
|
|
GAS_INJECTOR,
|
|
WATER_INJECTOR,
|
|
UNDEFINED_PRODUCTION_TYPE
|
|
};
|
|
|
|
bool isInjector( WellProductionType wellProductionType );
|
|
|
|
// How to handle a new item colliding with the name of an existing item in the same folder.
|
|
// Used by the Python/gRPC API, where no user is present to resolve the conflict interactively.
|
|
enum class NameConflictPolicy
|
|
{
|
|
FAIL, // Abort the operation and report an error
|
|
AUTO_RENAME, // Append a numeric suffix to make the name unique
|
|
OVERWRITE // Delete the existing item carrying the name
|
|
};
|
|
|
|
QString stringListSeparator();
|
|
|
|
enum class ColumnCount
|
|
{
|
|
COLUMNS_1 = 1,
|
|
COLUMNS_2 = 2,
|
|
COLUMNS_3 = 3,
|
|
COLUMNS_4 = 4,
|
|
COLUMNS_UNLIMITED = 1000,
|
|
};
|
|
|
|
enum class RowCount
|
|
{
|
|
ROWS_1 = 1,
|
|
ROWS_2 = 2,
|
|
ROWS_3 = 3,
|
|
ROWS_4 = 4,
|
|
};
|
|
|
|
enum class MultiPlotPageUpdateType : uint32_t
|
|
{
|
|
NONE = 0b00000000,
|
|
LEGEND = 0b00000001,
|
|
PLOT = 0b00000010,
|
|
TITLE = 0b00000100,
|
|
ALL = 0b00000111
|
|
};
|
|
|
|
bool isFullUpdate( MultiPlotPageUpdateType updateType );
|
|
bool isLegendUpdate( MultiPlotPageUpdateType updateType );
|
|
bool isTitleUpdate( MultiPlotPageUpdateType updateType );
|
|
bool isPlotUpdate( MultiPlotPageUpdateType updateType );
|
|
|
|
std::vector<double> viewScaleOptions();
|
|
|
|
enum class View3dContent
|
|
{
|
|
NONE = 0b00000000,
|
|
ECLIPSE_DATA = 0b00000001,
|
|
GEOMECH_DATA = 0b00000010,
|
|
FLAT_INTERSECTION = 0b00000100,
|
|
CONTOUR = 0b00001000,
|
|
SEISMIC = 0b00010000,
|
|
ALL = 0b00011111
|
|
};
|
|
|
|
enum class ItemIn3dView
|
|
{
|
|
NONE = 0b00000000,
|
|
SURFACE = 0b00000001,
|
|
POLYGON = 0b00000010,
|
|
CONTOUR_MAP = 0b00000100,
|
|
ALL = 0b00000111
|
|
};
|
|
|
|
enum class SnapshotFileFormat
|
|
{
|
|
PNG,
|
|
PDF
|
|
};
|
|
|
|
enum class SnapshotContentType
|
|
{
|
|
ALL,
|
|
VIEWS,
|
|
PLOTS
|
|
};
|
|
|
|
QString betaFeaturePostfix();
|
|
}; // namespace RiaDefines
|
|
|
|
// Activate bit mask operators at global scope
|
|
ENABLE_BITMASK_OPERATORS( RiaDefines::MultiPlotPageUpdateType )
|
|
ENABLE_BITMASK_OPERATORS( RiaDefines::View3dContent )
|
|
ENABLE_BITMASK_OPERATORS( RiaDefines::ItemIn3dView )
|
|
ENABLE_BITMASK_OPERATORS( RiaDefines::ImportFileType )
|