Merge pull request #4381 from OPM/dev

Merge dev into master for Release 2019.04
This commit is contained in:
Magne Sjaastad 2019-04-30 08:08:59 +02:00 committed by GitHub
commit 2320c8d44b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2926 changed files with 120087 additions and 49643 deletions

20
.appveyor.yml Normal file
View File

@ -0,0 +1,20 @@
version: 1.0.{build}
branches:
only:
- dev
image: Visual Studio 2017
clone_depth: 1
environment:
QT5: C:\Qt\5.10.1\msvc2017_64
configuration: Release
build_script:
- cmd: >-
mkdir cmakebuild
cd cmakebuild
if exist "%QT5%" set Path=%QT5%\bin;%Path%
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Release -DRESINSIGHT_BUILD_WITH_QT5=true -DRESINSIGHT_ENABLE_COTIRE=on "-DCMAKE_PREFIX_PATH=%QT5%" ..
cmake --build . --target ResInsight_unity --config Release

View File

@ -1,5 +1,5 @@
---
Checks: '-*,modernize-use-nullptr,modernize-use-override'
Checks: '-*,modernize-use-nullptr,modernize-use-override,modernize-deprecated-headers'
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
...

27
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,27 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: Bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Additional context**
Add any other context about the problem here.

10
.github/ISSUE_TEMPLATE/enhancement.md vendored Normal file
View File

@ -0,0 +1,10 @@
---
name: Enhancement
about: Describe enhancement.
title: 'Context : EnhancementName'
labels: Enhancement
assignees: ''
---

View File

@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: FeatureRequest
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

View File

@ -26,3 +26,5 @@
// Externally shipped versions should have even build numbers
#define PRODUCTVER "@PRODUCTVER@"
#define STRPRODUCTVER "@STRPRODUCTVER@"
#define RESINSIGHT_OCTAVE_VERSION "@OCTAVE_VERSION_STRING@"

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,240 @@
// ResInsight version string : 2018.11.0-dev
// Report generated : Wed 28. Nov 12:29:03 2018
//
//
AsciiDataCurve
CalcScript
CalculatedSummaryCase
CellEdgeResultSlot
CellFilter
CellPropertyFilter
CellPropertyFilters
CellRangeFilter
CellRangeFilterCollection
ChangeDataSourceFeatureUi
CmdAddItemExecData
CmdDeleteItemExecData
CmdFieldChangeExecData
CrossSection
CrossSectionCollection
Eclipse2dViewCollection
EclipseCase
EclipseGeometrySelectionItem
Fault
Faults
FileSummaryCase
FishbonesCollection
FishbonesMultipleSubs
FishbonesPipeProperties
FlowCharacteristicsPlot
FlowDiagSolution
FlowPlotCollection
FormationNames
FormationNamesCollectionObject
FractureContainment
FractureDefinitionCollection
GeoMechGeometrySelectionItem
GeoMechPropertyFilter
GeoMechPropertyFilters
GeoMechResultDefinition
GeoMechResultSlot
GeoMechView
GridCollection
GridInfo
GridInfoCollection
GridSummaryCase
GridTimeHistoryCurve
Intersection2dView
Intersection2dViewCollection
IntersectionBox
Legend
MainPlotCollection
MdiWindowController
MockModelSettings
ModeledWellPath
MultiSnapshotDefinition
NoCommonAreaNNC
ObservedDataCollection
PdmDocument
PdmObjectCollection
PdmObjectGroup
Perforation
PerforationCollection
PropertyFilter
ResInsightAnalysisModels
ResInsightGeoMechCase
ResInsightGeoMechModels
ResInsightOilField
ResInsightProject
ReservoirCellResultStorage
ReservoirView
ResultDefinition
ResultSlot
ResultStorageEntryInfo
RftAddress
RiaMemoryCleanup
RiaPreferences
RiaRegressionTest
RicCaseAndFileExportSettingsUi
RicCellRangeUi
RicDeleteItemExecData
RicExportCarfinUi
RicExportCompletionDataSettingsUi
RicExportLgrUi
RicExportToLasFileObj
RicExportToLasFileResampleUi
RicExportWellPathsUi
RicHoloLensCreateSessionUi
RicHoloLensExportToFolderUi
RicHoloLensServerSettings
RicLinkVisibleViewsFeatureUi
RicPasteAsciiDataToSummaryPlotFeatureUi
RicSaveEclipseInputVisibleCellsUi
RicSelectSummaryPlotUI
RicSelectViewUI
RicSummaryAddressSelection
RicSummaryCurveCalculator
RicSummaryCurveCreator
RicWellPathsUnitSystemSettingsUi
RifReaderSettings
Rim3dWellLogCurveCollection
Rim3dWellLogExtractionCurve
Rim3dWellLogFileCurve
Rim3dWellLogRftCurve
RimBinaryExportSettings
RimCaseCollection
RimCommandExecuteScript
RimCommandIssueFieldChanged
RimCommandObject
RimContourMapNameConfig
RimContourMapProjection
RimContourMapView
RimCsvUserData
RimCurveNameConfig
RimDerivedEnsembleCaseCollection
RimDialogData
RimEllipseFractureTemplate
RimEnsembleCurveFilter
RimEnsembleCurveFilterCollection
RimEnsembleCurveSet
RimEnsembleCurveSetCollection
RimEnsembleStatistics
RimExportInputSettings
RimFaultResultSlot
RimFractureExportSettings
RimIdenticalGridCaseGroup
RimInputProperty
RimInputPropertyCollection
RimInputReservoir
RimMswCompletionParameters
RimMultipleValveLocations
RimNoCommonAreaNncCollection
RimNonDarcyPerforationParameters
RimObservedEclipseUserData
RimOilFieldEntry
RimOilRegionEntry
RimStatisticalCalculation
RimStatisticalCollection
RimStimPlanColors
RimStimPlanFractureTemplate
RimStimPlanLegendConfig
RimSummaryCalculation
RimSummaryCalculationCollection
RimSummaryCalculationVariable
RimSummaryCurveCollection
RimSummaryCurveCollectionModifier
RimTensorResults
RimTernaryLegendConfig
RimTimeStepFilter
RimViewLinkerCollection
RimVirtualPerforationResults
RimWellLogExtractionCurve
RimWellLogExtractionCurveNameConfig
RimWellLogFileCurveNameConfig
RimWellLogPlotNameConfig
RimWellLogRftCurveNameConfig
RimWellPathEntry
RimWellPathImport
RiuCreateMultipleFractionsUi
RiuMultipleFractionsOptions
ScriptLocation
SimWellFracture
SimWellFractureCollection
SummaryAddress
SummaryCaseCollection
SummaryCaseSubCollection
SummaryCrossPlot
SummaryCrossPlotCollection
SummaryCurve
SummaryCurveAutoName
SummaryCurveFilter
SummaryFilterSettings
SummaryObservedDataFile
SummaryPageDownloadEntity
SummaryPlot
SummaryPlotCollection
SummaryTimeAxisProperties
SummaryYAxisProperties
TC2
TestCommand1
TofAccumulatedPhaseFractionsPlot
TotalWellAllocationPlot
View3dOverlayInfoConfig
ViewController
ViewLinker
Well
WellAllocationPlot
WellAllocationPlotLegend
WellFlowRateCurve
WellLogFile
WellLogFileChannel
WellLogFileCurve
WellLogPlot
WellLogPlotCollection
WellLogPlotTrack
WellLogRftCurve
WellPath
WellPathAttribute
WellPathAttributes
WellPathBase
WellPathCompletion
WellPathCompletionCollection
WellPathCompletions
WellPathFracture
WellPathFractureCollection
WellPathGeometryDef
WellPathTarget
WellPathValve
WellPaths
WellPltPlot
WellPltPlotCollection
WellRftPlot
WellRftPlotCollection
Wells
closeProject
computeCaseGroupStatistics
createLgrForCompletions
createMultipleFractures
exportLgrForCompletions
exportMsw
exportMultiCaseSnapshots
exportProperty
exportPropertyInViews
exportSimWellFractureCompletions
exportSnapshots
exportVisibleCells
exportWellPathCompletions
exportWellPaths
loadCase
openProject
replaceCase
replaceCaseImpl_no_support_for_command_file_text_parsing
replaceSourceCases
runOctaveScript
scaleFractureTemplate
setExportFolder
setFractureContainment
setMainWindowSize
setStartDir
setTimeStep

View File

@ -0,0 +1,121 @@
Nothing to do
-------------
unchanged ApplicationCode\Commands\HoloLensCommands\farmhash\farmhash.cc 1948 style unusedFunction false The function 'Hash128WithSeed' is never used.
unchanged ApplicationCode\ReservoirDataModel\cvfGeometryTools.cpp 614 style unusedFunction false The function 'addMidEdgeNodes' is never used.
unchanged ApplicationCode\WellPathImportSsihub\RiuWellImportWizard.cpp 147 style unusedFunction false The function 'cancelDownload' is never used.
unchanged ApplicationCode\GeoMech\GeoMechDataModel\RigFemPartGrid.cpp 453 style unusedFunction false The function 'cellIJKFromCoordinate' is never used.
unchanged ApplicationCode\GeoMech\GeoMechDataModel\RigFemPartGrid.cpp 486 style unusedFunction false The function 'cellMinMaxCordinates' is never used.
unchanged ApplicationCode\UserInterface\RiuWellLogPlot.cpp 527 style unusedFunction false The function 'changeEvent' is never used.
unchanged ApplicationCode\Commands\AnnotationCommands\RicTextAnnotation3dEditor.cpp 133 style unusedFunction false The function 'cleanupBeforeSettingPdmObject' is never used.
unchanged ApplicationCode\Commands\AnnotationCommands\RicTextAnnotation3dEditor.cpp 73 style unusedFunction false The function 'configureAndUpdateUi' is never used.
WIP
---
unchanged ApplicationCode\UserInterface\RiuGridCrossQwtPlot.cpp 359 style unusedFunction false The function 'contextMenuEvent' is never used.
unchanged ApplicationCode\Commands\HoloLensCommands\VdeCachingHashedIdFactory.cpp 233 style unusedFunction false The function 'crc' is never used.
unchanged ApplicationCode\Application\Tools\RiaColorTables.cpp 580 style unusedFunction false The function 'createBrightnessBasedColorTable' is never used.
unchanged ApplicationCode\GeoMech\GeoMechVisualization\RivFemPartGeometryGenerator.cpp 106 style unusedFunction false The function 'createOutlineMeshDrawable' is never used.
unchanged ApplicationCode\ModelVisualization\RivWellConnectionFactorGeometryGenerator.cpp 202 style unusedFunction false The function 'createStarGeometry' is never used.
unchanged ApplicationCode\Commands\SummaryPlotCommands\RicSummaryCurveCalculatorEditor.cpp 119 style unusedFunction false The function 'createWidget' is never used.
unchanged ApplicationCode\Commands\HoloLensCommands\VdeVizDataExtractor.cpp 397 style unusedFunction false The function 'debugComparePackets' is never used.
unchanged ApplicationCode\Application\RiaApplication.cpp 2355 style unusedFunction false The function 'defaultAnnotationFont' is never used.
unchanged ApplicationCode\Commands\FractureCommands\RicCreateMultipleFracturesUi.cpp 201 style unusedFunction false The function 'defineCustomContextMenu' is never used.
unchanged ApplicationCode\ProjectDataModel\Annotations\RimUserDefinedPolylinesAnnotation.cpp 271 style unusedFunction false The function 'defineObjectEditorAttribute' is never used.
unchanged ApplicationCode\GeoMech\GeoMechDataModel\RigFemPartResultsCollection.cpp 2267 style unusedFunction false The function 'deleteResultFrame' is never used.
unchanged ApplicationCode\ProjectDataModel\RimEclipseResultDefinition.cpp 944 style unusedFunction false The function 'diffResultUiShortNameHTML' is never used.
unchanged ApplicationCode\UserInterface\RiuDragDrop.cpp 254 style unusedFunction false The function 'dropMimeData' is never used.
unchanged ApplicationCode\FileInterface\RifEclipseSummaryTools.cpp 123 style unusedFunction false The function 'dumpMetaData' is never used.
unchanged ApplicationCode\FileInterface\RifJsonEncodeDecode.cpp 45 style unusedFunction false The function 'dumpToFile' is never used.
unchanged ApplicationCode\GeoMech\OdbReader\RifOdbReader.cpp 551 style unusedFunction false The function 'elementSet' is never used.
unchanged ApplicationCode\Application\RiaEclipseFileNameTools.cpp 73 style unusedFunction false The function 'findRelatedDataFile' is never used.
unchanged ApplicationCode\Commands\HoloLensCommands\VdeArrayDataPacket.cpp 221 style unusedFunction false The function 'fromRawPacketBuffer' is never used.
unchanged ApplicationCode\GeoMech\GeoMechDataModel\RigFemPartGrid.cpp 503 style unusedFunction false The function 'gridPointCoordinate' is never used.
unchanged ApplicationCode\GeoMech\GeoMechDataModel\RigFemPartGrid.cpp 362 style unusedFunction false The function 'gridPointCountI' is never used.
unchanged ApplicationCode\GeoMech\GeoMechDataModel\RigFemPartGrid.cpp 371 style unusedFunction false The function 'gridPointCountJ' is never used.
unchanged ApplicationCode\GeoMech\GeoMechDataModel\RigFemPartGrid.cpp 494 style unusedFunction false The function 'gridPointIndexFromIJK' is never used.
unchanged ApplicationCode\UserInterface\RiuCadNavigation.cpp 49 style unusedFunction false The function 'handleInputEvent' is never used.
unchanged ApplicationCode\Commands\Ric3dViewPickEventHandler.cpp 42 style unusedFunction false The function 'handlePickEvent' is never used.
unchanged ApplicationCode\ProjectDataModel\RimMimeData.cpp 56 style unusedFunction false The function 'hasFormat' is never used.
unchanged ApplicationCode\Commands\HoloLensCommands\VdeArrayDataPacket.cpp 173 style unusedFunction false The function 'imageComponentCount' is never used.
unchanged ApplicationCode\Application\Tools\RiaImageFileCompare.cpp 126 style unusedFunction false The function 'imagesEqual' is never used.
unchanged ApplicationCode\WellPathImportSsihub\RiuWellImportWizard.cpp 760 style unusedFunction false The function 'initializePage' is never used.
unchanged ApplicationCode\UserInterface\RiuViewer.cpp 860 style unusedFunction false The function 'leaveEvent' is never used.
unchanged ApplicationCode\GeoMech\GeoMechDataModel\RigFemPartGrid.cpp 405 style unusedFunction false The function 'maxCoordinate' is never used.
unchanged ApplicationCode\UserInterface\RiuDragDrop.cpp 332 style unusedFunction false The function 'mimeTypes' is never used.
unchanged ApplicationCode\GeoMech\GeoMechDataModel\RigFemPartGrid.cpp 396 style unusedFunction false The function 'minCoordinate' is never used.
unchanged ApplicationCode\UserInterface\RiuFlowCharacteristicsPlot.cpp 271 style unusedFunction false The function 'minimumSizeHint' is never used.
unchanged ApplicationCode\UserInterface\RiuViewer.cpp 539 style unusedFunction false The function 'mousePressEvent' is never used.
unchanged ApplicationCode\UserInterface\RiuViewer.cpp 236 style unusedFunction false The function 'mouseReleaseEvent' is never used.
unchanged ApplicationCode\Commands\AnnotationCommands\RicCreateReachCircleAnnotationFeature.cpp 59 style unusedFunction false The function 'onActionTriggered' is never used.
unchanged ApplicationCode\UserInterface\RiuDragDrop.cpp 342 style unusedFunction false The function 'onDragCanceled' is never used.
unchanged ApplicationCode\Commands\SummaryPlotCommands\RicSummaryCurveCalculator.cpp 276 style unusedFunction false The function 'onEditorWidgetsCreated' is never used.
unchanged ApplicationCode\UserInterface\RiuDragDrop.cpp 565 style unusedFunction false The function 'onProposedDropActionUpdated' is never used.
unchanged ApplicationCode\UserInterface\RiuMultiCaseImportDialog.cpp 105 style unusedFunction false The function 'on_m_addSearchFolderButton_clicked' is never used.
unchanged ApplicationCode\UserInterface\RiuMultiCaseImportDialog.cpp 247 style unusedFunction false The function 'on_m_removeEclipseCaseButton_clicked' is never used.
unchanged ApplicationCode\UserInterface\RiuMultiCaseImportDialog.cpp 129 style unusedFunction false The function 'on_m_removeSearchFolderButton_clicked' is never used.
unchanged ApplicationCode\UserInterface\RiuViewer.cpp 345 style unusedFunction false The function 'paintOverlayItems' is never used.
unchanged ApplicationCode\ProjectDataModel\RimProject.cpp 1066 style unusedFunction false The function 'polylineAnnotations' is never used.
unchanged ApplicationCode\Application\RiaApplication.cpp 326 style unusedFunction false The function 'processNonGuiEvents' is never used.
unchanged ApplicationCode\Commands\SummaryPlotCommands\RicSummaryCurveCalculatorEditor.cpp 65 style unusedFunction false The function 'recursivelyConfigureAndUpdateTopLevelUiOrdering' is never used.
unchanged ApplicationCode\ProjectDataModel\RimEclipseResultDefinition.cpp 755 style unusedFunction false The function 'setFromEclipseResultAddress' is never used.
unchanged ApplicationCode\ProjectDataModel\Completions\RimWellPathAicdParameters.cpp 189 style unusedFunction false The function 'setUnitLabels' is never used.
unchanged ApplicationCode\ProjectDataModel\Flow\RimWellPltPlot.cpp 1067 style unusedFunction false The function 'setupBeforeSave' is never used.
unchanged ApplicationCode\UserInterface\RiuWellLogPlot.cpp 519 style unusedFunction false The function 'showEvent' is never used.
unchanged ApplicationCode\ReservoirDataModel\RigSimulationWellCenterLineCalculator.cpp 1064 style unusedFunction false The function 'splitIntoBranches' is never used.
unchanged ApplicationCode\UserInterface\RiuDragDrop.cpp 126 style unusedFunction false The function 'supportedDropActions' is never used.
unchanged ApplicationCode\ReservoirDataModel\RigFlowDiagResultAddress.cpp 67 style unusedFunction false The function 'uiShortText' is never used.
unchanged ApplicationCode\Commands\CrossSectionCommands\RicAppendIntersectionFeature.cpp 121 style unusedFunction false The function 'undo' is never used.
unchanged ApplicationCode\ModelVisualization\RivCellEdgeEffectGenerator.cpp 281 style unusedFunction false The function 'updateForFixedFunctionRendering' is never used.
unchanged ApplicationCode\ModelVisualization\RivCellEdgeEffectGenerator.cpp 135 style unusedFunction false The function 'updateForShaderBasedRendering' is never used.
unchanged ApplicationCode\UnitTests\ListKeywordsForObjectsAndFields-Test.cpp 16 style unusedFunction false The function 'writeTextToFile' is never used.
unchanged ApplicationCode\Commands\HoloLensCommands\RicHoloLensSessionManager.h 47 style unusedPrivateFunction false Unused private function: 'RicHoloLensSessionManager::handleSessionNotification'
unchanged ApplicationCode\Commands\HoloLensCommands\VdeVizDataExtractor.h 106 style unusedPrivateFunction false Unused private function: 'VdeVizDataExtractor::debugComparePackets'
unchanged ApplicationCode\FileInterface\RifCaseRealizationParametersReader.h 101 style unusedPrivateFunction false Unused private function: 'RifCaseRealizationRunspecificationReader::closeDataStream'
unchanged ApplicationCode\ReservoirDataModel\RigSimulationWellCenterLineCalculator.h 52 style unusedPrivateFunction false Unused private function: 'RigSimulationWellCenterLineCalculator::splitIntoBranches'
Candidate for later use
-----------------------
Issue on GitHub
----
Must be changed
----------------
Deleted
-------
unchanged ApplicationCode\FileInterface\RifEclipseDataTableFormatter.cpp 278 style unusedFunction false The function 'addValueTable' is never used.
unchanged ApplicationCode\ReservoirDataModel\Completions\RigEclipseToStimPlanCellTransmissibilityCalculator.cpp 109 style unusedFunction false The function 'aggregatedMatrixTransmissibility' is never used.
unchanged ApplicationCode\ProjectDataModel\Annotations\RimAnnotationInViewCollection.cpp 231 style unusedFunction false The function 'annotationsCount' is never used.
unchanged ApplicationCode\Commands\ExportCommands\RicExportLgrFeature.cpp 848 style unusedFunction false The function 'appendIntersectedCells' is never used.
unchanged ApplicationCode\Application\Tools\RiaQIconTools.cpp 26 style unusedFunction false The function 'appendPixmapUpperLeft' is never used.
unchanged ApplicationCode\ReservoirDataModel\RigEclipseResultBinSorter.cpp 48 style unusedFunction false The function 'binRange' is never used.
unchanged ApplicationCode\Commands\ExportCommands\RicExportLgrFeature.cpp 684 style unusedFunction false The function 'cellsIntersectingCompletion' is never used.
unchanged ApplicationCode\Commands\ExportCommands\RicExportLgrFeature.cpp 702 style unusedFunction false The function 'createOrderedIntersectionList' is never used.
unchanged ApplicationCode\Commands\ExportCommands\RicExportLgrFeature.cpp 1129 style unusedFunction false The function 'resetNumbering' is never used.
unchanged ApplicationCode\Commands\RicCreateTemporaryLgrFeature.cpp 350 style unusedFunction false The function 'containsAnyNonMainGridCells' is never used.
unchanged ApplicationCode\Application\Tools\RiaColorTools.cpp 147 style unusedFunction false The function 'contrastRatio' is never used.
unchanged ApplicationCode\ProjectDataModel\Completions\RimPerforationInterval.cpp 105 style unusedFunction false The function 'enableCustomEndDate' is never used.
unchanged ApplicationCode\ProjectDataModel\Rim3dView.cpp 1099 style unusedFunction false The function 'enablePerspectiveProjectionField' is never used.
unchanged ApplicationCode\ReservoirDataModel\RigMainGrid.cpp 166 style unusedFunction false The function 'findAllReservoirCellIndicesMatching2dPoint' is never used.
unchanged ApplicationCode\ProjectDataModel\GridCrossPlots\RimGridCrossPlotDataSet.cpp 400 style unusedFunction false The function 'groupStrings' is never used.
unchanged ApplicationCode\ProjectDataModel\RimContourMapProjection.cpp 354 style unusedFunction false The function 'hasResultAtVertex' is never used.
unchanged ApplicationCode\ProjectDataModel\RimContourMapProjection.cpp 1417 style unusedFunction false The function 'isSummationResult' is never used.
unchanged ApplicationCode\ProjectDataModel\RimContourMapProjection.cpp 223 style unusedFunction false The function 'resultAggregation' is never used.
unchanged ApplicationCode\ProjectDataModel\RimContourMapProjection.cpp 255 style unusedFunction false The function 'showContourLabels' is never used.
unchanged ApplicationCode\ProjectDataModel\Annotations\RimUserDefinedPolylinesAnnotation.cpp 42 style unusedFunction false The function 'xydToXyzVector' is never used.
unchanged ApplicationCode\ProjectDataModel\Completions\RimSimWellFracture.cpp 117 style unusedFunction false The function 'wellDipAtFracturePosition' is never used.
unchanged ApplicationCode\ReservoirDataModel\RigLocalGrid.cpp 65 style unusedFunction false The function 'setPositionInParentGrid' is never used.
unchanged ApplicationCode\ProjectDataModel\Annotations\RimPolylinesAnnotationInView.cpp 66 style unusedFunction false The function 'setSourceAnnotation' is never used.
unchanged ApplicationCode\ProjectDataModel\Annotations\RimAnnotationTextAppearance.cpp 75 style unusedFunction false The function 'setAnchorLineColor' is never used.
unchanged ApplicationCode\ProjectDataModel\Annotations\RimAnnotationTextAppearance.cpp 59 style unusedFunction false The function 'setFontColor' is never used.
unchanged ApplicationCode\ProjectDataModel\RimScaleLegendConfig.cpp 447 style unusedFunction false The function 'setCurrentScale' is never used.
unchanged ApplicationCode\ProjectDataModel\Rim3dOverlayInfoConfig.cpp 278 style unusedFunction false The function 'setIsActive' is never used.
unchanged ApplicationCode\FileInterface\RifEclipseDataTableFormatter.cpp 137 style unusedFunction false The function 'setMaxDataRowWidth' is never used.
unchanged ApplicationCode\ProjectDataModel\RimRegularLegendConfig.cpp 737 style unusedFunction false The function 'setShowLegend' is never used.
Backlog
-------

