From ffdafcfb97ae06ba81df8a5f027d494c9d275c6b Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 1 Aug 2017 14:36:13 +0200 Subject: [PATCH 1/8] #1708 Fishbones : Fix use of rand() for orientation of subs on Linux --- .../Completions/RimFishbonesMultipleSubs.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ApplicationCode/ProjectDataModel/Completions/RimFishbonesMultipleSubs.cpp b/ApplicationCode/ProjectDataModel/Completions/RimFishbonesMultipleSubs.cpp index 1d592d01dc..498553ac38 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimFishbonesMultipleSubs.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimFishbonesMultipleSubs.cpp @@ -711,9 +711,16 @@ std::vector RimFishbonesMultipleSubs::locationsFromStartSpacingAndCount( //-------------------------------------------------------------------------------------------------- int RimFishbonesMultipleSubs::randomValueFromRange(int min, int max) { + // See http://www.cplusplus.com/reference/cstdlib/rand/ + int range = abs(max - min); int random_integer = min + int(range*rand() / (RAND_MAX + 1.0)); - + return random_integer; + int randomNumberInRange = rand() % range; + + int randomValue = min + randomNumberInRange; + + return randomValue; } From fcfe0eb4a9945e99d917750f1868b0f52d735b9e Mon Sep 17 00:00:00 2001 From: astridkbjorke Date: Wed, 2 Aug 2017 13:10:08 +0200 Subject: [PATCH 2/8] #1716 Fixing error in Peaceman formula --- .../ReservoirDataModel/RigTransmissibilityEquations.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ApplicationCode/ReservoirDataModel/RigTransmissibilityEquations.cpp b/ApplicationCode/ReservoirDataModel/RigTransmissibilityEquations.cpp index c8a234a609..12ad91605f 100644 --- a/ApplicationCode/ReservoirDataModel/RigTransmissibilityEquations.cpp +++ b/ApplicationCode/ReservoirDataModel/RigTransmissibilityEquations.cpp @@ -33,8 +33,8 @@ double RigTransmissibilityEquations::peacemanRadius(double permeabilityNormalDir double cellSizeNormalDirection2) { double nominator = cvf::Math::sqrt( - pow(cellSizeNormalDirection2, 2) + pow(permeabilityNormalDirection1 / permeabilityNormalDirection2, 1 / 2) - + pow(cellSizeNormalDirection1, 2) + pow(permeabilityNormalDirection2 / permeabilityNormalDirection1, 1 / 2)); + pow(cellSizeNormalDirection2, 2) * pow(permeabilityNormalDirection1 / permeabilityNormalDirection2, 1 / 2) + + pow(cellSizeNormalDirection1, 2) * pow(permeabilityNormalDirection2 / permeabilityNormalDirection1, 1 / 2)); double denominator = pow((permeabilityNormalDirection1 / permeabilityNormalDirection2), 1 / 4) + pow((permeabilityNormalDirection2 / permeabilityNormalDirection1), 1 / 4); From ef8fc3dbc608753bb3762c3df80efca7fe76f541 Mon Sep 17 00:00:00 2001 From: astridkbjorke Date: Wed, 2 Aug 2017 13:29:45 +0200 Subject: [PATCH 3/8] #1716 Fix spelling --- .../ReservoirDataModel/RigTransmissibilityEquations.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ApplicationCode/ReservoirDataModel/RigTransmissibilityEquations.cpp b/ApplicationCode/ReservoirDataModel/RigTransmissibilityEquations.cpp index 12ad91605f..e4a991f81b 100644 --- a/ApplicationCode/ReservoirDataModel/RigTransmissibilityEquations.cpp +++ b/ApplicationCode/ReservoirDataModel/RigTransmissibilityEquations.cpp @@ -32,14 +32,14 @@ double RigTransmissibilityEquations::peacemanRadius(double permeabilityNormalDir double cellSizeNormalDirection1, double cellSizeNormalDirection2) { - double nominator = cvf::Math::sqrt( + double numerator = cvf::Math::sqrt( pow(cellSizeNormalDirection2, 2) * pow(permeabilityNormalDirection1 / permeabilityNormalDirection2, 1 / 2) + pow(cellSizeNormalDirection1, 2) * pow(permeabilityNormalDirection2 / permeabilityNormalDirection1, 1 / 2)); double denominator = pow((permeabilityNormalDirection1 / permeabilityNormalDirection2), 1 / 4) + pow((permeabilityNormalDirection2 / permeabilityNormalDirection1), 1 / 4); - double r0 = 0.28 * nominator / denominator; + double r0 = 0.28 * numerator / denominator; return r0; } From 9cd7dcdd913a888661f9433ea0453677c9e14084 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 3 Aug 2017 11:31:12 +0200 Subject: [PATCH 4/8] #1665 Add processEvents() when waiting for external octave process --- ApplicationCode/Application/RiaApplication.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ApplicationCode/Application/RiaApplication.cpp b/ApplicationCode/Application/RiaApplication.cpp index 456993b2c5..0514cef078 100644 --- a/ApplicationCode/Application/RiaApplication.cpp +++ b/ApplicationCode/Application/RiaApplication.cpp @@ -2168,6 +2168,7 @@ void RiaApplication::waitForProcess() const #else usleep(100000); #endif + processEvents(); } } From f437f8dc8459e56315e3d5661671043e91c9cb40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rnar=20Grip=20Fj=C3=A6r?= Date: Thu, 3 Aug 2017 15:00:52 +0200 Subject: [PATCH 5/8] #1734 Command File : Use caseId as variable name instead of case --- .../CommandFileInterface/RicfComputeCaseGroupStatistics.cpp | 2 +- ApplicationCode/CommandFileInterface/RicfExportMsw.cpp | 4 ++-- ApplicationCode/CommandFileInterface/RicfExportProperty.cpp | 2 +- ApplicationCode/CommandFileInterface/RicfExportSnapshots.cpp | 2 +- .../CommandFileInterface/RicfExportWellPathCompletions.cpp | 2 +- ApplicationCode/CommandFileInterface/RicfReplaceCase.cpp | 2 +- .../CommandFileInterface/RicfReplaceSourceCases.cpp | 2 +- ApplicationCode/CommandFileInterface/RicfRunOctaveScript.cpp | 4 ++-- ApplicationCode/CommandFileInterface/RicfSetTimeStep.cpp | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ApplicationCode/CommandFileInterface/RicfComputeCaseGroupStatistics.cpp b/ApplicationCode/CommandFileInterface/RicfComputeCaseGroupStatistics.cpp index 18846c28f3..7754c52a89 100644 --- a/ApplicationCode/CommandFileInterface/RicfComputeCaseGroupStatistics.cpp +++ b/ApplicationCode/CommandFileInterface/RicfComputeCaseGroupStatistics.cpp @@ -37,7 +37,7 @@ CAF_PDM_SOURCE_INIT(RicfComputeCaseGroupStatistics, "computeCaseGroupStatistics" //-------------------------------------------------------------------------------------------------- RicfComputeCaseGroupStatistics::RicfComputeCaseGroupStatistics() { - RICF_InitField(&m_caseIds, "cases", std::vector(), "Case IDs", "", "", ""); + RICF_InitField(&m_caseIds, "caseIds", std::vector(), "Case IDs", "", "", ""); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/CommandFileInterface/RicfExportMsw.cpp b/ApplicationCode/CommandFileInterface/RicfExportMsw.cpp index 22b4ad9821..1c6489ebce 100644 --- a/ApplicationCode/CommandFileInterface/RicfExportMsw.cpp +++ b/ApplicationCode/CommandFileInterface/RicfExportMsw.cpp @@ -41,8 +41,8 @@ CAF_PDM_SOURCE_INIT(RicfExportMsw, "exportMsw"); //-------------------------------------------------------------------------------------------------- RicfExportMsw::RicfExportMsw() { - RICF_InitField(&m_caseId, "case", -1, "Case", "", "", ""); - RICF_InitField(&m_wellPathName, "wellPath", QString(), "Case", "", "", ""); + RICF_InitField(&m_caseId, "caseId", -1, "Case ID", "", "", ""); + RICF_InitField(&m_wellPathName, "wellPath", QString(), "Well Path Name", "", "", ""); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/CommandFileInterface/RicfExportProperty.cpp b/ApplicationCode/CommandFileInterface/RicfExportProperty.cpp index c5dc56fe20..03409eccae 100644 --- a/ApplicationCode/CommandFileInterface/RicfExportProperty.cpp +++ b/ApplicationCode/CommandFileInterface/RicfExportProperty.cpp @@ -41,7 +41,7 @@ CAF_PDM_SOURCE_INIT(RicfExportProperty, "exportProperty"); //-------------------------------------------------------------------------------------------------- RicfExportProperty::RicfExportProperty() { - RICF_InitField(&m_caseId, "case", -1, "Case", "", "", ""); + RICF_InitField(&m_caseId, "caseId", -1, "Case ID", "", "", ""); RICF_InitField(&m_timeStepIndex, "timeStep", -1, "Time Step Index", "", "", ""); RICF_InitField(&m_propertyName, "property", QString(), "Property Name", "", "", ""); RICF_InitField(&m_eclipseKeyword, "eclipseKeyword", QString(), "Eclipse Keyword", "", "", ""); diff --git a/ApplicationCode/CommandFileInterface/RicfExportSnapshots.cpp b/ApplicationCode/CommandFileInterface/RicfExportSnapshots.cpp index 3dfe25537e..0285a4c39c 100644 --- a/ApplicationCode/CommandFileInterface/RicfExportSnapshots.cpp +++ b/ApplicationCode/CommandFileInterface/RicfExportSnapshots.cpp @@ -46,7 +46,7 @@ namespace caf { //-------------------------------------------------------------------------------------------------- RicfExportSnapshots::RicfExportSnapshots() { - RICF_InitField(&m_type, "type", RicfExportSnapshots::SnapshotsTypeEnum(), "Type", "", "", ""); + RICF_InitField(&m_type, "type", RicfExportSnapshots::SnapshotsTypeEnum(), "Type", "", "", ""); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/CommandFileInterface/RicfExportWellPathCompletions.cpp b/ApplicationCode/CommandFileInterface/RicfExportWellPathCompletions.cpp index b3c2972174..4f24a9a790 100644 --- a/ApplicationCode/CommandFileInterface/RicfExportWellPathCompletions.cpp +++ b/ApplicationCode/CommandFileInterface/RicfExportWellPathCompletions.cpp @@ -39,7 +39,7 @@ CAF_PDM_SOURCE_INIT(RicfExportWellPathCompletions, "exportWellPathCompletions"); //-------------------------------------------------------------------------------------------------- RicfExportWellPathCompletions::RicfExportWellPathCompletions() { - RICF_InitField(&m_caseId, "case", -1, "Case ID", "", "", ""); + RICF_InitField(&m_caseId, "caseId", -1, "Case ID", "", "", ""); RICF_InitField(&m_timeStep, "timeStep", -1, "Time Step Index", "", "", ""); RICF_InitField(&m_wellPathNames, "wellPathNames", std::vector(), "Well Path Names", "", "", ""); RICF_InitField(&m_wellSelection, "wellSelection", RicExportCompletionDataSettingsUi::WellSelectionType(), "Well Selection", "", "", ""); diff --git a/ApplicationCode/CommandFileInterface/RicfReplaceCase.cpp b/ApplicationCode/CommandFileInterface/RicfReplaceCase.cpp index 2ea04ee8d4..669e41d3fd 100644 --- a/ApplicationCode/CommandFileInterface/RicfReplaceCase.cpp +++ b/ApplicationCode/CommandFileInterface/RicfReplaceCase.cpp @@ -31,7 +31,7 @@ CAF_PDM_SOURCE_INIT(RicfReplaceCase, "replaceCase"); //-------------------------------------------------------------------------------------------------- RicfReplaceCase::RicfReplaceCase() { - RICF_InitField(&m_caseId, "case", -1, "Case ID", "", "", ""); + RICF_InitField(&m_caseId, "caseId", -1, "Case ID", "", "", ""); RICF_InitField(&m_newGridFile, "newGridFile", QString(), "New Grid File", "", "", ""); } diff --git a/ApplicationCode/CommandFileInterface/RicfReplaceSourceCases.cpp b/ApplicationCode/CommandFileInterface/RicfReplaceSourceCases.cpp index 10463d2863..caa8ddd240 100644 --- a/ApplicationCode/CommandFileInterface/RicfReplaceSourceCases.cpp +++ b/ApplicationCode/CommandFileInterface/RicfReplaceSourceCases.cpp @@ -31,7 +31,7 @@ CAF_PDM_SOURCE_INIT(RicfReplaceSourceCases, "replaceSourceCases"); //-------------------------------------------------------------------------------------------------- RicfReplaceSourceCases::RicfReplaceSourceCases() { - RICF_InitField(&m_caseGroupId, "group", -1, "Group ID", "", "", ""); + RICF_InitField(&m_caseGroupId, "caseGroupId", -1, "Case Group ID", "", "", ""); RICF_InitField(&m_gridListFile, "gridListFile", QString(), "Grid List File", "", "", ""); } diff --git a/ApplicationCode/CommandFileInterface/RicfRunOctaveScript.cpp b/ApplicationCode/CommandFileInterface/RicfRunOctaveScript.cpp index 83c2d9389c..3b88f4e76a 100644 --- a/ApplicationCode/CommandFileInterface/RicfRunOctaveScript.cpp +++ b/ApplicationCode/CommandFileInterface/RicfRunOctaveScript.cpp @@ -31,8 +31,8 @@ CAF_PDM_SOURCE_INIT(RicfRunOctaveScript, "runOctaveScript"); //-------------------------------------------------------------------------------------------------- RicfRunOctaveScript::RicfRunOctaveScript() { - RICF_InitField(&m_path, "path", QString(), "Path", "", "", ""); - RICF_InitField(&m_caseIds, "cases", std::vector(), "Case IDs", "", "", ""); + RICF_InitField(&m_path, "path", QString(), "Path", "", "", ""); + RICF_InitField(&m_caseIds, "caseIds", std::vector(), "Case IDs", "", "", ""); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/CommandFileInterface/RicfSetTimeStep.cpp b/ApplicationCode/CommandFileInterface/RicfSetTimeStep.cpp index f487b37352..12b5434bd5 100644 --- a/ApplicationCode/CommandFileInterface/RicfSetTimeStep.cpp +++ b/ApplicationCode/CommandFileInterface/RicfSetTimeStep.cpp @@ -34,7 +34,7 @@ CAF_PDM_SOURCE_INIT(RicfSetTimeStep, "setTimeStep"); //-------------------------------------------------------------------------------------------------- RicfSetTimeStep::RicfSetTimeStep() { - RICF_InitField(&m_caseId, "case", -1, "Case ID", "", "", ""); + RICF_InitField(&m_caseId, "caseId", -1, "Case ID", "", "", ""); RICF_InitField(&m_timeStepIndex, "timeStep", -1, "Time Step Index", "", "", ""); } From a59735de8702055aca247f7709356a948e8230ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rnar=20Grip=20Fj=C3=A6r?= Date: Thu, 3 Aug 2017 16:22:02 +0200 Subject: [PATCH 6/8] #1730 Move snapshot features to separate files --- .../Application/RiaApplication.cpp | 3 +- .../RicfExportSnapshots.cpp | 2 +- .../ExportCommands/CMakeLists_files.cmake | 20 +- .../RicExportMultipleSnapshotsFeature.cpp | 2 +- .../RicSnapshotAllPlotsToFileFeature.cpp | 152 +++++++++++++ .../RicSnapshotAllPlotsToFileFeature.h | 44 ++++ .../RicSnapshotViewToClipboardFeature.cpp | 203 ------------------ .../RicSnapshotViewToClipboardFeature.h | 39 ---- .../RicSnapshotViewToFileFeature.cpp | 123 +++++++++++ .../RicSnapshotViewToFileFeature.h | 40 ++++ 10 files changed, 375 insertions(+), 253 deletions(-) create mode 100644 ApplicationCode/Commands/ExportCommands/RicSnapshotAllPlotsToFileFeature.cpp create mode 100644 ApplicationCode/Commands/ExportCommands/RicSnapshotAllPlotsToFileFeature.h create mode 100644 ApplicationCode/Commands/ExportCommands/RicSnapshotViewToFileFeature.cpp create mode 100644 ApplicationCode/Commands/ExportCommands/RicSnapshotViewToFileFeature.h diff --git a/ApplicationCode/Application/RiaApplication.cpp b/ApplicationCode/Application/RiaApplication.cpp index 0514cef078..1343fcbf42 100644 --- a/ApplicationCode/Application/RiaApplication.cpp +++ b/ApplicationCode/Application/RiaApplication.cpp @@ -88,7 +88,8 @@ #include "RiuFlowCharacteristicsPlot.h" #include "RicImportSummaryCaseFeature.h" -#include "ExportCommands/RicSnapshotViewToClipboardFeature.h" +#include "ExportCommands/RicSnapshotViewToFileFeature.h" +#include "ExportCommands/RicSnapshotAllPlotsToFileFeature.h" #include "SummaryPlotCommands/RicNewSummaryPlotFeature.h" #include "RicfCommandFileExecutor.h" diff --git a/ApplicationCode/CommandFileInterface/RicfExportSnapshots.cpp b/ApplicationCode/CommandFileInterface/RicfExportSnapshots.cpp index 0285a4c39c..bd363d0b11 100644 --- a/ApplicationCode/CommandFileInterface/RicfExportSnapshots.cpp +++ b/ApplicationCode/CommandFileInterface/RicfExportSnapshots.cpp @@ -20,7 +20,7 @@ #include "RicfCommandFileExecutor.h" -#include "ExportCommands/RicSnapshotViewToClipboardFeature.h" +#include "ExportCommands/RicSnapshotAllPlotsToFileFeature.h" #include "RiaApplication.h" diff --git a/ApplicationCode/Commands/ExportCommands/CMakeLists_files.cmake b/ApplicationCode/Commands/ExportCommands/CMakeLists_files.cmake index e21334253f..70dd562b89 100644 --- a/ApplicationCode/Commands/ExportCommands/CMakeLists_files.cmake +++ b/ApplicationCode/Commands/ExportCommands/CMakeLists_files.cmake @@ -5,31 +5,35 @@ if (${CMAKE_VERSION} VERSION_GREATER "2.8.2") endif() set (SOURCE_GROUP_HEADER_FILES +${CEE_CURRENT_LIST_DIR}RicCellRangeUi.h ${CEE_CURRENT_LIST_DIR}RicExportCarfin.h ${CEE_CURRENT_LIST_DIR}RicExportCarfinUi.h -${CEE_CURRENT_LIST_DIR}RicExportToLasFileFeature.h -${CEE_CURRENT_LIST_DIR}RicExportToLasFileResampleUi.h -${CEE_CURRENT_LIST_DIR}RicSnapshotViewToClipboardFeature.h ${CEE_CURRENT_LIST_DIR}RicExportFaultsFeature.h ${CEE_CURRENT_LIST_DIR}RicExportMultipleSnapshotsFeature.h +${CEE_CURRENT_LIST_DIR}RicExportToLasFileFeature.h +${CEE_CURRENT_LIST_DIR}RicExportToLasFileResampleUi.h ${CEE_CURRENT_LIST_DIR}RicSaveEclipseInputPropertyFeature.h ${CEE_CURRENT_LIST_DIR}RicSaveEclipseResultAsInputPropertyExec.h ${CEE_CURRENT_LIST_DIR}RicSaveEclipseResultAsInputPropertyFeature.h -${CEE_CURRENT_LIST_DIR}RicCellRangeUi.h +${CEE_CURRENT_LIST_DIR}RicSnapshotAllPlotsToFileFeature.h +${CEE_CURRENT_LIST_DIR}RicSnapshotViewToClipboardFeature.h +${CEE_CURRENT_LIST_DIR}RicSnapshotViewToFileFeature.h ) set (SOURCE_GROUP_SOURCE_FILES +${CEE_CURRENT_LIST_DIR}RicCellRangeUi.cpp ${CEE_CURRENT_LIST_DIR}RicExportCarfin.cpp ${CEE_CURRENT_LIST_DIR}RicExportCarfinUi.cpp -${CEE_CURRENT_LIST_DIR}RicExportToLasFileFeature.cpp -${CEE_CURRENT_LIST_DIR}RicExportToLasFileResampleUi.cpp -${CEE_CURRENT_LIST_DIR}RicSnapshotViewToClipboardFeature.cpp ${CEE_CURRENT_LIST_DIR}RicExportFaultsFeature.cpp ${CEE_CURRENT_LIST_DIR}RicExportMultipleSnapshotsFeature.cpp +${CEE_CURRENT_LIST_DIR}RicExportToLasFileFeature.cpp +${CEE_CURRENT_LIST_DIR}RicExportToLasFileResampleUi.cpp ${CEE_CURRENT_LIST_DIR}RicSaveEclipseInputPropertyFeature.cpp ${CEE_CURRENT_LIST_DIR}RicSaveEclipseResultAsInputPropertyExec.cpp ${CEE_CURRENT_LIST_DIR}RicSaveEclipseResultAsInputPropertyFeature.cpp -${CEE_CURRENT_LIST_DIR}RicCellRangeUi.cpp +${CEE_CURRENT_LIST_DIR}RicSnapshotAllPlotsToFileFeature.cpp +${CEE_CURRENT_LIST_DIR}RicSnapshotViewToClipboardFeature.cpp +${CEE_CURRENT_LIST_DIR}RicSnapshotViewToFileFeature.cpp ) list(APPEND CODE_HEADER_FILES diff --git a/ApplicationCode/Commands/ExportCommands/RicExportMultipleSnapshotsFeature.cpp b/ApplicationCode/Commands/ExportCommands/RicExportMultipleSnapshotsFeature.cpp index 5d8c09df3a..ff579259d6 100644 --- a/ApplicationCode/Commands/ExportCommands/RicExportMultipleSnapshotsFeature.cpp +++ b/ApplicationCode/Commands/ExportCommands/RicExportMultipleSnapshotsFeature.cpp @@ -20,7 +20,7 @@ #include "RiaApplication.h" -#include "RicSnapshotViewToClipboardFeature.h" +#include "RicSnapshotViewToFileFeature.h" #include "RigFemResultPosEnum.h" diff --git a/ApplicationCode/Commands/ExportCommands/RicSnapshotAllPlotsToFileFeature.cpp b/ApplicationCode/Commands/ExportCommands/RicSnapshotAllPlotsToFileFeature.cpp new file mode 100644 index 0000000000..d6c0aa2ce2 --- /dev/null +++ b/ApplicationCode/Commands/ExportCommands/RicSnapshotAllPlotsToFileFeature.cpp @@ -0,0 +1,152 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2016 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicSnapshotAllPlotsToFileFeature.h" + +#include "RiaApplication.h" +#include "RiaLogging.h" + +#include "RimMainPlotCollection.h" +#include "RimProject.h" +#include "RimViewWindow.h" + +#include "RicSnapshotViewToFileFeature.h" + +#include "RiuMainPlotWindow.h" + +#include "cafUtils.h" + +#include +#include +#include +#include +#include +#include +#include + + +CAF_CMD_SOURCE_INIT(RicSnapshotAllPlotsToFileFeature, "RicSnapshotAllPlotsToFileFeature"); + + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicSnapshotAllPlotsToFileFeature::saveAllPlots() +{ + RiaApplication* app = RiaApplication::instance(); + + RiuMainPlotWindow* mainPlotWindow = app->mainPlotWindow(); + if (!mainPlotWindow) return; + + RimProject* proj = app->project(); + if (!proj) return; + + // Save images in snapshot catalog relative to project directory + QString snapshotFolderName = app->createAbsolutePathFromProjectRelativePath("snapshots"); + + exportSnapshotOfAllPlotsIntoFolder(snapshotFolderName); + + QString text = QString("Exported snapshots to folder : \n%1").arg(snapshotFolderName); + QMessageBox::information(nullptr, "Export Snapshots To Folder", text); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicSnapshotAllPlotsToFileFeature::exportSnapshotOfAllPlotsIntoFolder(QString snapshotFolderName) +{ + RiaApplication* app = RiaApplication::instance(); + + RimProject* proj = app->project(); + if (!proj) return; + + QDir snapshotPath(snapshotFolderName); + if (!snapshotPath.exists()) + { + if (!snapshotPath.mkpath(".")) return; + } + + const QString absSnapshotPath = snapshotPath.absolutePath(); + + std::vector viewWindows; + proj->mainPlotCollection()->descendantsIncludingThisOfType(viewWindows); + + for (auto viewWindow : viewWindows) + { + if (viewWindow->isMdiWindow() && viewWindow->viewWidget()) + { + QString fileName; + if ( viewWindow->userDescriptionField()) + { + fileName = viewWindow->userDescriptionField()->uiCapability()->uiValue().toString(); + } + else + { + fileName = viewWindow->uiCapability()->uiName(); + } + + fileName = caf::Utils::makeValidFileBasename(fileName); + + QString absoluteFileName = caf::Utils::constructFullFileName(absSnapshotPath, fileName, ".png"); + absoluteFileName.replace(" ", "_"); + + RicSnapshotViewToFileFeature::saveSnapshotAs(absoluteFileName, viewWindow); + } + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicSnapshotAllPlotsToFileFeature::isCommandEnabled() +{ + return true; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicSnapshotAllPlotsToFileFeature::onActionTriggered(bool isChecked) +{ + QWidget* currentActiveWidget = nullptr; + if (RiaApplication::activeViewWindow()) + { + currentActiveWidget = RiaApplication::activeViewWindow()->viewWidget(); + } + + RicSnapshotAllPlotsToFileFeature::saveAllPlots(); + + if (currentActiveWidget) + { + RiuMainPlotWindow* mainPlotWindow = RiaApplication::instance()->mainPlotWindow(); + if (mainPlotWindow) + { + mainPlotWindow->setActiveViewer(currentActiveWidget); + } + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicSnapshotAllPlotsToFileFeature::setupActionLook(QAction* actionToSetup) +{ + actionToSetup->setText("Snapshot All Plots To File"); + actionToSetup->setIcon(QIcon(":/SnapShotSaveViews.png")); +} + diff --git a/ApplicationCode/Commands/ExportCommands/RicSnapshotAllPlotsToFileFeature.h b/ApplicationCode/Commands/ExportCommands/RicSnapshotAllPlotsToFileFeature.h new file mode 100644 index 0000000000..922fe3914b --- /dev/null +++ b/ApplicationCode/Commands/ExportCommands/RicSnapshotAllPlotsToFileFeature.h @@ -0,0 +1,44 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2016 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafCmdFeature.h" + +class RimViewWindow; + +//================================================================================================== +/// +//================================================================================================== +class RicSnapshotAllPlotsToFileFeature : public caf::CmdFeature +{ + CAF_CMD_HEADER_INIT; + +public: + static void saveAllPlots(); + + static void exportSnapshotOfAllPlotsIntoFolder(QString snapshotFolderName); + +protected: + // Overrides + virtual bool isCommandEnabled() override; + virtual void onActionTriggered(bool isChecked) override; + virtual void setupActionLook(QAction* actionToSetup) override; +}; + + diff --git a/ApplicationCode/Commands/ExportCommands/RicSnapshotViewToClipboardFeature.cpp b/ApplicationCode/Commands/ExportCommands/RicSnapshotViewToClipboardFeature.cpp index d884e8e9dd..bcccfbd273 100644 --- a/ApplicationCode/Commands/ExportCommands/RicSnapshotViewToClipboardFeature.cpp +++ b/ApplicationCode/Commands/ExportCommands/RicSnapshotViewToClipboardFeature.cpp @@ -78,206 +78,3 @@ void RicSnapshotViewToClipboardFeature::setupActionLook(QAction* actionToSetup) actionToSetup->setText("Snapshot To Clipboard"); actionToSetup->setIcon(QIcon(":/SnapShot.png")); } - - - - -CAF_CMD_SOURCE_INIT(RicSnapshotViewToFileFeature, "RicSnapshotViewToFileFeature"); - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RicSnapshotViewToFileFeature::saveSnapshotAs(const QString& fileName, RimViewWindow* viewWindow) -{ - if (viewWindow) - { - QImage image = viewWindow->snapshotWindowContent(); - if (!image.isNull()) - { - if (image.save(fileName)) - { - qDebug() << "Exported snapshot image to " << fileName; - } - else - { - qDebug() << "Error when trying to export snapshot image to " << fileName; - } - } - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RicSnapshotViewToFileFeature::isCommandEnabled() -{ - return true; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RicSnapshotViewToFileFeature::onActionTriggered(bool isChecked) -{ - RiaApplication* app = RiaApplication::instance(); - RimProject* proj = app->project(); - - // Get active view window before displaying the file selection dialog - // If this is done after the file save dialog is displayed (and closed) - // app->activeViewWindow() returns NULL on Linux - RimViewWindow* viewWindow = app->activeViewWindow(); - if (!viewWindow) - { - RiaLogging::error("No view window is available, nothing to do"); - - return; - } - - QString startPath; - if (!proj->fileName().isEmpty()) - { - QFileInfo fi(proj->fileName()); - startPath = fi.absolutePath(); - } - else - { - startPath = app->lastUsedDialogDirectory("IMAGE_SNAPSHOT"); - } - - startPath += "/image.png"; - - QString fileName = QFileDialog::getSaveFileName(NULL, tr("Export to File"), startPath); - if (fileName.isEmpty()) - { - return; - } - - // Remember the directory to next time - app->setLastUsedDialogDirectory("IMAGE_SNAPSHOT", QFileInfo(fileName).absolutePath()); - - RicSnapshotViewToFileFeature::saveSnapshotAs(fileName, viewWindow); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RicSnapshotViewToFileFeature::setupActionLook(QAction* actionToSetup) -{ - actionToSetup->setText("Snapshot To File"); - actionToSetup->setIcon(QIcon(":/SnapShotSave.png")); -} - - - - - -CAF_CMD_SOURCE_INIT(RicSnapshotAllPlotsToFileFeature, "RicSnapshotAllPlotsToFileFeature"); - - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RicSnapshotAllPlotsToFileFeature::saveAllPlots() -{ - RiaApplication* app = RiaApplication::instance(); - - RiuMainPlotWindow* mainPlotWindow = app->mainPlotWindow(); - if (!mainPlotWindow) return; - - RimProject* proj = app->project(); - if (!proj) return; - - // Save images in snapshot catalog relative to project directory - QString snapshotFolderName = app->createAbsolutePathFromProjectRelativePath("snapshots"); - - exportSnapshotOfAllPlotsIntoFolder(snapshotFolderName); - - QString text = QString("Exported snapshots to folder : \n%1").arg(snapshotFolderName); - QMessageBox::information(nullptr, "Export Snapshots To Folder", text); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RicSnapshotAllPlotsToFileFeature::exportSnapshotOfAllPlotsIntoFolder(QString snapshotFolderName) -{ - RiaApplication* app = RiaApplication::instance(); - - RimProject* proj = app->project(); - if (!proj) return; - - QDir snapshotPath(snapshotFolderName); - if (!snapshotPath.exists()) - { - if (!snapshotPath.mkpath(".")) return; - } - - const QString absSnapshotPath = snapshotPath.absolutePath(); - - std::vector viewWindows; - proj->mainPlotCollection()->descendantsIncludingThisOfType(viewWindows); - - for (auto viewWindow : viewWindows) - { - if (viewWindow->isMdiWindow() && viewWindow->viewWidget()) - { - QString fileName; - if ( viewWindow->userDescriptionField()) - { - fileName = viewWindow->userDescriptionField()->uiCapability()->uiValue().toString(); - } - else - { - fileName = viewWindow->uiCapability()->uiName(); - } - - fileName = caf::Utils::makeValidFileBasename(fileName); - - QString absoluteFileName = caf::Utils::constructFullFileName(absSnapshotPath, fileName, ".png"); - absoluteFileName.replace(" ", "_"); - - RicSnapshotViewToFileFeature::saveSnapshotAs(absoluteFileName, viewWindow); - } - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RicSnapshotAllPlotsToFileFeature::isCommandEnabled() -{ - return true; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RicSnapshotAllPlotsToFileFeature::onActionTriggered(bool isChecked) -{ - QWidget* currentActiveWidget = nullptr; - if (RiaApplication::activeViewWindow()) - { - currentActiveWidget = RiaApplication::activeViewWindow()->viewWidget(); - } - - RicSnapshotAllPlotsToFileFeature::saveAllPlots(); - - if (currentActiveWidget) - { - RiuMainPlotWindow* mainPlotWindow = RiaApplication::instance()->mainPlotWindow(); - if (mainPlotWindow) - { - mainPlotWindow->setActiveViewer(currentActiveWidget); - } - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RicSnapshotAllPlotsToFileFeature::setupActionLook(QAction* actionToSetup) -{ - actionToSetup->setText("Snapshot All Plots To File"); - actionToSetup->setIcon(QIcon(":/SnapShotSaveViews.png")); -} - diff --git a/ApplicationCode/Commands/ExportCommands/RicSnapshotViewToClipboardFeature.h b/ApplicationCode/Commands/ExportCommands/RicSnapshotViewToClipboardFeature.h index ede5e606fc..f07092a77e 100644 --- a/ApplicationCode/Commands/ExportCommands/RicSnapshotViewToClipboardFeature.h +++ b/ApplicationCode/Commands/ExportCommands/RicSnapshotViewToClipboardFeature.h @@ -37,42 +37,3 @@ protected: }; - -//================================================================================================== -/// -//================================================================================================== -class RicSnapshotViewToFileFeature : public caf::CmdFeature -{ - CAF_CMD_HEADER_INIT; - -public: - static void saveSnapshotAs(const QString& fileName, RimViewWindow* viewWindow); - -protected: - // Overrides - virtual bool isCommandEnabled() override; - virtual void onActionTriggered(bool isChecked) override; - virtual void setupActionLook(QAction* actionToSetup) override; -}; - - -//================================================================================================== -/// -//================================================================================================== -class RicSnapshotAllPlotsToFileFeature : public caf::CmdFeature -{ - CAF_CMD_HEADER_INIT; - -public: - static void saveAllPlots(); - - static void exportSnapshotOfAllPlotsIntoFolder(QString snapshotFolderName); - -protected: - // Overrides - virtual bool isCommandEnabled() override; - virtual void onActionTriggered(bool isChecked) override; - virtual void setupActionLook(QAction* actionToSetup) override; -}; - - diff --git a/ApplicationCode/Commands/ExportCommands/RicSnapshotViewToFileFeature.cpp b/ApplicationCode/Commands/ExportCommands/RicSnapshotViewToFileFeature.cpp new file mode 100644 index 0000000000..24a0ca6991 --- /dev/null +++ b/ApplicationCode/Commands/ExportCommands/RicSnapshotViewToFileFeature.cpp @@ -0,0 +1,123 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2016 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicSnapshotViewToFileFeature.h" + +#include "RiaApplication.h" +#include "RiaLogging.h" + +#include "RimMainPlotCollection.h" +#include "RimProject.h" +#include "RimViewWindow.h" +#include "RiuMainPlotWindow.h" + +#include "cafUtils.h" + +#include +#include +#include +#include +#include +#include +#include + + +CAF_CMD_SOURCE_INIT(RicSnapshotViewToFileFeature, "RicSnapshotViewToFileFeature"); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicSnapshotViewToFileFeature::saveSnapshotAs(const QString& fileName, RimViewWindow* viewWindow) +{ + if (viewWindow) + { + QImage image = viewWindow->snapshotWindowContent(); + if (!image.isNull()) + { + if (image.save(fileName)) + { + qDebug() << "Exported snapshot image to " << fileName; + } + else + { + qDebug() << "Error when trying to export snapshot image to " << fileName; + } + } + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicSnapshotViewToFileFeature::isCommandEnabled() +{ + return true; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicSnapshotViewToFileFeature::onActionTriggered(bool isChecked) +{ + RiaApplication* app = RiaApplication::instance(); + RimProject* proj = app->project(); + + // Get active view window before displaying the file selection dialog + // If this is done after the file save dialog is displayed (and closed) + // app->activeViewWindow() returns NULL on Linux + RimViewWindow* viewWindow = app->activeViewWindow(); + if (!viewWindow) + { + RiaLogging::error("No view window is available, nothing to do"); + + return; + } + + QString startPath; + if (!proj->fileName().isEmpty()) + { + QFileInfo fi(proj->fileName()); + startPath = fi.absolutePath(); + } + else + { + startPath = app->lastUsedDialogDirectory("IMAGE_SNAPSHOT"); + } + + startPath += "/image.png"; + + QString fileName = QFileDialog::getSaveFileName(NULL, tr("Export to File"), startPath); + if (fileName.isEmpty()) + { + return; + } + + // Remember the directory to next time + app->setLastUsedDialogDirectory("IMAGE_SNAPSHOT", QFileInfo(fileName).absolutePath()); + + RicSnapshotViewToFileFeature::saveSnapshotAs(fileName, viewWindow); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicSnapshotViewToFileFeature::setupActionLook(QAction* actionToSetup) +{ + actionToSetup->setText("Snapshot To File"); + actionToSetup->setIcon(QIcon(":/SnapShotSave.png")); +} diff --git a/ApplicationCode/Commands/ExportCommands/RicSnapshotViewToFileFeature.h b/ApplicationCode/Commands/ExportCommands/RicSnapshotViewToFileFeature.h new file mode 100644 index 0000000000..ae83718d21 --- /dev/null +++ b/ApplicationCode/Commands/ExportCommands/RicSnapshotViewToFileFeature.h @@ -0,0 +1,40 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2016 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafCmdFeature.h" + +class RimViewWindow; + +//================================================================================================== +/// +//================================================================================================== +class RicSnapshotViewToFileFeature : public caf::CmdFeature +{ + CAF_CMD_HEADER_INIT; + +public: + static void saveSnapshotAs(const QString& fileName, RimViewWindow* viewWindow); + +protected: + // Overrides + virtual bool isCommandEnabled() override; + virtual void onActionTriggered(bool isChecked) override; + virtual void setupActionLook(QAction* actionToSetup) override; +}; From 6ddfab682387c83a0ae6992ec2c1f8a2f48e8837 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 4 Aug 2017 10:24:30 +0200 Subject: [PATCH 7/8] #1724 Removed unused code --- .../RivSimWellPipesPartMgr.cpp | 22 ------------------- .../RivSimWellPipesPartMgr.h | 2 -- 2 files changed, 24 deletions(-) diff --git a/ApplicationCode/ModelVisualization/RivSimWellPipesPartMgr.cpp b/ApplicationCode/ModelVisualization/RivSimWellPipesPartMgr.cpp index ead55683b6..9105000f45 100644 --- a/ApplicationCode/ModelVisualization/RivSimWellPipesPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivSimWellPipesPartMgr.cpp @@ -359,25 +359,3 @@ void RivSimWellPipesPartMgr::updatePipeResultColor(size_t frameIndex) } } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RivSimWellPipesPartMgr::findGridIndexAndCellIndex(size_t branchIndex, size_t triangleIndex, size_t* gridIndex, size_t* cellIndex) -{ - CVF_ASSERT(branchIndex < m_wellBranches.size()); - - RivPipeBranchData* branchData = pipeBranchData(branchIndex); - if (branchData) - { - size_t segmentIndex = branchData->m_pipeGeomGenerator->segmentIndexFromTriangleIndex(triangleIndex); - - *gridIndex = branchData->m_cellIds[segmentIndex].m_gridIndex; - *cellIndex = branchData->m_cellIds[segmentIndex].m_gridCellIndex; - } - else - { - *gridIndex = cvf::UNDEFINED_SIZE_T; - *cellIndex = cvf::UNDEFINED_SIZE_T; - } -} - diff --git a/ApplicationCode/ModelVisualization/RivSimWellPipesPartMgr.h b/ApplicationCode/ModelVisualization/RivSimWellPipesPartMgr.h index e113df8af4..caf3b07647 100644 --- a/ApplicationCode/ModelVisualization/RivSimWellPipesPartMgr.h +++ b/ApplicationCode/ModelVisualization/RivSimWellPipesPartMgr.h @@ -54,8 +54,6 @@ public: const std::vector< std::vector >& centerLineOfWellBranches() { return m_pipeBranchesCLCoords;} - void findGridIndexAndCellIndex(size_t branchIndex, size_t triangleIndex, size_t* gridIndex, size_t* cellIndex); - private: caf::PdmPointer m_rimReservoirView; caf::PdmPointer m_rimWell; From 88186619db54a7a0e5f303c82129577bb1b95ed3 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 4 Aug 2017 10:31:55 +0200 Subject: [PATCH 8/8] #1724 Apply fix on dev branch --- .../ModelVisualization/RivPipeGeometryGenerator.cpp | 13 ++++++++----- .../ModelVisualization/RivPipeGeometryGenerator.h | 4 ++-- .../ModelVisualization/RivWellPathPartMgr.cpp | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ApplicationCode/ModelVisualization/RivPipeGeometryGenerator.cpp b/ApplicationCode/ModelVisualization/RivPipeGeometryGenerator.cpp index aedbb49527..c5d3b5f5ee 100644 --- a/ApplicationCode/ModelVisualization/RivPipeGeometryGenerator.cpp +++ b/ApplicationCode/ModelVisualization/RivPipeGeometryGenerator.cpp @@ -38,7 +38,7 @@ RivPipeGeometryGenerator::RivPipeGeometryGenerator() m_crossSectionNodeCount = 8; m_minimumBendAngle = 80.0; m_bendScalingFactor = 0.00001; - m_firstSegmentIndex = 0; + m_firstVisibleSegmentIndex = 0; } //-------------------------------------------------------------------------------------------------- @@ -592,17 +592,20 @@ void RivPipeGeometryGenerator::clearComputedData() //-------------------------------------------------------------------------------------------------- size_t RivPipeGeometryGenerator::segmentIndexFromTriangleIndex(size_t triangleIndex) const { - size_t filteredIndex = triangleIndex / (m_crossSectionNodeCount * 2); + size_t segIndex = triangleIndex / (m_crossSectionNodeCount * 2); - return filteredIndex + m_firstSegmentIndex; + CVF_ASSERT(segIndex < m_filteredPipeSegmentToResult.size()); + size_t resultIndex = m_filteredPipeSegmentToResult[segIndex]; + + return resultIndex + m_firstVisibleSegmentIndex; } //-------------------------------------------------------------------------------------------------- /// Well pipes are clipped, set index to first segment in visible well path //-------------------------------------------------------------------------------------------------- -void RivPipeGeometryGenerator::setFirstSegmentIndex(size_t segmentIndex) +void RivPipeGeometryGenerator::setFirstVisibleSegmentIndex(size_t segmentIndex) { - m_firstSegmentIndex = segmentIndex; + m_firstVisibleSegmentIndex = segmentIndex; } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ModelVisualization/RivPipeGeometryGenerator.h b/ApplicationCode/ModelVisualization/RivPipeGeometryGenerator.h index 47e7fb3ae3..af8e14f9f9 100644 --- a/ApplicationCode/ModelVisualization/RivPipeGeometryGenerator.h +++ b/ApplicationCode/ModelVisualization/RivPipeGeometryGenerator.h @@ -59,7 +59,7 @@ public: void pipeSurfaceTextureCoords(cvf::Vec2fArray* textureCoords, const std::vector& segmentResults, const cvf::ScalarMapper* mapper) const; void centerlineTextureCoords(cvf::Vec2fArray* textureCoords, const std::vector& segmentResults, const cvf::ScalarMapper* mapper) const; - void setFirstSegmentIndex(size_t segmentIndex); + void setFirstVisibleSegmentIndex(size_t segmentIndex); size_t segmentIndexFromTriangleIndex(size_t triangleIndex) const; void cylinderWithCenterLineParts(cvf::Collection* destinationParts, const std::vector& centerCoords, const cvf::Color3f& color, double radius); @@ -91,7 +91,7 @@ private: // Map from generated cylinder segments to pipe result indices std::vector m_filteredPipeSegmentToResult; - size_t m_firstSegmentIndex; + size_t m_firstVisibleSegmentIndex; double m_radius; double m_minimumBendAngle; diff --git a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp index e8800228a3..92b15028d0 100644 --- a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp @@ -255,7 +255,7 @@ void RivWellPathPartMgr::buildWellPathParts(const caf::DisplayCoordTransform* di clippedPoints.push_back(wellPathGeometry->m_wellPathPoints[idx]); } - pbd.m_pipeGeomGenerator->setFirstSegmentIndex(firstVisibleSegmentIndex); + pbd.m_pipeGeomGenerator->setFirstVisibleSegmentIndex(firstVisibleSegmentIndex); } if (clippedPoints.size() < 2) return;