View File

@ -11,6 +11,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RiaCurveSetDefinition.h
${CMAKE_CURRENT_LIST_DIR}/RiaRftPltCurveDefinition.h
${CMAKE_CURRENT_LIST_DIR}/RiaViewRedrawScheduler.h
${CMAKE_CURRENT_LIST_DIR}/RiaMemoryCleanup.h
${CMAKE_CURRENT_LIST_DIR}/RiaFontCache.h
${CMAKE_CURRENT_LIST_DIR}/RiaEclipseFileNameTools.h
)
set (SOURCE_GROUP_SOURCE_FILES
@ -26,6 +28,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RiaCurveSetDefinition.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaRftPltCurveDefinition.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaViewRedrawScheduler.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaMemoryCleanup.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaFontCache.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaEclipseFileNameTools.cpp
)
list(APPEND CODE_HEADER_FILES

File diff suppressed because it is too large Load Diff

View File

@ -30,6 +30,8 @@
#include "cvfObject.h"
#include "cvfFont.h"
#include "RiaFontCache.h"
#include <iostream>
#include <memory>
@ -56,6 +58,7 @@ class RimViewWindow;
class RimWellLogPlot;
class RimWellAllocationPlot;
class RiuMainWindow;
class RiuMainWindowBase;
class RiuPlotMainWindow;
class RiuRecentFileActionProvider;
@ -90,6 +93,8 @@ public:
PLA_CALCULATE_STATISTICS = 1
};
typedef RiaFontCache::FontSize FontSize;
public:
RiaApplication(int& argc, char** argv);
~RiaApplication() override;
@ -162,10 +167,11 @@ public:
void waitForProcess() const;
RiaPreferences* preferences();
void applyPreferences();
void applyPreferences(const RiaPreferences* oldPreferences = nullptr);
cvf::Font* standardFont();
cvf::Font* customFont();
cvf::Font* defaultSceneFont();
cvf::Font* defaultAnnotationFont();
cvf::Font* defaultWellLabelFont();
QString commandLineParameterHelp() const;
void showFormattedTextInMessageBox(const QString& text);
@ -179,6 +185,9 @@ public:
int launchUnitTests();
int launchUnitTestsWithConsole();
RiuMainWindow* getOrCreateAndShowMainWindow();
RiuMainWindow* mainWindow();
RiuPlotMainWindow* getOrCreateMainPlotWindow();
RiuPlotMainWindow* getOrCreateAndShowMainPlotWindow();
RiuPlotMainWindow* mainPlotWindow();
@ -189,8 +198,8 @@ public:
bool isMain3dWindowVisible() const;
bool isMainPlotWindowVisible() const;
bool tryCloseMainWindow();
bool tryClosePlotWindow();
void closeMainWindowIfOpenButHidden();
void closeMainPlotWindowIfOpenButHidden();
void addToRecentFiles(const QString& fileName);
std::vector<QAction*> recentFileActions() const;
@ -200,7 +209,8 @@ public:
static std::vector<QString> readFileListFromTextFile(QString listFileName);
void waitUntilCommandObjectsHasBeenProcessed();
void saveWinGeoAndDockToolBarLayout();
void saveMainWinGeoAndDockToolBarLayout();
void savePlotWinGeoAndDockToolBarLayout();
static bool enableDevelopmentFeatures();
static void clearAllSelections();
@ -209,6 +219,9 @@ private:
void onProjectOpenedOrClosed();
void setWindowCaptionFromAppState();
void createMainWindow();
void deleteMainWindow();
void createMainPlotWindow();
void deleteMainPlotWindow();
@ -242,8 +255,9 @@ private:
std::map<QString, QString> m_fileDialogDefaultDirectories;
QString m_startupDefaultDirectory;
cvf::ref<cvf::Font> m_standardFont;
cvf::ref<cvf::Font> m_customFont;
cvf::ref<cvf::Font> m_defaultSceneFont;
cvf::ref<cvf::Font> m_defaultAnnotationFont;
cvf::ref<cvf::Font> m_defaultWellLabelFont;
QMap<QString, QVariant> m_sessionCache; // Session cache used to store username/passwords per session
@ -254,6 +268,7 @@ private:
bool m_runningWorkerProcess;
RiuMainWindow* m_mainWindow;
RiuPlotMainWindow* m_mainPlotWindow;
std::unique_ptr<RiuRecentFileActionProvider> m_recentFileActionProvider;

View File

@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Statoil ASA
// Copyright (C) 2018- 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

View File

@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Statoil ASA
//
// Copyright (C) 2018- 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>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////

View File

@ -3,17 +3,17 @@
// 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>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@ -22,62 +22,70 @@
#include "cafAppEnum.h"
namespace caf
{
template<>
void caf::AppEnum< RiaDefines::ResultCatType >::setUp()
{
addItem(RiaDefines::DYNAMIC_NATIVE, "DYNAMIC_NATIVE", "Dynamic");
addItem(RiaDefines::STATIC_NATIVE, "STATIC_NATIVE", "Static");
addItem(RiaDefines::SOURSIMRL, "SOURSIMRL", "SourSimRL");
addItem(RiaDefines::GENERATED, "GENERATED", "Generated");
addItem(RiaDefines::INPUT_PROPERTY, "INPUT_PROPERTY", "Input Property");
addItem(RiaDefines::FORMATION_NAMES, "FORMATION_NAMES", "Formation Names");
addItem(RiaDefines::FLOW_DIAGNOSTICS, "FLOW_DIAGNOSTICS", "Flow Diagnostics");
addItem(RiaDefines::INJECTION_FLOODING, "INJECTION_FLOODING", "Injection Flooding");
setDefault(RiaDefines::DYNAMIC_NATIVE);
}
template<>
void caf::AppEnum< RiaDefines::DepthUnitType >::setUp()
{
addItem(RiaDefines::UNIT_METER, "UNIT_METER", "Meter");
addItem(RiaDefines::UNIT_FEET, "UNIT_FEET", "Feet");
addItem(RiaDefines::UNIT_NONE, "UNIT_NONE", "None");
setDefault(RiaDefines::UNIT_METER);
}
template<>
void caf::AppEnum< RiaDefines::PlotAxis >::setUp()
{
addItem(RiaDefines::PLOT_AXIS_LEFT, "PLOT_AXIS_LEFT", "Left");
addItem(RiaDefines::PLOT_AXIS_RIGHT, "PLOT_AXIS_RIGHT", "Right");
setDefault(RiaDefines::PLOT_AXIS_LEFT);
}
template<>
void caf::AppEnum< RiaDefines::WellPathComponentType >::setUp()
{
addItem(RiaDefines::WELL_PATH, "WELL_PATH", "Well Path");
addItem(RiaDefines::PERFORATION_INTERVAL, "PERFORATION_INTERVAL", "Perforation Interval");
addItem(RiaDefines::FISHBONES, "FISHBONES", "Fishbones");
addItem(RiaDefines::FRACTURE, "FRACTURE", "Fracture");
addItem(RiaDefines::ICD, "ICD", "ICD");
addItem(RiaDefines::AICD, "AICD", "AICD");
addItem(RiaDefines::ICV, "ICV", "ICV");
addItem(RiaDefines::CASING, "CASING", "Casing");
addItem(RiaDefines::LINER, "LINER", "Liner");
addItem(RiaDefines::PACKER, "PACKER", "Packer");
setDefault(RiaDefines::WELL_PATH);
}
template<>
void caf::AppEnum<RiaDefines::ResultCatType>::setUp()
{
addItem(RiaDefines::DYNAMIC_NATIVE, "DYNAMIC_NATIVE", "Dynamic");
addItem(RiaDefines::STATIC_NATIVE, "STATIC_NATIVE", "Static");
addItem(RiaDefines::SOURSIMRL, "SOURSIMRL", "SourSimRL");
addItem(RiaDefines::GENERATED, "GENERATED", "Generated");
addItem(RiaDefines::INPUT_PROPERTY, "INPUT_PROPERTY", "Input Property");
addItem(RiaDefines::FORMATION_NAMES, "FORMATION_NAMES", "Formation Names");
addItem(RiaDefines::FLOW_DIAGNOSTICS, "FLOW_DIAGNOSTICS", "Flow Diagnostics");
addItem(RiaDefines::INJECTION_FLOODING, "INJECTION_FLOODING", "Injection Flooding");
setDefault(RiaDefines::DYNAMIC_NATIVE);
}
template<>
void caf::AppEnum<RiaDefines::DepthUnitType>::setUp()
{
addItem(RiaDefines::UNIT_METER, "UNIT_METER", "Meter");
addItem(RiaDefines::UNIT_FEET, "UNIT_FEET", "Feet");
addItem(RiaDefines::UNIT_NONE, "UNIT_NONE", "None");
setDefault(RiaDefines::UNIT_METER);
}
template<>
void caf::AppEnum<RiaDefines::PlotAxis>::setUp()
{
addItem(RiaDefines::PLOT_AXIS_LEFT, "PLOT_AXIS_LEFT", "Left");
addItem(RiaDefines::PLOT_AXIS_RIGHT, "PLOT_AXIS_RIGHT", "Right");
setDefault(RiaDefines::PLOT_AXIS_LEFT);
}
template<>
void caf::AppEnum<RiaDefines::WellPathComponentType>::setUp()
{
addItem(RiaDefines::WELL_PATH, "WELL_PATH", "Well Path");
addItem(RiaDefines::PERFORATION_INTERVAL, "PERFORATION_INTERVAL", "Perforation Interval");
addItem(RiaDefines::FISHBONES, "FISHBONES", "Fishbones");
addItem(RiaDefines::FRACTURE, "FRACTURE", "Fracture");
addItem(RiaDefines::ICD, "ICD", "ICD");
addItem(RiaDefines::AICD, "AICD", "AICD");
addItem(RiaDefines::ICV, "ICV", "ICV");
addItem(RiaDefines::CASING, "CASING", "Casing");
addItem(RiaDefines::LINER, "LINER", "Liner");
addItem(RiaDefines::PACKER, "PACKER", "Packer");
addItem(RiaDefines::UNDEFINED_COMPONENT, "UNDEFINED", "Undefined Component");
setDefault(RiaDefines::WELL_PATH);
}
template<>
void caf::AppEnum<RiaDefines::MeshModeType>::setUp()
{
addItem(RiaDefines::FULL_MESH, "FULL_MESH", "All");
addItem(RiaDefines::FAULTS_MESH, "FAULTS_MESH", "Faults only");
addItem(RiaDefines::NO_MESH, "NO_MESH", "None");
setDefault(RiaDefines::FULL_MESH);
}
} // namespace caf
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RiaDefines::isPerCellFaceResult(const QString& resultName)
{
@ -126,7 +134,15 @@ bool RiaDefines::isPerCellFaceResult(const QString& resultName)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RiaDefines::isNativeCategoryResult(const QString& resultName)
{
return resultName.endsWith("NUM");
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::undefinedResultName()
{
@ -134,7 +150,7 @@ QString RiaDefines::undefinedResultName()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::undefinedGridFaultName()
{
@ -142,7 +158,7 @@ QString RiaDefines::undefinedGridFaultName()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::undefinedGridFaultWithInactiveName()
{
@ -150,7 +166,7 @@ QString RiaDefines::undefinedGridFaultWithInactiveName()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::combinedTransmissibilityResultName()
{
@ -158,7 +174,7 @@ QString RiaDefines::combinedTransmissibilityResultName()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::combinedWaterFluxResultName()
{
@ -166,7 +182,7 @@ QString RiaDefines::combinedWaterFluxResultName()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::combinedOilFluxResultName()
{
@ -174,7 +190,7 @@ QString RiaDefines::combinedOilFluxResultName()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::combinedGasFluxResultName()
{
@ -182,7 +198,7 @@ QString RiaDefines::combinedGasFluxResultName()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::ternarySaturationResultName()
{
@ -190,7 +206,7 @@ QString RiaDefines::ternarySaturationResultName()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::combinedMultResultName()
{
@ -198,7 +214,15 @@ QString RiaDefines::combinedMultResultName()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::eqlnumResultName()
{
return "EQLNUM";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::riTranXResultName()
{
@ -206,7 +230,7 @@ QString RiaDefines::riTranXResultName()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::riTranYResultName()
{
@ -214,7 +238,7 @@ QString RiaDefines::riTranYResultName()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::riTranZResultName()
{
@ -222,7 +246,7 @@ QString RiaDefines::riTranZResultName()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::combinedRiTranResultName()
{
@ -230,7 +254,7 @@ QString RiaDefines::combinedRiTranResultName()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::riMultXResultName()
{
@ -238,7 +262,7 @@ QString RiaDefines::riMultXResultName()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::riMultYResultName()
{
@ -246,7 +270,7 @@ QString RiaDefines::riMultYResultName()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::riMultZResultName()
{
@ -254,7 +278,7 @@ QString RiaDefines::riMultZResultName()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::combinedRiMultResultName()
{
@ -262,7 +286,7 @@ QString RiaDefines::combinedRiMultResultName()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::riAreaNormTranXResultName()
{
@ -270,7 +294,7 @@ QString RiaDefines::riAreaNormTranXResultName()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::riAreaNormTranYResultName()
{
@ -278,7 +302,7 @@ QString RiaDefines::riAreaNormTranYResultName()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::riAreaNormTranZResultName()
{
@ -286,7 +310,7 @@ QString RiaDefines::riAreaNormTranZResultName()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::combinedRiAreaNormTranResultName()
{
@ -310,7 +334,7 @@ QString RiaDefines::riOilVolumeResultName()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::mobilePoreVolumeName()
{
@ -318,7 +342,7 @@ QString RiaDefines::mobilePoreVolumeName()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::completionTypeResultName()
{
@ -326,7 +350,7 @@ QString RiaDefines::completionTypeResultName()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::mockModelBasic()
{
@ -334,7 +358,7 @@ QString RiaDefines::mockModelBasic()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::mockModelBasicWithResults()
{
@ -342,7 +366,7 @@ QString RiaDefines::mockModelBasicWithResults()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::mockModelLargeWithResults()
{
@ -350,7 +374,7 @@ QString RiaDefines::mockModelLargeWithResults()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::mockModelCustomized()
{
@ -358,7 +382,7 @@ QString RiaDefines::mockModelCustomized()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::mockModelBasicInputCase()
{
@ -366,7 +390,7 @@ QString RiaDefines::mockModelBasicInputCase()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::activeFormationNamesResultName()
{
@ -434,7 +458,7 @@ QString RiaDefines::wellPathSFGResultName()
//--------------------------------------------------------------------------------------------------
std::vector<QString> RiaDefines::wellPathAngleResultNames()
{
return { RiaDefines::wellPathAzimuthResultName(), RiaDefines::wellPathInclinationResultName() };
return {RiaDefines::wellPathAzimuthResultName(), RiaDefines::wellPathInclinationResultName()};
}
//--------------------------------------------------------------------------------------------------
@ -442,13 +466,15 @@ std::vector<QString> RiaDefines::wellPathAngleResultNames()
//--------------------------------------------------------------------------------------------------
std::vector<QString> RiaDefines::wellPathStabilityResultNames()
{
return { RiaDefines::wellPathFGResultName(), RiaDefines::wellPathOBGResultName(),
RiaDefines::wellPathPPResultName(), RiaDefines::wellPathSFGResultName(),
RiaDefines::wellPathSHResultName() };
return {RiaDefines::wellPathFGResultName(),
RiaDefines::wellPathOBGResultName(),
RiaDefines::wellPathPPResultName(),
RiaDefines::wellPathSFGResultName(),
RiaDefines::wellPathSHResultName()};
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
double RiaDefines::minimumDefaultValuePlot()
{
@ -456,9 +482,82 @@ double RiaDefines::minimumDefaultValuePlot()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
double RiaDefines::minimumDefaultLogValuePlot()
{
return 1.0;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RiaDefines::maximumDefaultValuePlot()
{
return 100.0;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiaDefines::ImportFileType RiaDefines::obtainFileTypeFromFileName(const QString& fileName)
{
if (fileName.endsWith("EGRID", Qt::CaseInsensitive))
{
return ECLIPSE_EGRID_FILE;
}
else if (fileName.endsWith("GRID", Qt::CaseInsensitive))
{
return ECLIPSE_GRID_FILE;
}
else if (fileName.endsWith("GRDECL", Qt::CaseInsensitive))
{
return ECLIPSE_INPUT_FILE;
}
else if (fileName.endsWith("SMSPEC", Qt::CaseInsensitive))
{
return ECLIPSE_SUMMARY_FILE;
}
else if (fileName.endsWith("ODB", Qt::CaseInsensitive))
{
return GEOMECH_ODB_FILE;
}
else if (fileName.endsWith(".rsp", Qt::CaseInsensitive) || fileName.endsWith(".rip", Qt::CaseInsensitive))
{
return RESINSIGHT_PROJECT_FILE;
}
return NOT_A_VALID_IMPORT_FILE;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::defaultDirectoryLabel(RiaDefines::ImportFileType fileType)
{
QString defaultDirLabel;
if (fileType == ANY_ECLIPSE_FILE)
{
defaultDirLabel = "GENERAL_DATA";
}
else if (fileType & ECLIPSE_RESULT_GRID)
{
defaultDirLabel = "BINARY_GRID";
}
else if (fileType & ECLIPSE_INPUT_FILE)
{
defaultDirLabel = "INPUT_FILES";
}
else if (fileType & ECLIPSE_SUMMARY_FILE)
{
// TODO: Summary files used "INPUT_FILES" as last used directory.
// Check if this is correct.
defaultDirLabel = "INPUT_FILES";
}
else if (fileType & GEOMECH_ODB_FILE)
{
defaultDirLabel = "GEOMECH_MODEL";
}
return defaultDirLabel;
}

View File

@ -40,6 +40,8 @@ namespace RiaDefines
UNDEFINED = 999
};
// WARNING: DO NOT CHANGE THE ORDER WITHOUT KNOWING WHAT YOU ARE DOING!
// You may well change the behaviour of property filters.
enum WellPathComponentType {
// Production Tube
WELL_PATH,
@ -53,10 +55,19 @@ namespace RiaDefines
// Well path construction features
CASING,
LINER,
PACKER
PACKER,
UNDEFINED_COMPONENT
};
enum MeshModeType
{
FULL_MESH,
FAULTS_MESH,
NO_MESH
};
bool isPerCellFaceResult(const QString& resultName);
bool isNativeCategoryResult(const QString& resultName);
QString undefinedResultName();
QString undefinedGridFaultName();
@ -69,6 +80,8 @@ namespace RiaDefines
QString ternarySaturationResultName();
QString combinedMultResultName();
QString eqlnumResultName();
QString riTranXResultName();
QString riTranYResultName();
QString riTranZResultName();
@ -131,6 +144,7 @@ namespace RiaDefines
};
double minimumDefaultValuePlot();
double minimumDefaultLogValuePlot();
double maximumDefaultValuePlot();
enum PhaseType {
@ -138,5 +152,31 @@ namespace RiaDefines
GAS_PHASE,
WATER_PHASE
};
enum ImportFileType
{
NOT_A_VALID_IMPORT_FILE = 0x00,
ECLIPSE_GRID_FILE = 0x01,
ECLIPSE_EGRID_FILE = 0x02,
ECLIPSE_INPUT_FILE = 0x04,
ECLIPSE_SUMMARY_FILE = 0x08,
GEOMECH_ODB_FILE = 0x10,
RESINSIGHT_PROJECT_FILE = 0x20,
ECLIPSE_RESULT_GRID = ECLIPSE_GRID_FILE | ECLIPSE_EGRID_FILE,
ANY_ECLIPSE_FILE = ECLIPSE_RESULT_GRID | ECLIPSE_INPUT_FILE | ECLIPSE_SUMMARY_FILE,
ANY_IMPORT_FILE = 0xFF
};
ImportFileType obtainFileTypeFromFileName(const QString& fileName);
QString defaultDirectoryLabel(ImportFileType fileTypes);
enum FontSettingType
{
SCENE_FONT,
ANNOTATION_FONT,
WELL_LABEL_FONT,
PLOT_FONT
};
};

View File

@ -0,0 +1,149 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2019- 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 "RiaEclipseFileNameTools.h"
#include "QFileInfo"
namespace caf
{
template<>
void caf::AppEnum<RiaEclipseFileNameTools::EclipseFileType>::setUp()
{
addItem(RiaEclipseFileNameTools::ECLIPSE_DATA, "DATA", "Data Deck");
addItem(RiaEclipseFileNameTools::ECLIPSE_GRID, "GRID", "Grid");
addItem(RiaEclipseFileNameTools::ECLIPSE_EGRID, "EGRID", "Grid");
addItem(RiaEclipseFileNameTools::ECLIPSE_UNRST, "UNRST", "Unified Restart");
addItem(RiaEclipseFileNameTools::ECLIPSE_SMSPEC, "SMSPEC", "Summary Specification");
addItem(RiaEclipseFileNameTools::ECLIPSE_UNSMRY, "UNSMR", "Summary Vectors");
addItem(RiaEclipseFileNameTools::RESINSIGHT_PROJECT, "rsp", "ResInsight Project");
}
} // End namespace caf
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiaEclipseFileNameTools::RiaEclipseFileNameTools(const QString& inputFilePath)
{
m_baseName = findBaseName(inputFilePath);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiaEclipseFileNameTools::findRelatedSummarySpecFile()
{
return relatedFilePath(ECLIPSE_SMSPEC);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiaEclipseFileNameTools::findRelatedGridFile()
{
QString candidate = relatedFilePath(ECLIPSE_EGRID);
if (!candidate.isEmpty())
{
return candidate;
}
return relatedFilePath(ECLIPSE_GRID);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiaEclipseFileNameTools::findRelatedDataFile()
{
return relatedFilePath(ECLIPSE_DATA);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaEclipseFileNameTools::isProjectFile(const QString& fileName)
{
return hasMatchingSuffix(fileName, RESINSIGHT_PROJECT);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaEclipseFileNameTools::isGridFile(const QString& fileName)
{
if (hasMatchingSuffix(fileName, ECLIPSE_EGRID))
{
return true;
}
return hasMatchingSuffix(fileName, ECLIPSE_GRID);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaEclipseFileNameTools::isSummarySpecFile(const QString& fileName)
{
return hasMatchingSuffix(fileName, ECLIPSE_SMSPEC);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiaEclipseFileNameTools::findBaseName(const QString& inputFilePath) const
{
QFileInfo fi(inputFilePath);
return fi.baseName();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiaEclipseFileNameTools::relatedFilePath(EclipseFileType fileType) const
{
const QString extension = caf::AppEnum<EclipseFileType>::text(fileType);
const QString completeFilePath = m_baseName + "." + extension;
QFileInfo fi(completeFilePath);
if (fi.exists())
{
return fi.absoluteFilePath();
}
return "";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaEclipseFileNameTools::hasMatchingSuffix(const QString& fileName, EclipseFileType fileType)
{
QFileInfo fi(fileName);
QString suffix = fi.completeSuffix();
if (suffix.compare(caf::AppEnum<EclipseFileType>::text(fileType), Qt::CaseInsensitive) == 0)
{
return true;
}
return false;
}

View File

@ -0,0 +1,64 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2019- 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 "cafAppEnum.h"
#include <QString>
#include <vector>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
class RiaEclipseFileNameTools
{
public:
enum EclipseFileType
{
ECLIPSE_DATA,
ECLIPSE_GRID,
ECLIPSE_EGRID,
ECLIPSE_UNRST,
ECLIPSE_SMSPEC,
ECLIPSE_UNSMRY,
RESINSIGHT_PROJECT,
UNKNOWN
};
public:
explicit RiaEclipseFileNameTools(const QString& fileName);
QString findRelatedGridFile();
QString findRelatedSummarySpecFile();
QString findRelatedDataFile();
static bool isProjectFile(const QString& fileName);
static bool isGridFile(const QString& fileName);
static bool isSummarySpecFile(const QString& fileName);
private:
QString findBaseName(const QString& inputFilePath) const;
QString relatedFilePath(EclipseFileType fileType) const;
static bool hasMatchingSuffix(const QString& fileName, EclipseFileType fileType);
private:
QString m_baseName;
};

View File

@ -0,0 +1,131 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017 Statoil 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 "RiaFontCache.h"
#include "cafAppEnum.h"
#include "cafFixedAtlasFont.h"
namespace caf
{
template<>
void RiaFontCache::FontSizeType::setUp()
{
addItem(RiaFontCache::FONT_SIZE_8, "8", "8");
addItem(RiaFontCache::FONT_SIZE_10, "10", "10");
addItem(RiaFontCache::FONT_SIZE_12, "12", "12");
addItem(RiaFontCache::FONT_SIZE_14, "14", "14");
addItem(RiaFontCache::FONT_SIZE_16, "16", "16");
addItem(RiaFontCache::FONT_SIZE_24, "24", "24");
addItem(RiaFontCache::FONT_SIZE_32, "32", "32");
setDefault(RiaFontCache::FONT_SIZE_8);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::FixedAtlasFont::FontSize mapToAtlasFontSize(RiaFontCache::FontSize fontSize)
{
switch (fontSize)
{
case RiaFontCache::FONT_SIZE_8:
return caf::FixedAtlasFont::POINT_SIZE_8;
case RiaFontCache::FONT_SIZE_10:
return caf::FixedAtlasFont::POINT_SIZE_10;
case RiaFontCache::FONT_SIZE_12:
return caf::FixedAtlasFont::POINT_SIZE_12;
case RiaFontCache::FONT_SIZE_14:
return caf::FixedAtlasFont::POINT_SIZE_14;
case RiaFontCache::FONT_SIZE_16:
return caf::FixedAtlasFont::POINT_SIZE_16;
case RiaFontCache::FONT_SIZE_24:
return caf::FixedAtlasFont::POINT_SIZE_24;
case RiaFontCache::FONT_SIZE_32:
return caf::FixedAtlasFont::POINT_SIZE_32;
default:
return caf::FixedAtlasFont::POINT_SIZE_16;
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::map<RiaFontCache::FontSize, cvf::ref<caf::FixedAtlasFont>> RiaFontCache::ms_fonts;
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::ref<caf::FixedAtlasFont> RiaFontCache::getFont(FontSize size)
{
if (ms_fonts.count(size) == 0)
{
auto newFont = new caf::FixedAtlasFont(mapToAtlasFontSize(size));
ms_fonts.insert(std::make_pair(size, newFont));
}
return ms_fonts[size];
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RiaFontCache::pointSizeFromFontSizeEnum(FontSize fontSize)
{
switch (fontSize)
{
case RiaFontCache::FONT_SIZE_8:
return 8;
case RiaFontCache::FONT_SIZE_10:
return 10;
case RiaFontCache::FONT_SIZE_12:
return 12;
case RiaFontCache::FONT_SIZE_14:
return 14;
case RiaFontCache::FONT_SIZE_16:
return 16;
case RiaFontCache::FONT_SIZE_24:
return 24;
case RiaFontCache::FONT_SIZE_32:
return 32;
default:
return 16;
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiaFontCache::FontSize RiaFontCache::fontSizeEnumFromPointSize(int pointSize)
{
std::vector<FontSize> allValues =
{ FONT_SIZE_8, FONT_SIZE_10, FONT_SIZE_12, FONT_SIZE_14, FONT_SIZE_16, FONT_SIZE_24, FONT_SIZE_32 };
FontSize closestEnumValue = FONT_SIZE_8;
int closestDiff = std::numeric_limits<int>::max();
for (FontSize enumValue : allValues)
{
int diff = std::abs(pointSizeFromFontSizeEnum(enumValue) - pointSize);
if (diff < closestDiff)
{
closestEnumValue = enumValue;
closestDiff = diff;
}
}
return closestEnumValue;
}

View File

@ -0,0 +1,59 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017 Statoil 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 "cvfBase.h"
#include "cvfObject.h"
#include <map>
namespace caf
{
class FixedAtlasFont;
template<typename T> class AppEnum;
}
class RimSummaryCaseCollection;
//==================================================================================================
///
//==================================================================================================
class RiaFontCache
{
public:
enum FontSize
{
FONT_SIZE_8,
FONT_SIZE_10,
FONT_SIZE_12,
FONT_SIZE_14,
FONT_SIZE_16,
FONT_SIZE_24,
FONT_SIZE_32
};
typedef caf::AppEnum<FontSize> FontSizeType;
static cvf::ref<caf::FixedAtlasFont> getFont(FontSize fontSize);
static int pointSizeFromFontSizeEnum(FontSize fontSize);
static FontSize fontSizeEnumFromPointSize(int pointSize);
private:
static std::map<FontSize, cvf::ref<caf::FixedAtlasFont>> ms_fonts;
};

View File

@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018 Statoil ASA
// Copyright (C) 2018- 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

View File

@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018 Statoil ASA
// Copyright (C) 2018- 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

View File

@ -19,9 +19,6 @@
#include "RiaApplication.h"
#include "RiaLogging.h"
#include "RiuMainWindow.h"
#include "RiuMessagePanel.h"
int main(int argc, char *argv[])
{
RiaLogging::loggerInstance()->setLevel(RI_LL_DEBUG);
@ -36,24 +33,9 @@ int main(int argc, char *argv[])
{
return unitTestResult;
}
RiuMainWindow window;
QString platform = cvf::System::is64Bit() ? "(64bit)" : "(32bit)";
window.setWindowTitle("ResInsight " + platform);
window.setDefaultWindowSize();
window.setDefaultToolbarVisibility();
window.loadWinGeoAndDockToolBarLayout();
window.showWindow();
// Create plot main window to be able to set expanded state on created objects
// The plot window is hidden by default
RiaApplication::instance()->getOrCreateMainPlotWindow();
if (app.parseArguments())
{
RiaLogging::setLoggerInstance(new RiuMessagePanelLogger(window.messagePanel()));
RiaLogging::loggerInstance()->setLevel(RI_LL_DEBUG);
int exitCode = 0;
try
{
@ -70,13 +52,9 @@ int main(int argc, char *argv[])
throw;
}
RiaLogging::deleteLoggerInstance();
return exitCode;
}
RiaLogging::deleteLoggerInstance();
return 0;
}

View File

@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Statoil ASA
// Copyright (C) 2018- 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
@ -33,6 +33,7 @@
#include "cafPdmUiListEditor.h"
#include "cafPdmUiPushButtonEditor.h"
#include "cafPdmUiTreeSelectionEditor.h"
#include "RigEclipseResultInfo.h"
//==================================================================================================
///
@ -81,10 +82,10 @@ void RiaMemoryCleanup::clearSelectedResultsFromMemory()
RigCaseCellResultsData* caseData = eclipseCase->results(RiaDefines::MATRIX_MODEL);
if (caseData)
{
std::vector<RigEclipseResultInfo> resultsToDelete = selectedEclipseResults();
for (const RigEclipseResultInfo& resultInfo : resultsToDelete)
std::vector<RigEclipseResultAddress> resultsToDelete = selectedEclipseResults();
for (const RigEclipseResultAddress& resultAddr : resultsToDelete)
{
caseData->clearScalarResult(resultInfo);
caseData->clearScalarResult(resultAddr);
}
}
}
@ -129,9 +130,9 @@ std::vector<RigFemResultAddress> RiaMemoryCleanup::selectedGeoMechResults() cons
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RigEclipseResultInfo> RiaMemoryCleanup::selectedEclipseResults() const
std::vector<RigEclipseResultAddress> RiaMemoryCleanup::selectedEclipseResults() const
{
std::vector<RigEclipseResultInfo> results;
std::vector<RigEclipseResultAddress> results;
if (dynamic_cast<const RimEclipseCase*>(m_case()))
{
for (size_t index : m_resultsToDelete())
@ -170,9 +171,9 @@ std::set<RigFemResultAddress> RiaMemoryCleanup::findGeoMechCaseResultsInUse() co
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::set<RigEclipseResultInfo> RiaMemoryCleanup::findEclipseResultsInUse() const
std::set<RigEclipseResultAddress> RiaMemoryCleanup::findEclipseResultsInUse() const
{
std::set<RigEclipseResultInfo> resultsInUse;
std::set<RigEclipseResultAddress> resultsInUse;
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(m_case());
if (eclipseCase)
{
@ -180,10 +181,11 @@ std::set<RigEclipseResultInfo> RiaMemoryCleanup::findEclipseResultsInUse() const
eclipseCase->descendantsIncludingThisOfType(eclipseResultDefs);
for (RimEclipseResultDefinition* resultDef : eclipseResultDefs)
{
RigEclipseResultInfo resultInfo(resultDef->resultType(), resultDef->resultVariable());
resultsInUse.insert(resultInfo);
RigEclipseResultAddress resultAddr(resultDef->resultType(), resultDef->resultVariable());
resultsInUse.insert(resultAddr);
}
}
return resultsInUse;
}
@ -237,20 +239,23 @@ QList<caf::PdmOptionItemInfo> RiaMemoryCleanup::calculateValueOptions(const caf:
RimGeoMechCase* geoMechCase = dynamic_cast<RimGeoMechCase*>(m_case());
if (eclipseCase)
{
std::set<RigEclipseResultInfo> resultsInUse = findEclipseResultsInUse();
std::set<RigEclipseResultAddress> resultsInUse = findEclipseResultsInUse();
RigCaseCellResultsData* caseData = eclipseCase->results(RiaDefines::MATRIX_MODEL);
if (caseData)
{
m_eclipseResultAddresses = caseData->infoForEachResultIndex();
m_eclipseResultAddresses = caseData->existingResults();
for (size_t i = 0; i < m_eclipseResultAddresses.size(); ++i)
{
const RigEclipseResultInfo& result = m_eclipseResultAddresses[i];
if (caseData->isResultLoaded(result))
const RigEclipseResultAddress& resultAddr = m_eclipseResultAddresses[i];
if (caseData->isResultLoaded(resultAddr))
{
bool inUse = resultsInUse.count(result);
QString posText = caf::AppEnum<RiaDefines::ResultCatType>::uiTextFromIndex(result.resultType());
QString resultsText = QString("%1, %2").arg(posText).arg(result.resultName());
bool inUse = resultsInUse.count(resultAddr);
const RigEclipseResultInfo* resInfo = caseData->resultInfo(resultAddr);
QString posText = caf::AppEnum<RiaDefines::ResultCatType>::uiTextFromIndex(resInfo->resultType());
QString resultsText = QString("%1, %2").arg(posText).arg(resInfo->resultName());
if (inUse)
{
resultsText += QString(" [used in view]");

View File

@ -1,25 +1,23 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Statoil ASA
//
// Copyright (C) 2018- 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>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RigFemResultAddress.h"
#include "RigEclipseResultInfo.h"
#include "cafPdmField.h"
#include "cafPdmChildArrayField.h"
@ -29,6 +27,8 @@
class RimCase;
class Rim3dView;
class RigFemResultAddress;
class RigEclipseResultAddress;
class RiaMemoryCleanup : public caf::PdmObject
{
@ -42,9 +42,9 @@ protected:
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
private:
std::vector<RigFemResultAddress> selectedGeoMechResults() const;
std::vector<RigEclipseResultInfo> selectedEclipseResults() const;
std::vector<RigEclipseResultAddress> selectedEclipseResults() const;
std::set<RigFemResultAddress> findGeoMechCaseResultsInUse() const;
std::set<RigEclipseResultInfo> findEclipseResultsInUse() const;
std::set<RigEclipseResultAddress> findEclipseResultsInUse() const;
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly) override;
@ -54,6 +54,6 @@ private:
caf::PdmPtrField<RimCase*> m_case;
caf::PdmField<std::vector<size_t>> m_resultsToDelete;
std::vector<RigFemResultAddress> m_geomResultAddresses;
std::vector<RigEclipseResultInfo> m_eclipseResultAddresses;
std::vector<RigEclipseResultAddress> m_eclipseResultAddresses;
caf::PdmField<bool> m_performDelete;
};

View File

@ -1,6 +1,7 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2011- Statoil ASA
// Copyright (C) 2019- Equinor ASA
// Copyright (C) 2011-2018 Statoil ASA
// Copyright (C) 2013- Ceetron Solutions AS
// Copyright (C) 2011-2012 Ceetron AS
//
@ -20,9 +21,11 @@
#include "RiaPreferences.h"
#include "RiaColorTables.h"
#include "RifReaderSettings.h"
#include "cafPdmFieldCvfColor.h"
#include "cafPdmUiComboBoxEditor.h"
#include "cafPdmUiCheckBoxEditor.h"
#include "cafPdmUiFieldHandle.h"
#include "cafPdmUiFilePathEditor.h"
@ -64,15 +67,20 @@ RiaPreferences::RiaPreferences(void)
CAF_PDM_InitField(&ssihubAddress, "ssihubAddress", QString("http://"), "SSIHUB Address", "", "", "");
ssihubAddress.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::TOP);
CAF_PDM_InitField(&defaultGridLines, "defaultGridLines", true, "Gridlines", "", "", "");
CAF_PDM_InitField(&defaultGridLineColors, "defaultGridLineColors", cvf::Color3f(0.92f, 0.92f, 0.92f), "Mesh Color", "", "", "");
CAF_PDM_InitField(&defaultFaultGridLineColors, "defaultFaultGridLineColors", cvf::Color3f(0.08f, 0.08f, 0.08f), "Mesh Color Along Faults", "", "", "");
CAF_PDM_InitField(&defaultWellLabelColor, "defaultWellLableColor", cvf::Color3f(0.92f, 0.92f, 0.92f), "Well Label Color", "", "The default well label color in new views", "");
CAF_PDM_InitFieldNoDefault(&defaultMeshModeType, "defaultMeshModeType", "Show Grid Lines", "", "", "");
CAF_PDM_InitField(&defaultGridLineColors, "defaultGridLineColors", RiaColorTables::defaultGridLineColor(), "Mesh Color", "", "", "");
CAF_PDM_InitField(&defaultFaultGridLineColors, "defaultFaultGridLineColors", RiaColorTables::defaultFaultLineColor(), "Mesh Color Along Faults", "", "", "");
CAF_PDM_InitField(&defaultWellLabelColor, "defaultWellLableColor", RiaColorTables::defaultWellLabelColor(), "Well Label Color", "", "The default well label color in new views", "");
CAF_PDM_InitField(&defaultViewerBackgroundColor, "defaultViewerBackgroundColor", cvf::Color3f(0.69f, 0.77f, 0.87f), "Viewer Background", "", "The viewer background color for new views", "");
CAF_PDM_InitField(&defaultViewerBackgroundColor, "defaultViewerBackgroundColor", RiaColorTables::defaultViewerBackgroundColor(), "Viewer Background", "", "The viewer background color for new views", "");
CAF_PDM_InitField(&defaultScaleFactorZ, "defaultScaleFactorZ", 5, "Default Z Scale Factor", "", "", "");
CAF_PDM_InitField(&fontSizeInScene, "fontSizeInScene", QString("8"), "Font Size", "", "", "");
CAF_PDM_InitField(&defaultScaleFactorZ, "defaultScaleFactorZ", 5, "Default Z Scale Factor", "", "", "");
CAF_PDM_InitFieldNoDefault(&defaultSceneFontSize, "fontSizeInScene", "Viewer Font Size", "", "", "");
CAF_PDM_InitFieldNoDefault(&defaultAnnotationFontSize, "defaultAnnotationFontSize", "Annotation Font Size", "", "", "");
CAF_PDM_InitFieldNoDefault(&defaultWellLabelFontSize, "wellLabelFontSize", "Well Label Font Size", "", "", "");
CAF_PDM_InitFieldNoDefault(&defaultPlotFontSize, "defaultPlotFontSize", "Plot Font Size", "", "", "");
defaultPlotFontSize = RiaFontCache::FONT_SIZE_8;
CAF_PDM_InitField(&showLasCurveWithoutTvdWarning, "showLasCurveWithoutTvdWarning", true, "Show LAS Curve Without TVD Warning", "", "", "");
showLasCurveWithoutTvdWarning.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
@ -90,7 +98,8 @@ RiaPreferences::RiaPreferences(void)
CAF_PDM_InitField(&m_includeFractureDebugInfoFile, "includeFractureDebugInfoFile", false, "Include Fracture Debug Info for Completion Export", "", "", "");
m_includeFractureDebugInfoFile.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
CAF_PDM_InitField(&showLegendBackground, "showLegendBackground", true, "Enable Legend Background", "", "", "");
CAF_PDM_InitField(&showLegendBackground, "showLegendBackground", true, "Show Box around Legends", "", "", "");
showLegendBackground.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
CAF_PDM_InitFieldNoDefault(&lastUsedProjectFileName,"lastUsedProjectFileName", "Last Used Project File", "", "", "");
lastUsedProjectFileName.uiCapability()->setUiHidden(true);
@ -109,6 +118,12 @@ RiaPreferences::RiaPreferences(void)
m_holoLensExportFolder.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::TOP);
m_holoLensExportFolder.uiCapability()->setUiEditorTypeName(caf::PdmUiFilePathEditor::uiEditorTypeName());
CAF_PDM_InitField(&holoLensDisableCertificateVerification, "holoLensDisableCertificateVerification", false, "Disable SSL Certificate Verification (HoloLens)", "", "", "");
holoLensDisableCertificateVerification.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
CAF_PDM_InitField(&m_showProjectChangedDialog, "showProjectChangedDialog", true, "Show 'Project has changed' dialog", "", "", "");
m_showProjectChangedDialog.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
CAF_PDM_InitFieldNoDefault(&m_readerSettings, "readerSettings", "Reader Settings", "", "", "");
m_readerSettings = new RifReaderSettings;
@ -154,7 +169,10 @@ void RiaPreferences::defineEditorAttribute(const caf::PdmFieldHandle* field, QSt
field == &m_appendFieldKeywordToToolTipText ||
field == &m_showTestToolbar ||
field == &m_includeFractureDebugInfoFile ||
field == &showLasCurveWithoutTvdWarning)
field == &showLasCurveWithoutTvdWarning ||
field == &holoLensDisableCertificateVerification ||
field == &m_showProjectChangedDialog ||
field == &showLegendBackground)
{
caf::PdmUiCheckBoxEditorAttribute* myAttr = dynamic_cast<caf::PdmUiCheckBoxEditorAttribute*>(attribute);
if (myAttr)
@ -170,6 +188,12 @@ void RiaPreferences::defineEditorAttribute(const caf::PdmFieldHandle* field, QSt
myAttr->m_selectDirectory = true;
}
}
if (field == &defaultSceneFontSize || field == &defaultWellLabelFontSize ||
field == &defaultAnnotationFontSize || field == &defaultPlotFontSize)
{
caf::PdmUiComboBoxEditorAttribute* myAttr = dynamic_cast<caf::PdmUiComboBoxEditorAttribute*>(attribute);
myAttr->minimumContentsLength = 2;
}
}
//--------------------------------------------------------------------------------------------------
@ -179,26 +203,30 @@ void RiaPreferences::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
{
if (uiConfigName == m_tabNames[0])
{
caf::PdmUiGroup* defaultSettingsGroup = uiOrdering.addNewGroup("Default Settings");
defaultSettingsGroup->add(&defaultViewerBackgroundColor);
defaultSettingsGroup->add(&defaultGridLines);
defaultSettingsGroup->add(&defaultGridLineColors);
defaultSettingsGroup->add(&defaultFaultGridLineColors);
defaultSettingsGroup->add(&defaultWellLabelColor);
defaultSettingsGroup->add(&fontSizeInScene);
defaultSettingsGroup->add(&defaultScaleFactorZ);
defaultSettingsGroup->add(&showLegendBackground);
caf::PdmUiGroup* viewsGroup = uiOrdering.addNewGroup("3D Views");
caf::PdmUiGroup* colorGroup = uiOrdering.addNewGroup("Default Colors");
colorGroup->add(&defaultViewerBackgroundColor);
colorGroup->add(&defaultGridLineColors, false);
colorGroup->add(&defaultFaultGridLineColors);
colorGroup->add(&defaultWellLabelColor, false);
caf::PdmUiGroup* fontGroup = uiOrdering.addNewGroup("Default Font Sizes");
fontGroup->add(&defaultSceneFontSize);
fontGroup->add(&defaultAnnotationFontSize, false);
fontGroup->add(&defaultWellLabelFontSize);
fontGroup->add(&defaultPlotFontSize, false);
caf::PdmUiGroup* viewsGroup = uiOrdering.addNewGroup("3d Views");
viewsGroup->add(&defaultMeshModeType);
viewsGroup->add(&navigationPolicy);
viewsGroup->add(&defaultScaleFactorZ);
viewsGroup->add(&showLegendBackground);
viewsGroup->add(&useShaders);
viewsGroup->add(&showHud);
caf::PdmUiGroup* otherGroup = uiOrdering.addNewGroup("Other");
otherGroup->add(&ssihubAddress);
otherGroup->add(&showLasCurveWithoutTvdWarning);
otherGroup->add(&holoLensDisableCertificateVerification);
}
else if (uiConfigName == m_tabNames[1])
{
@ -207,7 +235,7 @@ void RiaPreferences::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
newCaseBehaviourGroup->add(&loadAndShowSoil);
m_readerSettings->defineUiOrdering(uiConfigName, *newCaseBehaviourGroup);
caf::PdmUiGroup* restartBehaviourGroup = uiOrdering.addNewGroup("Origin Files");
restartBehaviourGroup->add(&summaryRestartFilesShowImportDialog);
caf::PdmUiGroup* summaryImportOptionGroup = restartBehaviourGroup->addNewGroup("Origin Summary Files");
@ -229,6 +257,9 @@ void RiaPreferences::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
{
uiOrdering.add(&m_appendClassNameToUiText);
uiOrdering.add(&m_appendFieldKeywordToToolTipText);
uiOrdering.add(&m_showProjectChangedDialog);
uiOrdering.add(&m_showTestToolbar);
uiOrdering.add(&m_includeFractureDebugInfoFile);
uiOrdering.add(&m_holoLensExportFolder);
@ -245,21 +276,7 @@ QList<caf::PdmOptionItemInfo> RiaPreferences::calculateValueOptions(const caf::P
QList<caf::PdmOptionItemInfo> options;
*useOptionsOnly = true;
if (&fontSizeInScene == fieldNeedingOptions)
{
QStringList fontSizes;
fontSizes << "8";
fontSizes << "12";
fontSizes << "16";
fontSizes << "24";
fontSizes << "32";
for (int oIdx = 0; oIdx < fontSizes.size(); ++oIdx)
{
options.push_back(caf::PdmOptionItemInfo(fontSizes[oIdx], fontSizes[oIdx]));
}
}
else if (fieldNeedingOptions == &gridImportMode)
if (fieldNeedingOptions == &gridImportMode)
{
// Manual option handling in order to one only a subset of the enum values
SummaryRestartFilesImportModeType skip(RiaPreferences::NOT_IMPORT);
@ -320,6 +337,19 @@ bool RiaPreferences::includeFractureDebugInfoFile() const
return RiaApplication::enableDevelopmentFeatures() && m_includeFractureDebugInfoFile();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaPreferences::showProjectChangedDialog() const
{
if (!RiaApplication::enableDevelopmentFeatures())
{
return true;
}
return m_showProjectChangedDialog();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -328,3 +358,15 @@ QString RiaPreferences::holoLensExportFolder() const
return m_holoLensExportFolder();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::map<RiaDefines::FontSettingType, RiaFontCache::FontSize> RiaPreferences::defaultFontSizes() const
{
std::map<RiaDefines::FontSettingType, RiaFontCache::FontSize> fontSizes;
fontSizes[RiaDefines::SCENE_FONT] = defaultSceneFontSize();
fontSizes[RiaDefines::ANNOTATION_FONT] = defaultAnnotationFontSize();
fontSizes[RiaDefines::WELL_LABEL_FONT] = defaultWellLabelFontSize();
fontSizes[RiaDefines::PLOT_FONT] = defaultPlotFontSize();
return fontSizes;
}

View File

@ -1,6 +1,7 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2011- Statoil ASA
// Copyright (C) 2019- Equinor ASA
// Copyright (C) 2011-2018 Statoil ASA
// Copyright (C) 2013- Ceetron Solutions AS
// Copyright (C) 2011-2012 Ceetron AS
//
@ -21,6 +22,9 @@
#pragma once
#include "RiaApplication.h"
#include "RiaDefines.h"
#include "RiaFontCache.h"
#include "cafAppEnum.h"
#include "cafPdmChildField.h"
@ -30,6 +34,8 @@
// Include to make Pdm work for cvf::Color
#include "cafPdmFieldCvfColor.h"
#include <map>
class RifReaderSettings;
class RiaPreferences : public caf::PdmObject
@ -39,6 +45,7 @@ class RiaPreferences : public caf::PdmObject
public:
enum SummaryRestartFilesImportMode { IMPORT, NOT_IMPORT, SEPARATE_CASES };
typedef caf::AppEnum<SummaryRestartFilesImportMode> SummaryRestartFilesImportModeType;
typedef RiaFontCache::FontSizeType FontSizeType;
RiaPreferences(void);
~RiaPreferences(void) override;
@ -52,8 +59,11 @@ public:
bool appendFieldKeywordToToolTipText() const;
bool showTestToolbar() const;
bool includeFractureDebugInfoFile() const;
bool showProjectChangedDialog() const;
QString holoLensExportFolder() const;
std::map<RiaDefines::FontSettingType, RiaFontCache::FontSize> defaultFontSizes() const;
public: // Pdm Fields
caf::PdmField<caf::AppEnum< RiaApplication::RINavigationPolicy > > navigationPolicy;
@ -65,14 +75,20 @@ public: // Pdm Fields
caf::PdmField<QString> ssihubAddress;
caf::PdmField<int> defaultScaleFactorZ;
caf::PdmField<bool> defaultGridLines;
caf::PdmField<caf::AppEnum<RiaDefines::MeshModeType>> defaultMeshModeType;
caf::PdmField<int> defaultScaleFactorZ;
caf::PdmField<cvf::Color3f> defaultGridLineColors;
caf::PdmField<cvf::Color3f> defaultFaultGridLineColors;
caf::PdmField<cvf::Color3f> defaultViewerBackgroundColor;
caf::PdmField<cvf::Color3f> defaultWellLabelColor;
caf::PdmField<bool> showLasCurveWithoutTvdWarning;
caf::PdmField<QString> fontSizeInScene;
caf::PdmField<bool> showLasCurveWithoutTvdWarning;
caf::PdmField<FontSizeType> defaultSceneFontSize;
caf::PdmField<FontSizeType> defaultWellLabelFontSize;
caf::PdmField<FontSizeType> defaultAnnotationFontSize;
caf::PdmField<FontSizeType> defaultPlotFontSize;
caf::PdmField<bool> showLegendBackground;
caf::PdmField<bool> useShaders;
@ -87,6 +103,8 @@ public: // Pdm Fields
caf::PdmField<SummaryRestartFilesImportModeType> summaryImportMode;
caf::PdmField<SummaryRestartFilesImportModeType> gridImportMode;
caf::PdmField<bool> holoLensDisableCertificateVerification;
protected:
void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override;
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
@ -96,8 +114,12 @@ private:
caf::PdmChildField<RifReaderSettings*> m_readerSettings;
caf::PdmField<bool> m_appendClassNameToUiText;
caf::PdmField<bool> m_appendFieldKeywordToToolTipText;
caf::PdmField<bool> m_showProjectChangedDialog;
caf::PdmField<bool> m_showTestToolbar;
caf::PdmField<bool> m_includeFractureDebugInfoFile;
caf::PdmField<QString> m_holoLensExportFolder;
QStringList m_tabNames;
QStringList m_tabNames;
};

View File

@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Statoil ASA
//
// Copyright (C) 2018- 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>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////

View File

@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Statoil ASA
//
// Copyright (C) 2018- 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>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////

View File

@ -7,6 +7,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RiaColorTools.h
${CMAKE_CURRENT_LIST_DIR}/RiaEclipseUnitTools.h
${CMAKE_CURRENT_LIST_DIR}/RiaImageCompareReporter.h
${CMAKE_CURRENT_LIST_DIR}/RiaImageFileCompare.h
${CMAKE_CURRENT_LIST_DIR}/RiaImageTools.h
${CMAKE_CURRENT_LIST_DIR}/RiaLogging.h
${CMAKE_CURRENT_LIST_DIR}/RiaProjectModifier.h
${CMAKE_CURRENT_LIST_DIR}/RiaRegressionTest.h
@ -35,9 +36,9 @@ ${CMAKE_CURRENT_LIST_DIR}/RiaWeightedGeometricMeanCalculator.h
${CMAKE_CURRENT_LIST_DIR}/RiaWeightedHarmonicMeanCalculator.h
${CMAKE_CURRENT_LIST_DIR}/RiaOptionItemFactory.h
${CMAKE_CURRENT_LIST_DIR}/RiaGitDiff.h
${CMAKE_CURRENT_LIST_DIR}/RiaQIconTools.h
${CMAKE_CURRENT_LIST_DIR}/RiaCellDividingTools.h
${CMAKE_CURRENT_LIST_DIR}/RiaFieldHandleTools.h
${CMAKE_CURRENT_LIST_DIR}/RiaBoundingBoxTools.h
)
set (SOURCE_GROUP_SOURCE_FILES
@ -48,6 +49,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RiaColorTools.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaEclipseUnitTools.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaImageCompareReporter.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaImageFileCompare.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaImageTools.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaLogging.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaProjectModifier.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaRegressionTest.cpp
@ -73,9 +75,9 @@ ${CMAKE_CURRENT_LIST_DIR}/RiaWeightedGeometricMeanCalculator.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaWeightedHarmonicMeanCalculator.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaOptionItemFactory.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaGitDiff.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaQIconTools.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaCellDividingTools.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaFieldHandleTools.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaBoundingBoxTools.cpp
)
list(APPEND CODE_HEADER_FILES

View File

@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017 Statoil 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>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@ -20,7 +20,9 @@
#include "RiaApplication.h"
#include "RiaBaseDefs.h"
#include "RiaEclipseFileNameTools.h"
#include "RiaImportEclipseCaseTools.h"
#include "RiaLogging.h"
#include "RiaPreferences.h"
#include "RiaProjectModifier.h"
#include "RiaRegressionTestRunner.h"
@ -30,48 +32,81 @@
#include "RiuMainWindow.h"
#include "RiuPlotMainWindow.h"
#include "RicfMessages.h"
#include "RicfCommandFileExecutor.h"
#include "RicfMessages.h"
#include "ExportCommands/RicSnapshotViewToFileFeature.h"
#include "ExportCommands/RicSnapshotAllPlotsToFileFeature.h"
#include "ExportCommands/RicSnapshotAllViewsToFileFeature.h"
#include "ExportCommands/RicSnapshotViewToFileFeature.h"
#include "RicImportSummaryCasesFeature.h"
#include "cvfProgramOptions.h"
#include "cvfqtUtils.h"
#include "cafUtils.h"
#include <QString>
#include <QStringList>
#include <QCoreApplication>
#include <QFile>
#include <QString>
#include <QStringList>
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RiaArgumentParser::parseArguments()
{
cvf::ProgramOptions progOpt;
progOpt.registerOption("last", "", "Open last used project.");
progOpt.registerOption("project", "<filename>", "Open project file <filename>.", cvf::ProgramOptions::SINGLE_VALUE);
progOpt.registerOption("case", "<casename>", "Import Eclipse case <casename> (do not include the .GRID/.EGRID extension.)", cvf::ProgramOptions::MULTI_VALUE);
progOpt.registerOption("startdir", "<folder>", "Set startup directory.", cvf::ProgramOptions::SINGLE_VALUE);
progOpt.registerOption("savesnapshots", "all|views|plots", "Save snapshot of all views or plots to project file location sub folder 'snapshots'. Option 'all' will include both views and plots. Application closes after snapshots have been written.", cvf::ProgramOptions::OPTIONAL_MULTI_VALUE);
progOpt.registerOption("size", "<width> <height>", "Set size of the main application window.", cvf::ProgramOptions::MULTI_VALUE);
progOpt.registerOption("replaceCase", "[<caseId>] <newGridFile>", "Replace grid in <caseId> or first case with <newgridFile>. Repeat parameter for multiple replace operations.", cvf::ProgramOptions::MULTI_VALUE, cvf::ProgramOptions::COMBINE_REPEATED);
progOpt.registerOption("replaceSourceCases", "[<caseGroupId>] <gridListFile>", "Replace source cases in <caseGroupId> or first grid case group with the grid files listed in the <gridListFile> file. Repeat parameter for multiple replace operations.", cvf::ProgramOptions::MULTI_VALUE, cvf::ProgramOptions::COMBINE_REPEATED);
progOpt.registerOption("replacePropertiesFolder", "[<caseId>] <newPropertiesFolder>", "Replace the folder containing property files for an eclipse input case.", cvf::ProgramOptions::MULTI_VALUE);
progOpt.registerOption("multiCaseSnapshots", "<gridListFile>", "For each grid file listed in the <gridListFile> file, replace the first case in the project and save snapshot of all views.", cvf::ProgramOptions::SINGLE_VALUE);
progOpt.registerOption("commandFile", "<commandfile>", "Execute the command file.", cvf::ProgramOptions::SINGLE_VALUE);
progOpt.registerOption("commandFileProject", "<filename>", "Project to use if performing case looping for command file. Used in conjunction with 'commandFileReplaceCases'.", cvf::ProgramOptions::SINGLE_VALUE);
progOpt.registerOption("commandFileReplaceCases", "[<caseId>] <caseListFile>", "Supply list of cases to replace in project, performing command file for each case.", cvf::ProgramOptions::SINGLE_VALUE);
progOpt.registerOption("help", "", "Displays help text.");
progOpt.registerOption("?", "", "Displays help text.");
progOpt.registerOption("regressiontest", "<folder>", "System command", cvf::ProgramOptions::SINGLE_VALUE);
progOpt.registerOption("updateregressiontestbase", "<folder>", "System command", cvf::ProgramOptions::SINGLE_VALUE);
progOpt.registerOption("unittest", "", "System command");
progOpt.registerOption("ignoreArgs", "", "Ignore all arguments. Mostly for testing purposes");
progOpt.registerOption("last", "", "Open last used project.");
progOpt.registerOption("project", "<filename>", "Open project file <filename>.", cvf::ProgramOptions::SINGLE_VALUE);
progOpt.registerOption("case",
"<casename>",
"Import Eclipse case <casename> (do not include the .GRID/.EGRID extension.)",
cvf::ProgramOptions::MULTI_VALUE);
progOpt.registerOption("startdir", "<folder>", "Set startup directory.", cvf::ProgramOptions::SINGLE_VALUE);
progOpt.registerOption("savesnapshots",
"all|views|plots",
"Save snapshot of all views or plots to project file location sub folder 'snapshots'. Option 'all' "
"will include both views and plots. Application closes after snapshots have been written.",
cvf::ProgramOptions::OPTIONAL_MULTI_VALUE);
progOpt.registerOption(
"size", "<width> <height>", "Set size of the main application window.", cvf::ProgramOptions::MULTI_VALUE);
progOpt.registerOption(
"replaceCase",
"[<caseId>] <newGridFile>",
"Replace grid in <caseId> or first case with <newgridFile>. Repeat parameter for multiple replace operations.",
cvf::ProgramOptions::MULTI_VALUE,
cvf::ProgramOptions::COMBINE_REPEATED);
progOpt.registerOption("replaceSourceCases",
"[<caseGroupId>] <gridListFile>",
"Replace source cases in <caseGroupId> or first grid case group with the grid files listed in the "
"<gridListFile> file. Repeat parameter for multiple replace operations.",
cvf::ProgramOptions::MULTI_VALUE,
cvf::ProgramOptions::COMBINE_REPEATED);
progOpt.registerOption("replacePropertiesFolder",
"[<caseId>] <newPropertiesFolder>",
"Replace the folder containing property files for an eclipse input case.",
cvf::ProgramOptions::MULTI_VALUE);
progOpt.registerOption("multiCaseSnapshots",
"<gridListFile>",
"For each grid file listed in the <gridListFile> file, replace the first case in the project and save "
"snapshot of all views.",
cvf::ProgramOptions::SINGLE_VALUE);
progOpt.registerOption("commandFile", "<commandfile>", "Execute the command file.", cvf::ProgramOptions::SINGLE_VALUE);
progOpt.registerOption(
"commandFileProject",
"<filename>",
"Project to use if performing case looping for command file. Used in conjunction with 'commandFileReplaceCases'.",
cvf::ProgramOptions::SINGLE_VALUE);
progOpt.registerOption("commandFileReplaceCases",
"[<caseId>] <caseListFile>",
"Supply list of cases to replace in project, performing command file for each case.",
cvf::ProgramOptions::SINGLE_VALUE);
progOpt.registerOption("help", "", "Displays help text.");
progOpt.registerOption("?", "", "Displays help text.");
progOpt.registerOption("regressiontest", "<folder>", "System command", cvf::ProgramOptions::SINGLE_VALUE);
progOpt.registerOption("updateregressiontestbase", "<folder>", "System command", cvf::ProgramOptions::SINGLE_VALUE);
progOpt.registerOption("unittest", "", "System command");
progOpt.registerOption("ignoreArgs", "", "Ignore all arguments. Mostly for testing purposes");
progOpt.setOptionPrefix(cvf::ProgramOptions::DOUBLE_DASH);
@ -89,21 +124,17 @@ bool RiaArgumentParser::parseArguments()
// If positional parameter functionality is to be supported, the test for existence of positionalParameters must be removed
// This is based on a pull request by @andlaus https://github.com/OPM/ResInsight/pull/162
if (!parseOk ||
progOpt.hasOption("help") ||
progOpt.hasOption("?") ||
progOpt.positionalParameters().size() > 0)
if (!parseOk || progOpt.hasOption("help") || progOpt.hasOption("?") || !progOpt.positionalParameters().empty())
{
#if defined(_MSC_VER) && defined(_WIN32)
RiaApplication::instance()->showFormattedTextInMessageBox(helpText);
#else
fprintf(stdout, "%s\n", helpText.toAscii().data());
fprintf(stdout, "%s\n", helpText.toLatin1().data());
fflush(stdout);
#endif
return false;
}
// Handling of the actual command line options
// --------------------------------------------------------
@ -116,6 +147,15 @@ bool RiaArgumentParser::parseArguments()
{
CVF_ASSERT(o.valueCount() == 1);
QString regressionTestPath = cvfqt::Utils::toQString(o.value(0));
// Use a logger writing to stdout instead of message panel
// This is useful when executing regression tests on a build server, and this is the reason for creating the logger when
// parsing the command line options
auto stdLogger = new RiaStdOutLogger;
stdLogger->setLevel(RI_LL_DEBUG);
RiaLogging::setLoggerInstance(stdLogger);
RiaRegressionTestRunner::instance()->executeRegressionTests(regressionTestPath, QStringList());
return false;
}
@ -137,15 +177,14 @@ bool RiaArgumentParser::parseArguments()
if (cvf::Option o = progOpt.option("size"))
{
RiuMainWindow* mainWnd = RiuMainWindow::instance();
int width = o.safeValue(0).toInt(-1);
int height = o.safeValue(1).toInt(-1);
int width = o.safeValue(0).toInt(-1);
int height = o.safeValue(1).toInt(-1);
if (mainWnd && width > 0 && height > 0)
{
mainWnd->resize(width, height);
}
}
QString projectFileName;
if (progOpt.hasOption("last"))
@ -159,23 +198,21 @@ bool RiaArgumentParser::parseArguments()
projectFileName = cvfqt::Utils::toQString(o.value(0));
}
if (!projectFileName.isEmpty())
{
if (cvf::Option o = progOpt.option("multiCaseSnapshots"))
{
QString gridListFile = cvfqt::Utils::toQString(o.safeValue(0));
std::vector<QString> gridFiles = RiaApplication::readFileListFromTextFile(gridListFile);
QString gridListFile = cvfqt::Utils::toQString(o.safeValue(0));
std::vector<QString> gridFiles = RiaApplication::readFileListFromTextFile(gridListFile);
RiaApplication::instance()->runMultiCaseSnapshots(projectFileName, gridFiles, "multiCaseSnapshots");
return false;
}
}
if (!projectFileName.isEmpty())
{
cvf::ref<RiaProjectModifier> projectModifier;
cvf::ref<RiaProjectModifier> projectModifier;
RiaApplication::ProjectLoadAction projectLoadAction = RiaApplication::PLA_NONE;
if (cvf::Option o = progOpt.option("replaceCase"))
@ -194,8 +231,8 @@ bool RiaArgumentParser::parseArguments()
size_t optionIdx = 0;
while (optionIdx < o.valueCount())
{
const int caseId = o.safeValue(optionIdx++).toInt(-1);
QString gridFileName = cvfqt::Utils::toQString(o.safeValue(optionIdx++));
const int caseId = o.safeValue(optionIdx++).toInt(-1);
QString gridFileName = cvfqt::Utils::toQString(o.safeValue(optionIdx++));
if (caseId != -1 && !gridFileName.isEmpty())
{
@ -213,7 +250,8 @@ bool RiaArgumentParser::parseArguments()
{
// One argument is available, use replace case for first occurrence in the project
std::vector<QString> gridFileNames = RiaApplication::readFileListFromTextFile(cvfqt::Utils::toQString(o.safeValue(0)));
std::vector<QString> gridFileNames =
RiaApplication::readFileListFromTextFile(cvfqt::Utils::toQString(o.safeValue(0)));
projectModifier->setReplaceSourceCasesFirstOccurrence(gridFileNames);
}
else
@ -221,10 +259,11 @@ bool RiaArgumentParser::parseArguments()
size_t optionIdx = 0;
while (optionIdx < o.valueCount())
{
const int groupId = o.safeValue(optionIdx++).toInt(-1);
std::vector<QString> gridFileNames = RiaApplication::readFileListFromTextFile(cvfqt::Utils::toQString(o.safeValue(optionIdx++)));
const int groupId = o.safeValue(optionIdx++).toInt(-1);
std::vector<QString> gridFileNames =
RiaApplication::readFileListFromTextFile(cvfqt::Utils::toQString(o.safeValue(optionIdx++)));
if (groupId != -1 && gridFileNames.size() > 0)
if (groupId != -1 && !gridFileNames.empty())
{
projectModifier->setReplaceSourceCasesById(groupId, gridFileNames);
}
@ -248,8 +287,8 @@ bool RiaArgumentParser::parseArguments()
size_t optionIdx = 0;
while (optionIdx < o.valueCount())
{
const int caseId = o.safeValue(optionIdx++).toInt(-1);
QString propertiesFolder = cvfqt::Utils::toQString(o.safeValue(optionIdx++));
const int caseId = o.safeValue(optionIdx++).toInt(-1);
QString propertiesFolder = cvfqt::Utils::toQString(o.safeValue(optionIdx++));
if (caseId != -1 && !propertiesFolder.isEmpty())
{
@ -262,51 +301,28 @@ bool RiaArgumentParser::parseArguments()
RiaApplication::instance()->loadProject(projectFileName, projectLoadAction, projectModifier.p());
}
if (cvf::Option o = progOpt.option("case"))
{
QStringList caseNames = cvfqt::Utils::toQStringList(o.values());
foreach (QString caseName, caseNames)
for (const QString& caseName : caseNames)
{
QString fileExtension = caf::Utils::fileExtension(caseName);
if (caf::Utils::fileExists(caseName) &&
(fileExtension == "EGRID" || fileExtension == "GRID"))
{
RiaImportEclipseCaseTools::openEclipseCasesFromFile(QStringList({ caseName }), nullptr, true);
}
else
{
QString caseFileNameWithExt = caseName + ".EGRID";
if (caf::Utils::fileExists(caseFileNameWithExt))
{
RiaImportEclipseCaseTools::openEclipseCasesFromFile(QStringList({ caseFileNameWithExt }), nullptr, true);
}
else
{
caseFileNameWithExt = caseName + ".GRID";
if (caf::Utils::fileExists(caseFileNameWithExt))
{
RiaImportEclipseCaseTools::openEclipseCasesFromFile(QStringList({ caseFileNameWithExt }), nullptr, true);
}
}
}
openCaseFromCommandLineParameter(caseName);
}
}
if (cvf::Option o = progOpt.option("savesnapshots"))
{
bool snapshotViews = false;
bool snapshotPlots = false;
QStringList snapshotItemTexts = cvfqt::Utils::toQStringList(o.values());
if (snapshotItemTexts.size() == 0)
if (snapshotItemTexts.empty())
{
// No options will keep backwards compatibility before we introduced snapshot of plots
snapshotViews = true;
}
for (QString s : snapshotItemTexts)
for (const QString& s : snapshotItemTexts)
{
if (s.toLower() == "all")
{
@ -331,9 +347,10 @@ bool RiaArgumentParser::parseArguments()
CVF_ASSERT(mainWnd);
mainWnd->hideAllDockWindows();
// 2016-11-09 : Location of snapshot folder was previously located in 'snapshot' folder
// 2016-11-09 : Location of snapshot folder was previously located in 'snapshot' folder
// relative to current working folder. Now harmonized to behave as RiuMainWindow::slotSnapshotAllViewsToFile()
QString absolutePathToSnapshotDir = RiaApplication::instance()->createAbsolutePathFromProjectRelativePath("snapshots");
QString absolutePathToSnapshotDir =
RiaApplication::instance()->createAbsolutePathFromProjectRelativePath("snapshots");
RicSnapshotAllViewsToFileFeature::exportSnapshotOfAllViewsIntoFolder(absolutePathToSnapshotDir);
mainWnd->loadWinGeoAndDockToolBarLayout();
@ -362,12 +379,12 @@ bool RiaArgumentParser::parseArguments()
QString commandFile = cvfqt::Utils::toQString(o.safeValue(0));
cvf::Option projectOption = progOpt.option("commandFileProject");
cvf::Option caseOption = progOpt.option("commandFileReplaceCases");
cvf::Option caseOption = progOpt.option("commandFileReplaceCases");
if (projectOption && caseOption)
{
projectFileName = cvfqt::Utils::toQString(projectOption.value(0));
std::vector<int> caseIds;
std::vector<int> caseIds;
std::vector<QString> caseListFiles;
if (caseOption.valueCount() == 1)
@ -379,8 +396,8 @@ bool RiaArgumentParser::parseArguments()
size_t optionIdx = 0;
while (optionIdx < caseOption.valueCount())
{
const int caseId = caseOption.safeValue(optionIdx++).toInt(-1);
QString caseListFile = cvfqt::Utils::toQString(caseOption.safeValue(optionIdx++));
const int caseId = caseOption.safeValue(optionIdx++).toInt(-1);
QString caseListFile = cvfqt::Utils::toQString(caseOption.safeValue(optionIdx++));
if (caseId != -1 && !caseListFile.isEmpty())
{
@ -392,8 +409,8 @@ bool RiaArgumentParser::parseArguments()
if (caseIds.empty() && !caseListFiles.empty())
{
QString caseListFile = caseListFiles[0];
std::vector<QString> caseFiles = RiaApplication::readFileListFromTextFile(caseListFile);
QString caseListFile = caseListFiles[0];
std::vector<QString> caseFiles = RiaApplication::readFileListFromTextFile(caseListFile);
for (const QString& caseFile : caseFiles)
{
RiaProjectModifier projectModifier;
@ -406,8 +423,8 @@ bool RiaArgumentParser::parseArguments()
{
CVF_ASSERT(caseIds.size() == caseListFiles.size());
std::vector< std::vector<QString> > allCaseFiles;
size_t maxFiles = 0;
std::vector<std::vector<QString>> allCaseFiles;
size_t maxFiles = 0;
for (size_t i = 0; i < caseIds.size(); ++i)
{
@ -443,11 +460,11 @@ bool RiaArgumentParser::parseArguments()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiaArgumentParser::executeCommandFile(const QString& commandFile)
{
QFile file(commandFile);
QFile file(commandFile);
RicfMessages messages;
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
{
@ -458,3 +475,64 @@ void RiaArgumentParser::executeCommandFile(const QString& commandFile)
QTextStream in(&file);
RicfCommandFileExecutor::instance()->executeCommands(in);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaArgumentParser::openCaseFromCommandLineParameter(const QString& parameter)
{
if (RiaEclipseFileNameTools::isProjectFile(parameter))
{
return RiaApplication::instance()->loadProject(parameter);
}
QStringList gridFileNames;
QStringList summarySpecFileNames;
if (RiaEclipseFileNameTools::isGridFile(parameter))
{
QFileInfo fi(parameter);
gridFileNames.push_back(fi.absoluteFilePath());
}
else if (RiaEclipseFileNameTools::isSummarySpecFile(parameter))
{
QFileInfo fi(parameter);
summarySpecFileNames.push_back(fi.absoluteFilePath());
}
else
{
RiaEclipseFileNameTools fileNameTools(parameter);
{
QString gridFileName = fileNameTools.findRelatedGridFile();
if (!gridFileName.isEmpty())
{
gridFileNames.push_back(gridFileName);
}
}
QString summarySpecFileName = fileNameTools.findRelatedSummarySpecFile();
if (!summarySpecFileName.isEmpty())
{
summarySpecFileNames.push_back(summarySpecFileName);
}
}
bool openCaseResult = true;
// Open summary cases first. Then, the open of grid file will not open an already open summary case file
if (!summarySpecFileNames.empty())
{
openCaseResult &= RicImportSummaryCasesFeature::createAndAddSummaryCasesFromFiles(summarySpecFileNames);
RiaApplication::instance()->getOrCreateAndShowMainPlotWindow();
}
for (const auto& f : gridFileNames)
{
openCaseResult &= RiaImportEclipseCaseTools::openEclipseCasesFromFile(QStringList({f}), nullptr, true);
}
return openCaseResult;
}

View File

@ -32,5 +32,6 @@ public:
private:
static void executeCommandFile(const QString& commandFile);
static bool openCaseFromCommandLineParameter(const QString& parameter);
};

View File

@ -0,0 +1,34 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RiaBoundingBoxTools.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::BoundingBox RiaBoundingBoxTools::inflate(const cvf::BoundingBox& boundingBox, double factor)
{
cvf::Vec3d center = boundingBox.center();
cvf::Vec3d sizes = boundingBox.extent() * factor;
cvf::Vec3d newMin(center.x() - sizes.x() / 2.0, center.y() - sizes.y() / 2.0, center.z() - sizes.z() / 2.0);
cvf::Vec3d newMax(center.x() + sizes.x() / 2.0, center.y() + sizes.y() / 2.0, center.z() + sizes.z() / 2.0);
return cvf::BoundingBox(newMin, newMax);
}

View File

@ -0,0 +1,35 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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 <cvfBase.h>
#include <cvfBoundingBox.h>
//==================================================================================================
//
//
//
//==================================================================================================
class RiaBoundingBoxTools
{
public:
static cvf::BoundingBox inflate(const cvf::BoundingBox& boundingBox, double factor);
};

View File

@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Statoil ASA
// Copyright (C) 2018- 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

View File

@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Statoil ASA
// Copyright (C) 2018- 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

View File

@ -17,6 +17,9 @@
/////////////////////////////////////////////////////////////////////////////////
#include "RiaColorTables.h"
#include "RiaColorTools.h"
#include "cvfAssert.h"
#include <QColor>
@ -163,6 +166,16 @@ const caf::ColorTable& RiaColorTables::categoryPaletteColors()
return colorTable;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const caf::ColorTable& RiaColorTables::contrastCategoryPaletteColors()
{
static caf::ColorTable colorTable = caf::ColorTable(contrastCategoryColors());
return colorTable;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -515,7 +528,7 @@ cvf::Color3f RiaColorTables::undefinedCellColor()
//--------------------------------------------------------------------------------------------------
RiaColorTables::WellPathComponentColors RiaColorTables::wellPathComponentColors()
{
return {{RiaDefines::WELL_PATH, cvf::Color3::CEETRON},
return {{RiaDefines::WELL_PATH, cvf::Color3::CEETRON},
{RiaDefines::PERFORATION_INTERVAL, cvf::Color3::DARK_MAGENTA},
{RiaDefines::FISHBONES, cvf::Color3::DARK_GREEN},
{RiaDefines::FRACTURE, cvf::Color3::CRIMSON},
@ -524,7 +537,67 @@ RiaColorTables::WellPathComponentColors RiaColorTables::wellPathComponentColors(
{RiaDefines::ICV, cvf::Color3::ORCHID},
{RiaDefines::CASING, cvf::Color3::SEA_GREEN},
{RiaDefines::LINER, cvf::Color3::OLIVE},
{RiaDefines::PACKER, cvf::Color3::GRAY}};
{RiaDefines::PACKER, cvf::Color3::GRAY},
{RiaDefines::UNDEFINED_COMPONENT, cvf::Color3::MAGENTA}};
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Color3f RiaColorTables::defaultGridLineColor()
{
return cvf::Color3f(0.92f, 0.92f, 0.92f);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Color3f RiaColorTables::defaultFaultLineColor()
{
return cvf::Color3f(0.08f, 0.08f, 0.08f);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Color3f RiaColorTables::defaultWellLabelColor()
{
return cvf::Color3f(0.92f, 0.92f, 0.92f);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Color3f RiaColorTables::defaultViewerBackgroundColor()
{
return cvf::Color3f(0.69f, 0.77f, 0.87f);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::ColorTable RiaColorTables::createBrightnessBasedColorTable(cvf::Color3ub baseColor, int brightnessLevelCount)
{
CVF_ASSERT(brightnessLevelCount >= 1);
QColor baseRGB(baseColor.r(), baseColor.g(), baseColor.b());
float hueF = baseRGB.hslHueF();
float satF = baseRGB.hslSaturationF();
std::vector<cvf::Color3ub> colors;
if (brightnessLevelCount == 1)
{
colors.push_back(cvf::Color3ub(RiaColorTools::fromQColorTo3f(QColor::fromHslF(hueF, satF, 0.5))));
}
else
{
for (int i = 0; i < brightnessLevelCount; ++i)
{
float brightness = static_cast<float>(i) / static_cast<float>(brightnessLevelCount - 1);
colors.push_back(cvf::Color3ub(RiaColorTools::fromQColorTo3f(QColor::fromHslF(hueF, satF, brightness))));
}
}
return caf::ColorTable(colors);
}
//--------------------------------------------------------------------------------------------------
@ -562,6 +635,42 @@ std::vector<cvf::Color3ub> RiaColorTables::categoryColors()
return colors;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<cvf::Color3ub> RiaColorTables::contrastCategoryColors()
{
// Based on http://stackoverflow.com/questions/470690/how-to-automatically-generate-n-distinct-colors
// and Kelly Colors and sorted by hue
// See also http://www.w3schools.com/colors/ for palettes etc.
static std::vector<cvf::Color3ub> colors{
cvf::Color3ub(244, 200, 0), // hwb( 49, 0%, 4%) vivid_greenish_yellow
cvf::Color3ub(128, 62, 117), // hwb(310, 24%, 50%) strong_purple
cvf::Color3ub(255, 104, 0), // hwb( 24, 0%, 0%) vivid_orange
cvf::Color3ub(166, 189, 215), // hwb(212, 65%, 16%) very_light_blue
cvf::Color3ub(193, 0, 32), // hwb(350, 0%, 24%) vivid_red
cvf::Color3ub(206, 162, 98), // hwb( 36, 38%, 19%) grayish_yellow
cvf::Color3ub(129, 112, 102), // hwb( 22, 40%, 49%) medium_gray
cvf::Color3ub(0, 125, 52), // hwb(145, 0%, 51%) vivid_green
cvf::Color3ub(246, 118, 142), // hwb(349, 46%, 4%) strong_purplish_pink
cvf::Color3ub(0, 83, 138), // hwb(204, 0%, 46%) strong_blue
cvf::Color3ub(255, 122, 92), // hwb( 11, 36%, 0%) strong_yellowish_pink
cvf::Color3ub(212, 28, 132), // hwb(326, 11%, 17%) strong_purplish_red
cvf::Color3ub(255, 142, 0), // hwb( 33, 0%, 0%) vivid_orange_yellow
cvf::Color3ub(59, 84, 23), // hwb( 85, 9%, 67%) dark_olive_green
cvf::Color3ub(127, 24, 13), // hwb( 6, 5%, 50%) strong_reddish_brown
cvf::Color3ub(54, 125, 123), // hwb(178, 21%, 51%) vivid_blueish_green
cvf::Color3ub(241, 58, 19), // hwb( 11, 7%, 5%) vivid_reddish_orange
cvf::Color3ub(147, 170, 0), // hwb( 68, 0%, 33%) vivid_yellowish_green
cvf::Color3ub(46, 76, 224), // hwb(230, 18%, 12%) medium_blue
cvf::Color3ub(89, 51, 21), // hwb( 26, 8%, 65%) deep_yellowish_brown
cvf::Color3ub(0, 0, 0) // hwb(0, 0%, 100%) black
};
return colors;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -40,6 +40,7 @@ public:
static const caf::ColorTable& blueWhiteRedPaletteColors();
static const caf::ColorTable& redWhiteBluePaletteColors();
static const caf::ColorTable& categoryPaletteColors();
static const caf::ColorTable& contrastCategoryPaletteColors();
static const caf::ColorTable& tensorWhiteGrayBlackPaletteColors();
static const caf::ColorTable& tensorOrangeBlueWhitePaletteColors();
static const caf::ColorTable& tensorsMagentaBrownGrayPaletteColors();
@ -63,7 +64,16 @@ public:
static WellPathComponentColors wellPathComponentColors();
// Default 3d View colors
static cvf::Color3f defaultGridLineColor();
static cvf::Color3f defaultFaultLineColor();
static cvf::Color3f defaultWellLabelColor();
static cvf::Color3f defaultViewerBackgroundColor();
static caf::ColorTable createBrightnessBasedColorTable(cvf::Color3ub baseColor, int brightnessLevelCount);
private:
static std::vector<cvf::Color3ub> categoryColors();
static std::vector<cvf::Color3ub> contrastCategoryColors();
static std::vector<cvf::Color3ub> invertedCategoryColors();
};

View File

@ -1,31 +1,38 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Equinor ASA
// Copyright (C) 2017 Statoil 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>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RiaColorTools.h"
#include "cvfMath.h"
#include <algorithm>
#include <cmath>
//--------------------------------------------------------------------------------------------------
///
/// Uses W3.org relative luminance calculation taking into account the different luminance of the different colors
/// https://www.w3.org/TR/WCAG20-TECHS/G18.html
/// Luminance is between [0, 1] so anything above 0.5 is considered in the bright half of the spectrum.
/// However, subjectively the contrast looks better if the threshold is to 0.4 so black contrast is used a bit more often.
//--------------------------------------------------------------------------------------------------
bool RiaColorTools::isBrightnessAboveThreshold(cvf::Color3f backgroundColor)
{
if (backgroundColor.r() + backgroundColor.g() + backgroundColor.b() > 1.5f)
if (relativeLuminance(backgroundColor) > 0.4)
{
return true;
}
@ -34,7 +41,7 @@ bool RiaColorTools::isBrightnessAboveThreshold(cvf::Color3f backgroundColor)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
cvf::Color3f RiaColorTools::computeOffsetColor(cvf::Color3f color, float offsetFactor)
{
@ -55,13 +62,12 @@ cvf::Color3f RiaColorTools::computeOffsetColor(cvf::Color3f color, float offsetF
gridB = color.b() + (1.0f - color.b()) * offsetFactor;
}
return cvf::Color3f(cvf::Math::clamp(gridR, 0.0f, 1.0f),
cvf::Math::clamp(gridG, 0.0f, 1.0f),
cvf::Math::clamp(gridB, 0.0f, 1.0f));
return cvf::Color3f(
cvf::Math::clamp(gridR, 0.0f, 1.0f), cvf::Math::clamp(gridG, 0.0f, 1.0f), cvf::Math::clamp(gridB, 0.0f, 1.0f));
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
cvf::Color3f RiaColorTools::darkContrastColor()
{
@ -69,7 +75,7 @@ cvf::Color3f RiaColorTools::darkContrastColor()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
cvf::Color3f RiaColorTools::brightContrastColor()
{
@ -77,15 +83,35 @@ cvf::Color3f RiaColorTools::brightContrastColor()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
cvf::Color3f RiaColorTools::constrastColor(cvf::Color3f backgroundColor)
cvf::Color3f RiaColorTools::darkContrastColorSofter()
{
return cvf::Color3f::fromByteColor(30, 30, 30);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Color3f RiaColorTools::brightContrastColorSofter()
{
return cvf::Color3f::fromByteColor(200, 200, 200);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Color3f RiaColorTools::contrastColor(cvf::Color3f backgroundColor, bool softerContrast)
{
if (isBrightnessAboveThreshold(backgroundColor))
{
if (softerContrast)
return darkContrastColorSofter();
return darkContrastColor();
}
if (softerContrast)
return brightContrastColorSofter();
return brightContrastColor();
}
@ -106,3 +132,32 @@ QColor RiaColorTools::toQColor(cvf::Color4f color)
{
return toQColor(color.toColor3f(), color.a());
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Color3f RiaColorTools::fromQColorTo3f(QColor color)
{
return cvf::Color3f(color.redF(), color.greenF(), color.blueF());
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
float RiaColorTools::relativeLuminance(cvf::Color3f backgroundColor)
{
float R = calculateNonLinearColorValue(backgroundColor.r());
float G = calculateNonLinearColorValue(backgroundColor.g());
float B = calculateNonLinearColorValue(backgroundColor.b());
double luminance = 0.2126 * R + 0.7152 * G + 0.0722 * B;
return luminance;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
float RiaColorTools::calculateNonLinearColorValue(float colorFraction)
{
return colorFraction <= 0.03928 ? colorFraction / 12.92 : std::pow((colorFraction + 0.055) / 1.055, 2.4);
}

View File

@ -1,17 +1,18 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Equinor ASA
// Copyright (C) 2017 Statoil 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>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@ -35,7 +36,14 @@ public:
static cvf::Color3f computeOffsetColor(cvf::Color3f color, float offsetFactor);
static cvf::Color3f darkContrastColor();
static cvf::Color3f brightContrastColor();
static cvf::Color3f constrastColor(cvf::Color3f backgroundColor);
static cvf::Color3f darkContrastColorSofter();
static cvf::Color3f brightContrastColorSofter();
static cvf::Color3f contrastColor(cvf::Color3f backgroundColor, bool softerContrast = false);
static QColor toQColor(cvf::Color3f color, float alpha = 1.0f);
static QColor toQColor(cvf::Color4f color);
static cvf::Color3f fromQColorTo3f(QColor);
private:
static float relativeLuminance(cvf::Color3f backgroundColor);
static float calculateNonLinearColorValue(float colorFraction);
};

View File

@ -43,6 +43,8 @@ public:
static double meterToInch(double meter) { return meter * feetPerMeter()*12.0; }
static double inchToMeter(double inch) { return (inch / 12.0) * meterPerFeet(); }
static double inchToFeet (double inch) { return (inch / 12.0); }
static double mmToMeter(double mm) { return mm / 1000.0; }
static double meterToMm(double meter) { return 1000.0 * meter; }
static double darcysConstant(UnitSystem unitSystem);

View File

@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018 Statoil ASA
// Copyright (C) 2018- 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

View File

@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018 Statoil ASA
// Copyright (C) 2018- 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

View File

@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018 Statoil ASA
// Copyright (C) 2018- 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

View File

@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018 Statoil ASA
// Copyright (C) 2018- 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

View File

@ -0,0 +1,136 @@
#include "RiaImageTools.h"
#include "cvfAssert.h"
#include <QColor>
#include <QImage>
#include <algorithm>
#include <limits>
//--------------------------------------------------------------------------------------------------
/// Meijster, Roerdink, Hesselink
/// A GENERAL ALGORITHM FOR COMPUTING DISTANCE TRANSFORMS IN LINEAR TIME
/// http://fab.cba.mit.edu/classes/S62.12/docs/Meijster_distance.pdf
/// Currently Euclidean only, but can be easily extended by replacing the lambda functions.
//--------------------------------------------------------------------------------------------------
void RiaImageTools::distanceTransform2d(std::vector<std::vector<unsigned int>>& image)
{
if (image.empty())
{
return;
}
if (image.front().empty())
{
return;
}
const int64_t M = (int64_t)image.size();
const int64_t N = (int64_t)image.front().size();
int64_t infVal = M + N;
CVF_ASSERT(infVal <= std::numeric_limits<unsigned int>::max());
// First phase
std::vector<std::vector<int64_t>> g(M);
#pragma omp parallel for
for (int64_t x = 0; x < M; ++x)
{
g[x].resize(N, infVal);
if (image[x][0])
{
g[x][0] = 0;
}
for (int64_t y = 1; y < N - 1; ++y)
{
if (image[x][y])
{
g[x][y] = 0;
}
else
{
g[x][y] = 1 + g[x][y - 1];
}
}
for (int64_t y = N - 2; y >= 0; --y)
{
if (g[x][y + 1] < g[x][y])
{
g[x][y] = 1 + g[x][y + 1];
}
}
}
auto f = [](int64_t x, int64_t i, const std::vector<std::vector<int64_t>>& g, int64_t y) {
return (x - i) * (x - i) + g[i][y] * g[i][y];
};
auto sep = [](int64_t i, int64_t u, const std::vector<std::vector<int64_t>>& g, int64_t y) {
if (i == u) return (int64_t)0;
int64_t numerator = u * u - i * i + g[u][y] * g[u][y] - g[i][y] * g[i][y];
int64_t divisor = 2 * (u - i);
return numerator / divisor;
};
// Second phase
#pragma omp parallel for
for (int64_t y = 0; y < N; ++y)
{
int64_t q = 0;
std::vector<int64_t> s(std::max(N, M), (int64_t) 0);
std::vector<int64_t> t(std::max(N, M), (int64_t) 0);
for (int64_t u = 1; u < M - 1; ++u)
{
while (q >= 0 && f(t[q], s[q], g, y) > f(t[q], u, g, y))
{
q--;
}
if (q < 0)
{
q = 0;
s[0] = u;
}
else
{
int64_t w = 1 + sep((int64_t)s[q], u, g, y);
if (w < M)
{
q++;
s[q] = u;
t[q] = w;
}
}
}
for (int64_t u = M - 1; u >= 0; --u)
{
int64_t fVal = f(u, s[q], g, y);
CVF_ASSERT(fVal <= std::numeric_limits<double>::max());
image[u][y] = static_cast<unsigned int>(fVal);
if (u == t[q])
{
q = q - 1;
}
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaImageTools::makeGrayScale(QImage& image)
{
for (int i = 0; i < image.height(); i++)
{
uchar* scanLine = image.scanLine(i);
for (int j = 0; j < image.width(); j++)
{
QRgb* pixel = reinterpret_cast<QRgb*>(scanLine + j * 4);
int gray = qGray(*pixel);
int alpha = qAlpha(*pixel);
*pixel = QColor(gray, gray, gray, alpha).rgba();
}
}
}

View File

@ -1,35 +1,32 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017- Statoil ASA
//
// Copyright (C) 2019- 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>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cvfBase.h"
#include "cvfObject.h"
#include <vector>
class QString;
class QImage;
class RigObservedData: public cvf::Object
class RiaImageTools
{
public:
explicit RigObservedData(const QString& observedDataFileName );
~RigObservedData() override;
void openOrReloadCase(const QString& observedDataFileName);
private:
static void distanceTransform2d(std::vector<std::vector<unsigned int>>& image);
static void makeGrayScale(QImage& image);
};

View File

@ -31,12 +31,13 @@
#include "RigGridManager.h"
#include "RimCaseCollection.h"
#include "RimCompletionTemplateCollection.h"
#include "RimEclipseCaseCollection.h"
#include "RimEclipseCellColors.h"
#include "RimEclipseInputCase.h"
#include "RimEclipseResultCase.h"
#include "RimEclipseView.h"
#include "RimFileSummaryCase.h"
#include "RimFractureTemplateCollection.h"
#include "RimGridSummaryCase.h"
#include "RimIdenticalGridCaseGroup.h"
#include "RimMainPlotCollection.h"
@ -51,6 +52,7 @@
#include "RimSummaryPlot.h"
#include "RimSummaryPlotCollection.h"
#include "Riu3DMainWindowTools.h"
#include "RiuMainWindow.h"
#include "RiuPlotMainWindow.h"
#include "RiuPlotMainWindowTools.h"
@ -170,7 +172,7 @@ bool RiaImportEclipseCaseTools::openEclipseCasesFromFile(const QStringList& file
RiaLogging::error(errorMessage);
}
project->activeOilField()->fractureDefinitionCollection()->setDefaultUnitSystemBasedOnLoadedCases();
project->activeOilField()->completionTemplateCollection()->setDefaultUnitSystemBasedOnLoadedCases();
RiuPlotMainWindowTools::refreshToolbars();
@ -197,6 +199,53 @@ bool RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilter(const QString&
return RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl(fileName, true);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaImportEclipseCaseTools::openEclipseInputCaseFromFileNames(const QStringList& fileNames, QString* fileContainingGrid/*=nullptr*/)
{
RimEclipseInputCase* rimInputReservoir = new RimEclipseInputCase();
RiaApplication* app = RiaApplication::instance();
RimProject* project = app->project();
project->assignCaseIdToCase(rimInputReservoir);
bool gridImportSuccess = rimInputReservoir->openDataFileSet(fileNames);
if (!gridImportSuccess)
{
RiaLogging::error("Failed to import grid");
return false;
}
RimEclipseCaseCollection* analysisModels = project->activeOilField() ? project->activeOilField()->analysisModels() : nullptr;
if (analysisModels == nullptr) return false;
analysisModels->cases.push_back(rimInputReservoir);
RimEclipseView* riv = rimInputReservoir->createAndAddReservoirView();
riv->cellResult()->setResultType(RiaDefines::INPUT_PROPERTY);
riv->loadDataAndUpdate();
if (!riv->cellResult()->hasResult())
{
riv->cellResult()->setResultVariable(RiaDefines::undefinedResultName());
}
analysisModels->updateConnectedEditors();
Riu3DMainWindowTools::selectAsCurrentItem(riv->cellResult());
if (fileContainingGrid)
{
*fileContainingGrid = rimInputReservoir->gridFileName();
}
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -30,6 +30,7 @@ public:
static bool openEclipseCasesFromFile(const QStringList& fileNames, QStringList* openedFiles = nullptr, bool noDialog = false);
static bool openEclipseCaseShowTimeStepFilter(const QString& fileName);
static bool openEclipseInputCaseFromFileNames(const QStringList& fileNames, QString* fileContainingGrid = nullptr);
static bool openMockModel(const QString& name);
static bool addEclipseCases(const QStringList& fileNames);

View File

@ -18,11 +18,16 @@
#include "RiaLogging.h"
#include <iostream>
#include <sstream>
#ifdef WIN32
#pragma warning (push)
#pragma warning (disable: 4668)
// Define this one to tell windows.h to not define min() and max() as macros
#if defined WIN32 && !defined NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
#pragma warning (pop)
#else
@ -34,7 +39,6 @@
//==================================================================================================
//
//
@ -253,3 +257,87 @@ void RiaLogging::debug(const QString& message)
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiuMessageLoggerBase::RiuMessageLoggerBase()
: m_logLevel(RI_LL_WARNING)
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RiuMessageLoggerBase::level() const
{
return m_logLevel;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMessageLoggerBase::setLevel(int logLevel)
{
m_logLevel = logLevel;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMessageLoggerBase::error(const char* message)
{
writeMessageWithPrefixToLogger("ERROR: ", message);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMessageLoggerBase::warning(const char* message)
{
writeMessageWithPrefixToLogger("warning: ", message);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMessageLoggerBase::info(const char* message)
{
writeMessageWithPrefixToLogger("info: ", message);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMessageLoggerBase::debug(const char* message)
{
writeMessageWithPrefixToLogger("debug: ", message);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMessageLoggerBase::writeMessageWithPrefixToLogger(const char* prefix, const char* message)
{
std::ostringstream oss;
oss << prefix;
if (message)
{
oss << message << std::endl;
}
else
{
oss << "<no message>" << std::endl;
}
writeMessageToLogger(oss.str());
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaStdOutLogger::writeMessageToLogger(const std::string& str)
{
std::cout << str;
}

View File

@ -18,6 +18,8 @@
#pragma once
#include <string>
class QString;
enum RILogLevel
@ -72,3 +74,37 @@ private:
static RiaLogger* sm_logger;
};
//==================================================================================================
//
//==================================================================================================
class RiuMessageLoggerBase : public RiaLogger
{
public:
explicit RiuMessageLoggerBase();
int level() const override;
void setLevel(int logLevel) override;
void error(const char* message) override;
void warning(const char* message) override;
void info(const char* message) override;
void debug(const char* message) override;
protected:
virtual void writeMessageToLogger(const std::string& str) = 0;
private:
void writeMessageWithPrefixToLogger(const char* prefix, const char* message);
private:
int m_logLevel;
};
//==================================================================================================
//
//==================================================================================================
class RiaStdOutLogger : public RiuMessageLoggerBase
{
public:
void writeMessageToLogger(const std::string& str) override;
};

View File

@ -1,20 +1,21 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Statoil ASA
//
// Copyright (C) 2018- 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>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include <array>

View File

@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018 Statoil ASA
// Copyright (C) 2018- 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

View File

@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018 Statoil ASA
// Copyright (C) 2018- 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

View File

@ -338,3 +338,58 @@ QString RiaQDateTimeTools::toStringUsingApplicationLocale(const QDateTime& dt, c
return defaultApplicationLocale.toString(dt, format);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiaQDateTimeTools::createTimeFormatStringFromDates(const std::vector<QDateTime>& dates)
{
bool hasHoursAndMinutesInTimesteps = false;
bool hasSecondsInTimesteps = false;
bool hasMillisecondsInTimesteps = false;
for (size_t i = 0; i < dates.size(); i++)
{
if (dates[i].time().msec() != 0.0)
{
hasMillisecondsInTimesteps = true;
hasSecondsInTimesteps = true;
hasHoursAndMinutesInTimesteps = true;
break;
}
else if (dates[i].time().second() != 0.0)
{
hasHoursAndMinutesInTimesteps = true;
hasSecondsInTimesteps = true;
}
else if (dates[i].time().hour() != 0.0 || dates[i].time().minute() != 0.0)
{
hasHoursAndMinutesInTimesteps = true;
}
}
QString formatString = dateFormatString();
if (hasHoursAndMinutesInTimesteps)
{
formatString += " - hh:mm";
if (hasSecondsInTimesteps)
{
formatString += ":ss";
if (hasMillisecondsInTimesteps)
{
formatString += ".zzz";
}
}
}
return formatString;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiaQDateTimeTools::dateFormatString()
{
return "dd.MMM yyyy";
}

View File

@ -101,6 +101,9 @@ public:
// settings on local machine. Required for stable regression testing.
static QString toStringUsingApplicationLocale(const QDateTime& dt, const QString& format);
static QString createTimeFormatStringFromDates(const std::vector<QDateTime>& dates);
static QString dateFormatString();
private:
static quint64 secondsInDay();
static quint64 secondsInYear();

View File

@ -60,6 +60,8 @@ RiaRegressionTest::RiaRegressionTest(void)
CAF_PDM_InitField(
&useOpenMPForGeometryCreation, "useOpenMPForGeometryCreation", true, "Use OpenMP For Geometry Creation", "", "", "");
CAF_PDM_InitField(&openReportInBrowser, "openReportInBrowser", false, "Open Generated Report in Browser", "", "", "");
CAF_PDM_InitFieldNoDefault(
&testFilter,
"testFilter",
@ -68,6 +70,9 @@ RiaRegressionTest::RiaRegressionTest(void)
"If empty, all tests are executed.\nTo execute a subset of tests, specify folder names separated by ;",
"");
testFilter.uiCapability()->setUiEditorTypeName(caf::PdmUiTextEditor::uiEditorTypeName());
CAF_PDM_InitField(
&appendTestsAfterTestFilter, "appendTestsAfterTestFilter", false, "Append All Tests After Test Filter", "", "", "");
}
//--------------------------------------------------------------------------------------------------

View File

@ -41,6 +41,8 @@ public:
caf::PdmField<QString> testFilter;
caf::PdmField<bool> showInteractiveDiffImages;
caf::PdmField<bool> useOpenMPForGeometryCreation;
caf::PdmField<bool> openReportInBrowser;
caf::PdmField<bool> appendTestsAfterTestFilter;
protected:
void defineEditorAttribute(const caf::PdmFieldHandle* field,

View File

@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018 Statoil ASA
// Copyright (C) 2018- 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
@ -83,6 +83,7 @@ void logInfoTextWithTimeInSeconds(const QTime& time, const QString& msg)
//--------------------------------------------------------------------------------------------------
RiaRegressionTestRunner::RiaRegressionTestRunner()
: m_runningRegressionTests(false)
, m_appendAllTestsAfterLastItemInFilter(false)
{
}
@ -151,11 +152,18 @@ void RiaRegressionTestRunner::runRegressionTest()
}
QString htmlReportFileName = generateHtmlReport(folderList, baseFolderName, generatedFolderName, diffFolderName, testDir);
QDesktopServices::openUrl(htmlReportFileName);
if (regressionTestConfig.openReportInBrowser())
{
QDesktopServices::openUrl(htmlReportFileName);
}
RiaLogging::info("--------------------------------------------------");
RiaLogging::info(QTime::currentTime().toString() + ": Launching regression tests");
RiaLogging::info("--------------------------------------------------");
QTime timeStamp;
timeStamp.start();
logInfoTextWithTimeInSeconds(timeStamp, "Starting regression tests\n");
for (const QFileInfo& folderFileInfo : folderList)
@ -582,6 +590,8 @@ QFileInfoList RiaRegressionTestRunner::subDirectoriesForTestExecution(const QDir
return folderList;
}
bool anyMatchFound = false;
QFileInfoList foldersMatchingTestFilter;
QFileInfoList folderList = directory.entryInfoList();
@ -593,9 +603,10 @@ QFileInfoList RiaRegressionTestRunner::subDirectoriesForTestExecution(const QDir
for (const auto& s : m_testFilter)
{
QString trimmed = s.trimmed();
if (baseName.contains(trimmed, Qt::CaseInsensitive))
if (anyMatchFound || baseName.contains(trimmed, Qt::CaseInsensitive))
{
foldersMatchingTestFilter.push_back(fi);
anyMatchFound = true;
}
}
}
@ -614,6 +625,11 @@ void RiaRegressionTestRunner::executeRegressionTests()
QString testPath = testConfig.regressionTestFolder();
QStringList testFilter = testConfig.testFilter().split(";", QString::SkipEmptyParts);
if (testConfig.appendTestsAfterTestFilter)
{
m_appendAllTestsAfterLastItemInFilter = true;
}
executeRegressionTests(testPath, testFilter);
}

View File

@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018 Statoil ASA
// Copyright (C) 2018- 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
@ -68,6 +68,7 @@ private:
private:
QString m_rootPath;
QStringList m_testFilter;
bool m_appendAllTestsAfterLastItemInFilter;
bool m_runningRegressionTests;
RiaRegressionTest m_regressionTestSettings;
};

View File

@ -72,7 +72,7 @@ void RiaSummaryTools::notifyCalculatedCurveNameHasChanged(const QString& previou
if (adr.quantityName() == previousCurveName.toStdString())
{
RifEclipseSummaryAddress updatedAdr = RifEclipseSummaryAddress::calculatedAddress(currentCurveName.toStdString());
curve->setSummaryAddressY(updatedAdr);
curve->setSummaryAddressYAndApplyInterpolation(updatedAdr);
}
}
}

View File

@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018 Statoil ASA
// Copyright (C) 2018- 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

View File

@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018 Statoil ASA
// Copyright (C) 2018- 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

View File

@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018 Statoil ASA
// Copyright (C) 2018- 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

View File

@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018 Statoil ASA
// Copyright (C) 2018- 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

View File

@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Statoil ASA
// Copyright (C) 2018- 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

View File

@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Statoil ASA
// Copyright (C) 2018- 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

View File

@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Statoil ASA
// Copyright (C) 2018- 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

View File

@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Statoil ASA
// Copyright (C) 2018- 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

View File

@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Statoil ASA
// Copyright (C) 2018- 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

View File

@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Statoil ASA
// Copyright (C) 2018- 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

View File

@ -1,20 +1,21 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Statoil ASA
//
// Copyright (C) 2018- 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>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RiaArcCurveCalculator.h"
#include "RiaOffshoreSphericalCoords.h"

View File

@ -1,20 +1,21 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Statoil ASA
//
// Copyright (C) 2018- 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>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cvfBase.h"

View File

@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Statoil ASA
//
// Copyright (C) 2018- 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>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////

View File

@ -1,20 +1,21 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Statoil ASA
//
// Copyright (C) 2018- 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>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cvfBase.h"

View File

@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Statoil ASA
//
// Copyright (C) 2018- 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>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////

View File

@ -1,20 +1,21 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Statoil ASA
//
// Copyright (C) 2018- 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>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cvfBase.h"

View File

@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Statoil ASA
// Copyright (C) 2018- 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

View File

@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Statoil ASA
// Copyright (C) 2018- 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
@ -15,6 +15,7 @@
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cvfBase.h"

View File

@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Statoil ASA
//
// Copyright (C) 2018- 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>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@ -211,7 +211,6 @@ void RiaSCurveCalculator::initializeByFinding_q1q2(cvf::Vec3d p1, double azi1, d
const int maxIterations = 40;
const double maxError = 0.01;
const double closeError = 40*maxError;
const double maxStepSize = 1.0e9;
const double maxLengthToQ = 1.0e10;
bool enableBackstepping = false;

View File

@ -1,20 +1,21 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Statoil ASA
//
// Copyright (C) 2018- 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>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cvfBase.h"

View File

@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Statoil ASA
//
// Copyright (C) 2018- 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>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////

View File

@ -1,20 +1,21 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Statoil ASA
//
// Copyright (C) 2018- 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>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cvfBase.h"

View File

@ -2,6 +2,22 @@ cmake_minimum_required (VERSION 2.8.12)
project (ApplicationCode)
# Open GL
find_package( OpenGL )
if (RESINSIGHT_BUILD_WITH_QT5)
find_package(Qt5 COMPONENTS Core QUIET)
endif(RESINSIGHT_BUILD_WITH_QT5)
if (Qt5Core_FOUND)
find_package(Qt5 CONFIG REQUIRED Core Gui OpenGL Network Script Widgets)
set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Network Qt5::OpenGL Qt5::Script Qt5::Widgets)
else()
set (QT_COMPONENTS_REQUIRED QtCore QtGui QtMain QtOpenGl QtNetwork QtScript)
find_package(Qt4 COMPONENTS ${QT_COMPONENTS_REQUIRED} REQUIRED)
include(${QT_USE_FILE})
endif(Qt5Core_FOUND)
# NB: The generated file is written to Cmake binary folder to avoid source tree pollution
# This folder is added to include_directories
CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/ApplicationCode/Adm/RiaVersionInfo.h.cmake
@ -11,7 +27,7 @@ CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/ApplicationCode/Adm/RiaVersionInfo.h.cmake
if (MSVC AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 19.11))
# VS 2017 : Disable warnings from from gtest code, using deprecated code related to TR1
add_definitions(-D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
message("Add flag to disable warings from gtest - _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING")
message(STATUS "Add flag to disable warings from gtest - _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING")
endif()
include_directories(
@ -29,6 +45,7 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/Commands/EclipseCommands
${CMAKE_CURRENT_SOURCE_DIR}/FileInterface
${CMAKE_CURRENT_SOURCE_DIR}/SocketInterface
${CMAKE_CURRENT_SOURCE_DIR}/Measurement
${CMAKE_CURRENT_SOURCE_DIR}/ModelVisualization
${CMAKE_CURRENT_SOURCE_DIR}/ModelVisualization/GridBox
${CMAKE_CURRENT_SOURCE_DIR}/ModelVisualization/Intersections
@ -37,8 +54,11 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/CommandFileInterface/Core
${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel
${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel/Annotations
${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel/Completions
${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel/Flow
${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel/GridCrossPlots
${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel/Measurement
${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel/Summary
${CMAKE_CURRENT_SOURCE_DIR}/ResultStatisticsCache
@ -88,9 +108,13 @@ list( APPEND REFERENCED_CMAKE_FILES
FileInterface/CMakeLists_files.cmake
ProjectDataModel/CMakeLists_files.cmake
ProjectDataModel/GridCrossPlots/CMakeLists_files.cmake
ProjectDataModel/GridCrossPlots/CellFilters/CMakeLists_files.cmake
ProjectDataModel/Summary/CMakeLists_files.cmake
ProjectDataModel/Flow/CMakeLists_files.cmake
ProjectDataModel/Annotations/CMakeLists_files.cmake
ProjectDataModel/Completions/CMakeLists_files.cmake
ProjectDataModel/Measurement/CMakeLists_files.cmake
GeoMech/GeoMechVisualization/CMakeLists_files.cmake
@ -103,6 +127,7 @@ list( APPEND REFERENCED_CMAKE_FILES
Commands/CMakeLists_files.cmake
Commands/ApplicationCommands/CMakeLists_files.cmake
Commands/AnnotationCommands/CMakeLists_files.cmake
Commands/CompletionCommands/CMakeLists_files.cmake
Commands/CompletionExportCommands/CMakeLists_files.cmake
Commands/CrossSectionCommands/CMakeLists_files.cmake
@ -110,9 +135,11 @@ list( APPEND REFERENCED_CMAKE_FILES
Commands/EclipseCommands/EclipseWell/CMakeLists_files.cmake
Commands/ExportCommands/CMakeLists_files.cmake
Commands/FlowCommands/CMakeLists_files.cmake
Commands/GridCrossPlotCommands/CMakeLists_files.cmake
Commands/HoloLensCommands/CMakeLists_files.cmake
Commands/IntersectionBoxCommands/CMakeLists_files.cmake
Commands/IntersectionViewCommands/CMakeLists_files.cmake
Commands/MeasurementCommands/CMakeLists_files.cmake
Commands/OctaveScriptCommands/CMakeLists_files.cmake
Commands/OperationsUsingObjReferences/CMakeLists_files.cmake
Commands/SummaryPlotCommands/CMakeLists_files.cmake
@ -217,9 +244,14 @@ set ( QT_MOC_HEADERS
SocketInterface/RiaSocketServer.h
)
qt4_wrap_cpp( MOC_FILES_CPP ${QT_MOC_HEADERS} )
if (Qt5Core_FOUND)
qt5_wrap_cpp(MOC_SOURCE_FILES ${QT_MOC_HEADERS} )
qt5_wrap_ui( FORM_FILES_CPP ${QT_UI_FILES} )
else()
qt4_wrap_cpp(MOC_SOURCE_FILES ${QT_MOC_HEADERS} )
qt4_wrap_ui( FORM_FILES_CPP ${QT_UI_FILES} )
endif()
qt4_wrap_ui( FORM_FILES_CPP ${QT_UI_FILES} )
# NOTE! Resources in subfolders must append to QRC_FILES using the following statement
# set( QRC_FILES
@ -234,7 +266,17 @@ set( QRC_FILES
)
# Runs RCC on specified files
qt4_add_resources( QRC_FILES_CPP ${QRC_FILES} )
if ( NOT CMAKE_AUTOMOC)
if (Qt5Core_FOUND)
qt5_add_resources( QRC_FILES_CPP
${QRC_FILES}
)
else()
qt4_add_resources( QRC_FILES_CPP
${QRC_FILES}
)
endif(Qt5Core_FOUND)
endif(NOT CMAKE_AUTOMOC)
# Adding resource (RC) files for Windows
if ( MSVC )
@ -270,7 +312,7 @@ endif()
set( EXE_FILES
${EXE_FILES}
${CPP_SOURCES}
${MOC_FILES_CPP}
${MOC_SOURCE_FILES}
${FORM_FILES_CPP}
${QRC_FILES_CPP}
${WIN_RESOURCE}
@ -278,6 +320,7 @@ set( EXE_FILES
${REFERENCED_CMAKE_FILES}
../ResInsightVersion.cmake
../.clang-format
../.clang-tidy
)
add_executable( ResInsight ${EXE_FILES} )
@ -361,21 +404,29 @@ if(RESINSIGHT_ENABLE_COTIRE)
ModelVisualization/Intersections/RivIntersectionGeometryGenerator.cpp
# exclude file using Eigen
ReservoirDataModel/RigTransmissibilityCondenser.cpp
ReservoirDataModel/RigEclipseToStimPlanCellTransmissibilityCalculator.cpp
ReservoirDataModel/RigCellGeometryTools.cpp
ReservoirDataModel/Completions/RigTransmissibilityCondenser.cpp
ReservoirDataModel/Completions/RigEclipseToStimPlanCellTransmissibilityCalculator.cpp
ReservoirDataModel/Completions/RigEclipseToStimPlanCalculator.cpp
# exclude file using SolveSpace
Application/Tools/RiaSCurveCalculator.cpp
# exclude test files due to cotire redefinition error report
UnitTests/RifCaseRealizationParametersReader-Test.cpp
Application/Tools/WellPathTools/RiaSCurveCalculator.cpp
# QT 5
qrc_cafAnimControl.cpp
qrc_ResInsight.cpp
ProjectDataModel/RimContourMapView.cpp
Commands/CompletionExportCommands/RicExportFractureCompletionsImpl.cpp
)
foreach (fileToExclude ${COTIRE_EXCLUDE_FILES})
set_source_files_properties (${fileToExclude} PROPERTIES COTIRE_EXCLUDED TRUE)
endforeach(fileToExclude)
foreach (cppFile ${CAF_COTIRE_START_NEW_UNITY_SOURCES})
set_source_files_properties (${cppFile} PROPERTIES COTIRE_START_NEW_UNITY_SOURCE TRUE)
endforeach(cppFile ${CAF_COTIRE_START_NEW_UNITY_SOURCES})
# disable precompiled headers
set_target_properties(ResInsight PROPERTIES COTIRE_ENABLE_PRECOMPILED_HEADER FALSE)
@ -398,11 +449,19 @@ endif()
if (MSVC)
# Qt DLLs
set (QTLIBLIST QtCore QtCored QtGui QtGuid QtOpenGl QtOpenGld QtNetwork QtNetworkd QtScript QtScriptd QtScriptTools QtScriptToolsd)
foreach (qtlib ${QTLIBLIST})
list(APPEND RI_DLL_FILENAMES ${QT_BINARY_DIR}/${qtlib}4.dll)
endforeach( qtlib )
if (Qt5Core_FOUND)
message(STATUS "Creating post build step for copying Qt DLLs")
foreach (qtlib ${QT_LIBRARIES})
add_custom_command(TARGET ResInsight POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${qtlib}> $<TARGET_FILE_DIR:ResInsight>
)
endforeach(qtlib)
else()
set (QTLIBLIST QtCore4 QtCored4 QtGui4 QtGuid4 QtOpenGl4 QtOpenGld4 QtNetwork4 QtNetworkd4 QtScript4 QtScriptd4 QtScriptTools4 QtScriptToolsd4)
foreach (qtlib ${QTLIBLIST})
list(APPEND RI_DLL_FILENAMES ${QT_BINARY_DIR}/${qtlib}.dll)
endforeach( qtlib )
endif()
# Odb Dlls
if (RESINSIGHT_USE_ODB_API)
# Find all the dlls
@ -484,6 +543,56 @@ if (RESINSIGHT_PRIVATE_INSTALL)
set (RESINSIGHT_FILES ${RI_DLL_FILENAMES})
if(Qt5_FOUND AND WIN32 AND TARGET Qt5::qmake AND NOT TARGET Qt5::windeployqt)
get_target_property(_qt5_qmake_location Qt5::qmake IMPORTED_LOCATION)
execute_process(
COMMAND "${_qt5_qmake_location}" -query QT_INSTALL_PREFIX
RESULT_VARIABLE return_code
OUTPUT_VARIABLE qt5_install_prefix
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(imported_location "${qt5_install_prefix}/bin/windeployqt.exe")
if(EXISTS ${imported_location})
add_executable(Qt5::windeployqt IMPORTED)
set_target_properties(Qt5::windeployqt PROPERTIES
IMPORTED_LOCATION ${imported_location}
)
endif()
endif()
# TODO(wjwwood): find a way to make this optional or to run without "deploying" the
# necessary dlls and stuff to the bin folder.
# see:
# https://stackoverflow.com/questions/41193584/deploy-all-qt-dependencies-when-building#41199492
if(TARGET Qt5::windeployqt)
# execute windeployqt in a tmp directory after build
add_custom_command(TARGET ResInsight
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_CURRENT_BINARY_DIR}/windeployqt"
COMMAND set PATH=%PATH%$<SEMICOLON>${qt5_install_prefix}/bin
COMMAND
Qt5::windeployqt
--no-compiler-runtime
--no-system-d3d-compiler
--no-quick-import
--no-translations
--verbose 0
--dir "${CMAKE_CURRENT_BINARY_DIR}/windeployqt"
"$<TARGET_FILE_DIR:ResInsight>/$<TARGET_FILE_NAME:ResInsight>"
)
# copy deployment directory during installation
install(
DIRECTORY
"${CMAKE_CURRENT_BINARY_DIR}/windeployqt/"
DESTINATION ${RESINSIGHT_INSTALL_FOLDER}
)
endif()
# CRT
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP ON)
set(CMAKE_INSTALL_OPENMP_LIBRARIES ON)
@ -541,14 +650,6 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(CPACK_GENERATOR ZIP)
endif()
if(RESINSIGHT_OCTAVE_PLUGIN_MKOCTFILE)
get_filename_component(RESINSIGHT_OCTAVE_DIRECTORY ${RESINSIGHT_OCTAVE_PLUGIN_MKOCTFILE} DIRECTORY)
execute_process (COMMAND octave-config -v
WORKING_DIRECTORY ${RESINSIGHT_OCTAVE_DIRECTORY}
OUTPUT_VARIABLE OCTAVE_VERSION_STRING
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif ()
# Handling of system name on Windows
if(${CMAKE_SYSTEM_NAME} MATCHES Windows)

View File

@ -27,6 +27,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicfExportPropertyInViews.h
${CMAKE_CURRENT_LIST_DIR}/RicfExportLgrForCompletions.h
${CMAKE_CURRENT_LIST_DIR}/RicfCreateLgrForCompletions.h
${CMAKE_CURRENT_LIST_DIR}/RicfApplicationTools.h
${CMAKE_CURRENT_LIST_DIR}/RicfCreateSaturationPressurePlots.h
)
set (SOURCE_GROUP_SOURCE_FILES
@ -57,6 +58,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicfExportPropertyInViews.cpp
${CMAKE_CURRENT_LIST_DIR}/RicfExportLgrForCompletions.cpp
${CMAKE_CURRENT_LIST_DIR}/RicfCreateLgrForCompletions.cpp
${CMAKE_CURRENT_LIST_DIR}/RicfApplicationTools.cpp
${CMAKE_CURRENT_LIST_DIR}/RicfCreateSaturationPressurePlots.cpp
)
list(APPEND CODE_HEADER_FILES

View File

@ -0,0 +1,83 @@
#include "RicfCreateSaturationPressurePlots.h"
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017 Statoil 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 "RicfCreateSaturationPressurePlots.h"
#include "GridCrossPlotCommands/RicCreateSaturationPressurePlotsFeature.h"
#include "RiaApplication.h"
#include "RiaLogging.h"
#include "RimEclipseResultCase.h"
#include "RimMainPlotCollection.h"
#include "RimProject.h"
#include "RimSaturationPressurePlotCollection.h"
CAF_PDM_SOURCE_INIT(RicfCreateSaturationPressurePlots, "createSaturationPressurePlots");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicfCreateSaturationPressurePlots::RicfCreateSaturationPressurePlots()
{
RICF_InitField(&m_caseIds, "caseIds", std::vector<int>(), "Case IDs", "", "", "");
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicfCreateSaturationPressurePlots::execute()
{
std::vector<int> caseIds = m_caseIds();
if (caseIds.empty())
{
RimProject* project = RiaApplication::instance()->project();
if (project)
{
auto eclipeCases = project->eclipseCases();
for (auto c : eclipeCases)
{
caseIds.push_back(c->caseId());
}
}
}
RimProject* project = RiaApplication::instance()->project();
if (project)
{
auto eclipeCases = project->eclipseCases();
for (auto c : eclipeCases)
{
auto eclipseResultCase = dynamic_cast<RimEclipseResultCase*>(c);
if (!eclipseResultCase) continue;
for (auto caseId : caseIds)
{
if (c->caseId == caseId)
{
RicCreateSaturationPressurePlotsFeature::createPlots(eclipseResultCase);
}
}
}
}
RimSaturationPressurePlotCollection* collection = project->mainPlotCollection()->saturationPressurePlotCollection();
collection->updateAllRequiredEditors();
RiaApplication::instance()->getOrCreateAndShowMainPlotWindow();
}

View File

@ -0,0 +1,41 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017 Statoil 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 "RicfCommandObject.h"
#include "cafPdmField.h"
//==================================================================================================
//
//
//
//==================================================================================================
class RicfCreateSaturationPressurePlots : public RicfCommandObject
{
CAF_PDM_HEADER_INIT;
public:
RicfCreateSaturationPressurePlots();
void execute() override;
private:
caf::PdmField< std::vector<int> > m_caseIds;
};

View File

@ -33,7 +33,8 @@
#include "RimFishbonesCollection.h"
#include "RimFishbonesMultipleSubs.h"
#include "CompletionExportCommands/RicExportFishbonesWellSegmentsFeature.h"
#include "CompletionExportCommands/RicExportCompletionDataSettingsUi.h"
#include "CompletionExportCommands/RicWellPathExportMswCompletionsImpl.h"
CAF_PDM_SOURCE_INIT(RicfExportMsw, "exportMsw");
@ -44,6 +45,11 @@ RicfExportMsw::RicfExportMsw()
{
RICF_InitField(&m_caseId, "caseId", -1, "Case ID", "", "", "");
RICF_InitField(&m_wellPathName, "wellPath", QString(), "Well Path Name", "", "", "");
RICF_InitField(&m_includePerforations, "includePerforations", true, "Include Perforations", "", "", "");
RICF_InitField(&m_includeFishbones, "includeFishbones", true, "Include Fishbones", "", "", "");
RICF_InitField(&m_includeFractures, "includeFractures", true, "Include Fractures", "", "", "");
RICF_InitField(&m_fileSplit, "fileSplit", RicExportCompletionDataSettingsUi::ExportSplitType(), "File Split", "", "", "");
}
//--------------------------------------------------------------------------------------------------
@ -53,7 +59,7 @@ void RicfExportMsw::execute()
{
using TOOLS = RicfApplicationTools;
RicCaseAndFileExportSettingsUi exportSettings;
RicExportCompletionDataSettingsUi exportSettings;
auto eclipseCase = TOOLS::caseFromId(m_caseId());
if (!eclipseCase)
@ -67,7 +73,12 @@ void RicfExportMsw::execute()
{
exportFolder = RiaApplication::instance()->createAbsolutePathFromProjectRelativePath("completions");
}
exportSettings.caseToApply = eclipseCase;
exportSettings.folder = exportFolder;
exportSettings.includePerforations = m_includePerforations;
exportSettings.includeFishbones = m_includeFishbones;
exportSettings.includeFractures = m_includeFractures;
exportSettings.fileSplit = m_fileSplit;
RimWellPath* wellPath = RiaApplication::instance()->project()->wellPathByName(m_wellPathName);
if (!wellPath)
@ -76,8 +87,5 @@ void RicfExportMsw::execute()
return;
}
if (!wellPath->fishbonesCollection()->activeFishbonesSubs().empty())
{
RicExportFishbonesWellSegmentsFeature::exportWellSegments(wellPath, wellPath->fishbonesCollection()->activeFishbonesSubs(), exportSettings);
}
RicWellPathExportMswCompletionsImpl::exportWellSegmentsForAllCompletions(exportSettings, { wellPath });
}

View File

@ -20,6 +20,8 @@
#include "RicfCommandObject.h"
#include "CompletionExportCommands/RicExportCompletionDataSettingsUi.h"
#include "cafPdmField.h"
//==================================================================================================
@ -39,4 +41,8 @@ public:
private:
caf::PdmField<int> m_caseId;
caf::PdmField<QString> m_wellPathName;
caf::PdmField<bool> m_includePerforations;
caf::PdmField<bool> m_includeFishbones;
caf::PdmField<bool> m_includeFractures;
caf::PdmField<RicExportCompletionDataSettingsUi::ExportSplitType> m_fileSplit;
};

View File

@ -85,8 +85,7 @@ void RicfExportProperty::execute()
RigCaseCellResultsData* cellResultsData = eclipseCaseData->results(RiaDefines::MATRIX_MODEL);
size_t resultIdx = cellResultsData->findOrLoadScalarResult(m_propertyName);
if (resultIdx == cvf::UNDEFINED_SIZE_T)
if (!cellResultsData->ensureKnownResultLoaded(RigEclipseResultAddress(m_propertyName)))
{
RiaLogging::error(QString("exportProperty: Could not find result property : %1").arg(m_propertyName()));
return;

View File

@ -22,6 +22,10 @@
#include "RiaApplication.h"
#include "RiaLogging.h"
#include "RimCalcScript.h"
#include "RimEclipseCase.h"
#include "RimProject.h"
#include <QFileInfo>
CAF_PDM_SOURCE_INIT(RicfRunOctaveScript, "runOctaveScript");
@ -41,20 +45,31 @@ RicfRunOctaveScript::RicfRunOctaveScript()
void RicfRunOctaveScript::execute()
{
QString octavePath = RiaApplication::instance()->octavePath();
QFileInfo scriptFileInfo(m_path());
QStringList processArguments;
processArguments << "--path" << scriptFileInfo.absolutePath();
processArguments << scriptFileInfo.absoluteFilePath();
QStringList processArguments = RimCalcScript::createCommandLineArguments(m_path());
std::vector<int> caseIds = m_caseIds();
if (caseIds.empty())
{
RimProject* project = RiaApplication::instance()->project();
if (project)
{
auto eclipeCases = project->eclipseCases();
for (auto c : eclipeCases)
{
caseIds.push_back(c->caseId());
}
}
}
bool ok;
if (m_caseIds().empty())
if (caseIds.empty())
{
ok = RiaApplication::instance()->launchProcess(octavePath, processArguments);
}
else
{
ok = RiaApplication::instance()->launchProcessForMultipleCases(octavePath, processArguments, m_caseIds());
ok = RiaApplication::instance()->launchProcessForMultipleCases(octavePath, processArguments, caseIds);
}
if (!ok)
{

View File

@ -0,0 +1,40 @@
set (SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RicImportPolylinesAnnotationFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicCreateTextAnnotationFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicCreateTextAnnotationIn3dViewFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicCreateReachCircleAnnotationFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicCreateUserDefinedPolylinesAnnotationFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicTextAnnotation3dEditor.h
)
set (SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RicImportPolylinesAnnotationFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicCreateTextAnnotationFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicCreateTextAnnotationIn3dViewFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicCreateReachCircleAnnotationFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicCreateUserDefinedPolylinesAnnotationFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicTextAnnotation3dEditor.cpp
)
list(APPEND CODE_HEADER_FILES
${SOURCE_GROUP_HEADER_FILES}
)
list(APPEND CODE_SOURCE_FILES
${SOURCE_GROUP_SOURCE_FILES}
)
set (QT_MOC_HEADERS
${QT_MOC_HEADERS}
${CMAKE_CURRENT_LIST_DIR}/RicTextAnnotation3dEditor.h
)
source_group( "CommandFeature\\AnnotationCommands" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake )
# cotire
caf_cotire_start_unity_at_first_item(SOURCE_GROUP_SOURCE_FILES)
list(APPEND CAF_COTIRE_START_NEW_UNITY_SOURCES
${CMAKE_CURRENT_LIST_DIR}/RicCreateReachCircleAnnotationFeature.cpp
)

View File

@ -0,0 +1,91 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- 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 "RicCreateReachCircleAnnotationFeature.h"
#include "RiaApplication.h"
#include "RiaColorTables.h"
#include "RimTextAnnotation.h"
#include "RimReachCircleAnnotation.h"
#include "RimPolylinesAnnotation.h"
#include "RimAnnotationCollection.h"
#include "RimAnnotationGroupCollection.h"
#include "RimAnnotationInViewCollection.h"
#include "RimAnnotationLineAppearance.h"
#include "RimProject.h"
#include "RimOilField.h"
#include "RiuMainWindow.h"
#include <cafSelectionManagerTools.h>
#include <QAction>
CAF_CMD_SOURCE_INIT(RicCreateReachCircleAnnotationFeature, "RicCreateReachCircleAnnotationFeature");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicCreateReachCircleAnnotationFeature::isCommandEnabled()
{
auto selObjs = caf::selectedObjectsByTypeStrict<RimAnnotationCollection*>();
auto selGroupColl = caf::selectedObjectsByTypeStrict<RimAnnotationGroupCollection*>();
return selObjs.size() == 1 || (selGroupColl.size() == 1
&& selGroupColl.front()->uiCapability()->uiName() == RimAnnotationGroupCollection::REACH_CIRCLE_ANNOTATION_UI_NAME);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCreateReachCircleAnnotationFeature::onActionTriggered(bool isChecked)
{
auto coll = annotationCollection();
if (coll)
{
auto newAnnotation = new RimReachCircleAnnotation();
auto newColor = RiaColorTables::categoryPaletteColors().cycledColor3f(coll->lineBasedAnnotationsCount());
newAnnotation->appearance()->setColor(newColor);
newAnnotation->enablePicking(true);
coll->addAnnotation(newAnnotation);
coll->updateConnectedEditors();
RiuMainWindow::instance()->selectAsCurrentItem(newAnnotation);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCreateReachCircleAnnotationFeature::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setIcon(QIcon(":/ReachCircle16x16.png"));
actionToSetup->setText("Create Reach Circle Annotation");
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimAnnotationCollection* RicCreateReachCircleAnnotationFeature::annotationCollection() const
{
auto project = RiaApplication::instance()->project();
auto oilField = project->activeOilField();
return oilField ? oilField->annotationCollection() : nullptr;
}

View File

@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017 Statoil ASA
// Copyright (C) 2018- 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
@ -18,30 +18,29 @@
#pragma once
#include "RicCaseAndFileExportSettingsUi.h"
#include "RiaPreferences.h"
#include "cafCmdFeature.h"
class RimFishbonesCollection;
class RimFishbonesMultipleSubs;
class RimWellPath;
#include <QString>
class RimAnnotationCollection;
//==================================================================================================
///
///
//==================================================================================================
class RicExportFishbonesWellSegmentsFeature : public caf::CmdFeature
class RicCreateReachCircleAnnotationFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
// Overrides
bool isCommandEnabled() override;
void onActionTriggered(bool isChecked) override;
void setupActionLook(QAction* actionToSetup) override;
bool isCommandEnabled() override;
public:
static void exportWellSegments(const RimWellPath* wellPath,
const std::vector<RimFishbonesMultipleSubs*>& fishbonesSubs,
const RicCaseAndFileExportSettingsUi& settings);
private:
RimAnnotationCollection* annotationCollection() const;
};

View File

@ -0,0 +1,97 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- 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 "RicCreateTextAnnotationFeature.h"
#include "RiaApplication.h"
#include "RimTextAnnotation.h"
#include "RimReachCircleAnnotation.h"
#include "RimPolylinesAnnotation.h"
#include "RimAnnotationCollection.h"
#include "RimAnnotationGroupCollection.h"
#include "RimAnnotationInViewCollection.h"
#include "RimProject.h"
#include "RimOilField.h"
#include "RiuMainWindow.h"
#include <cafSelectionManagerTools.h>
#include <QAction>
CAF_CMD_SOURCE_INIT(RicCreateTextAnnotationFeature, "RicCreateTextAnnotationFeature");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicCreateTextAnnotationFeature::isCommandEnabled()
{
auto selObjsGlobal = caf::selectedObjectsByTypeStrict<RimAnnotationCollection*>();
auto selObjs2InView = caf::selectedObjectsByTypeStrict<RimAnnotationInViewCollection*>();
auto selGroupColl = caf::selectedObjectsByTypeStrict<RimAnnotationGroupCollection*>();
return selObjsGlobal.size() == 1 || selObjs2InView.size() == 1 ||
(selGroupColl.size() == 1 &&
selGroupColl.front()->uiCapability()->uiName() == RimAnnotationGroupCollection::TEXT_ANNOTATION_UI_NAME);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCreateTextAnnotationFeature::onActionTriggered(bool isChecked)
{
auto coll = annotationCollectionBase();
if (coll)
{
auto newAnnotation = new RimTextAnnotation();
newAnnotation->enablePicking(true);
coll->addAnnotation(newAnnotation);
coll->updateConnectedEditors();
RiuMainWindow::instance()->selectAsCurrentItem(newAnnotation);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCreateTextAnnotationFeature::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setIcon(QIcon(":/TextAnnotation16x16.png"));
actionToSetup->setText("Create Text Annotation");
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimAnnotationCollectionBase* RicCreateTextAnnotationFeature::annotationCollectionBase() const
{
auto selColls = caf::selectedObjectsByTypeStrict<RimAnnotationCollectionBase*>();
if (selColls.size() == 1) return selColls.front();
RimAnnotationCollectionBase* coll = nullptr;
auto selGroupColl = caf::selectedObjectsByTypeStrict<RimAnnotationGroupCollection*>();
if (selGroupColl.size() == 1)
{
selGroupColl.front()->firstAncestorOrThisOfType(coll);
}
return coll;
}

View File

@ -0,0 +1,47 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- 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 "RiaPreferences.h"
#include "cafCmdFeature.h"
#include <QString>
class RimAnnotationCollection;
class RimAnnotationCollectionBase;
class RimAnnotationInViewCollection;
//==================================================================================================
///
//==================================================================================================
class RicCreateTextAnnotationFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
// Overrides
bool isCommandEnabled() override;
void onActionTriggered(bool isChecked) override;
void setupActionLook(QAction* actionToSetup) override;
RimAnnotationCollectionBase* annotationCollectionBase() const;
};

View File

@ -0,0 +1,108 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- 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 "RicCreateTextAnnotationIn3dViewFeature.h"
#include "RiaApplication.h"
#include "RimAnnotationInViewCollection.h"
#include "RimEclipseContourMapView.h"
#include "RimCase.h"
#include "RimGridView.h"
#include "RimTextAnnotation.h"
#include "RiuMainWindow.h"
#include "RiuViewer.h"
#include "cvfBoundingBox.h"
#include "cvfCamera.h"
#include <QAction>
#include <cmath>
CAF_CMD_SOURCE_INIT(RicCreateTextAnnotationIn3dViewFeature, "RicCreateTextAnnotationIn3dViewFeature");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicCreateTextAnnotationIn3dViewFeature::isCommandEnabled()
{
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCreateTextAnnotationIn3dViewFeature::onActionTriggered(bool isChecked)
{
RimGridView* activeView = RiaApplication::instance()->activeGridView();
RimEclipseContourMapView * contMapView = dynamic_cast<RimEclipseContourMapView*>(activeView);
if ( activeView )
{
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
cvf::BoundingBox bbox = activeView->ownerCase()->activeCellsBoundingBox();
if (contMapView) domainCoord[2] = bbox.max().z() - bbox.extent().z() * 0.2;
auto coll = activeView->annotationCollection();
if ( coll )
{
auto newAnnotation = new RimTextAnnotation();
newAnnotation->setAnchorPoint(domainCoord);
cvf::Vec3d labelPos = domainCoord;
if (activeView->viewer()->mainCamera()->direction().z() <= 0)
{
labelPos.z() = bbox.max().z();
}
else
{
labelPos.z() = bbox.min().z();
}
cvf::Vec3d horizontalRight = activeView->viewer()->mainCamera()->direction() ^ cvf::Vec3d::Z_AXIS;
cvf::Vec3d horizontalUp = activeView->viewer()->mainCamera()->up() - (cvf::Vec3d::Z_AXIS * (activeView->viewer()->mainCamera()->up() * cvf::Vec3d::Z_AXIS) );
bool isOk = horizontalRight.normalize();
if (!isOk) horizontalRight = {1.0, 0.0, 0.0};
double height = fabs(labelPos.z() - domainCoord.z());
newAnnotation->setLabelPoint(labelPos + 2.0*height * (horizontalRight + horizontalUp));
coll->addAnnotation(newAnnotation);
coll->scheduleRedrawOfRelevantViews();
coll->updateConnectedEditors();
RiuMainWindow::instance()->selectAsCurrentItem(newAnnotation);
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCreateTextAnnotationIn3dViewFeature::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setIcon(QIcon(":/TextAnnotation16x16.png"));
actionToSetup->setText("Create Text Annotation");
}

View File

@ -0,0 +1,36 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- 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 RicCreateTextAnnotationIn3dViewFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
// Overrides
bool isCommandEnabled() override;
void onActionTriggered(bool isChecked) override;
void setupActionLook(QAction* actionToSetup) override;
};

View File

@ -0,0 +1,92 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- 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 "RicCreateUserDefinedPolylinesAnnotationFeature.h"
#include "RiaApplication.h"
#include "RiaColorTables.h"
#include "RimTextAnnotation.h"
#include "RimReachCircleAnnotation.h"
#include "RimUserDefinedPolylinesAnnotation.h"
#include "RimAnnotationCollection.h"
#include "RimAnnotationGroupCollection.h"
#include "RimAnnotationInViewCollection.h"
#include "RimAnnotationLineAppearance.h"
#include "RimProject.h"
#include "RimOilField.h"
#include "RiuMainWindow.h"
#include <cafSelectionManagerTools.h>
#include <QAction>
CAF_CMD_SOURCE_INIT(RicCreateUserDefinedPolylinesAnnotationFeature, "RicCreateUserDefinedPolylinesAnnotationFeature");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicCreateUserDefinedPolylinesAnnotationFeature::isCommandEnabled()
{
auto selObjs = caf::selectedObjectsByTypeStrict<RimAnnotationCollection*>();
auto selGroupColl = caf::selectedObjectsByTypeStrict<RimAnnotationGroupCollection*>();
return selObjs.size() == 1 || (selGroupColl.size() == 1 && selGroupColl.front()->uiCapability()->uiName() ==
RimAnnotationGroupCollection::USED_DEFINED_POLYLINE_ANNOTATION_UI_NAME);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCreateUserDefinedPolylinesAnnotationFeature::onActionTriggered(bool isChecked)
{
auto coll = annotationCollection();
if (coll)
{
auto newAnnotation = new RimUserDefinedPolylinesAnnotation();
auto newColor = RiaColorTables::categoryPaletteColors().cycledColor3f(coll->lineBasedAnnotationsCount());
newAnnotation->appearance()->setColor(newColor);
newAnnotation->appearance()->setSphereColor(newColor);
newAnnotation->enablePicking(true);
coll->addAnnotation(newAnnotation);
coll->updateConnectedEditors();
RiuMainWindow::instance()->selectAsCurrentItem(newAnnotation);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCreateUserDefinedPolylinesAnnotationFeature::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setIcon(QIcon(":/Plus.png"));
actionToSetup->setText("Create User Defined Polyline Annotation");
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimAnnotationCollection* RicCreateUserDefinedPolylinesAnnotationFeature::annotationCollection() const
{
auto project = RiaApplication::instance()->project();
auto oilField = project->activeOilField();
return oilField ? oilField->annotationCollection() : nullptr;
}

View File

@ -0,0 +1,46 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- 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 "RiaPreferences.h"
#include "cafCmdFeature.h"
#include <QString>
class RimAnnotationCollection;
//==================================================================================================
///
//==================================================================================================
class RicCreateUserDefinedPolylinesAnnotationFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
// Overrides
bool isCommandEnabled() override;
void onActionTriggered(bool isChecked) override;
void setupActionLook(QAction* actionToSetup) override;
private:
RimAnnotationCollection* annotationCollection() const;
};

Some files were not shown because too many files have changed in this diff Show More