#2597 3D Well Log Curve: Add option to create LAS curve

This commit is contained in:
Rebecca Cox 2018-03-15 12:55:50 +01:00
parent c8b92a0c89
commit cc47016572
6 changed files with 238 additions and 11 deletions

View File

@ -103,10 +103,13 @@ void Riv3dWellLogCurveGeometryGenerator::createCurveVerticesAndIndices(const Rim
std::vector<cvf::Vec3f>* vertices,
std::vector<cvf::uint>* indices) const
{
if (m_wellPathGeometry.isNull()) return;
std::vector<double> resultValues;
std::vector<double> mds;
rim3dWellLogCurve->resultValuesAndMds(&resultValues, &mds);
rim3dWellLogCurve->curveValuesAndMds(&resultValues, &mds);
if (resultValues.empty()) return;
CVF_ASSERT(resultValues.size() == mds.size());
cvf::Vec3d globalDirection =

View File

@ -99,6 +99,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCalculationVariable.h
${CMAKE_CURRENT_LIST_DIR}/RimStimPlanLegendConfig.h
${CMAKE_CURRENT_LIST_DIR}/RimStimPlanColors.h
${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogCurve.h
${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogFileCurve.h
${CMAKE_CURRENT_LIST_DIR}/RimVirtualPerforationResults.h
)
@ -203,6 +204,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCalculationVariable.cpp
${CMAKE_CURRENT_LIST_DIR}/RimStimPlanLegendConfig.cpp
${CMAKE_CURRENT_LIST_DIR}/RimStimPlanColors.cpp
${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogCurve.cpp
${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogFileCurve.cpp
${CMAKE_CURRENT_LIST_DIR}/RimVirtualPerforationResults.cpp
)

View File

@ -178,9 +178,9 @@ bool Rim3dWellLogCurve::toggleState() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dWellLogCurve::resultValuesAndMds(std::vector<double>* resultValues, std::vector<double>* measuredDepthValues) const
void Rim3dWellLogCurve::curveValuesAndMds(std::vector<double>* values, std::vector<double>* measuredDepthValues) const
{
CAF_ASSERT(resultValues != nullptr);
CAF_ASSERT(values != nullptr);
CAF_ASSERT(measuredDepthValues != nullptr);
cvf::ref<RigEclipseWellLogExtractor> eclExtractor;
@ -216,7 +216,7 @@ void Rim3dWellLogCurve::resultValuesAndMds(std::vector<double>* resultValues, st
m_eclipseResultDefinition);
if (resAcc.notNull())
{
eclExtractor->curveData(resAcc.p(), resultValues);
eclExtractor->curveData(resAcc.p(), values);
}
}
else if (geomExtractor.notNull())
@ -225,7 +225,7 @@ void Rim3dWellLogCurve::resultValuesAndMds(std::vector<double>* resultValues, st
m_geomResultDefinition->loadResult();
geomExtractor->curveData(m_geomResultDefinition->resultAddress(), m_timeStep, resultValues);
geomExtractor->curveData(m_geomResultDefinition->resultAddress(), m_timeStep, values);
}
}
@ -321,9 +321,7 @@ void Rim3dWellLogCurve::defineUiOrdering(QString uiConfigName, caf::PdmUiOrderin
}
caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup("Appearance");
appearanceGroup->add(&m_drawPlane);
appearanceGroup->add(&m_drawStyle);
appearanceGroup->add(&m_coloringStyle);
appearanceUiOrdering(*appearanceGroup);
uiOrdering.skipRemainingFields();
}
@ -340,3 +338,13 @@ void Rim3dWellLogCurve::initAfterRead()
m_geomResultDefinition->setGeoMechCase(geomCase);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dWellLogCurve::appearanceUiOrdering(caf::PdmUiOrdering& uiOrdering)
{
uiOrdering.add(&m_drawPlane);
uiOrdering.add(&m_drawStyle);
uiOrdering.add(&m_coloringStyle);
}

View File

@ -71,9 +71,9 @@ public:
DrawPlane drawPlane() const;
bool toggleState() const;
void resultValuesAndMds(std::vector<double>* resultValues, std::vector<double>* measuredDepthValues) const;
virtual void curveValuesAndMds(std::vector<double>* values, std::vector<double>* measuredDepthValues) const;
private:
protected:
virtual caf::PdmFieldHandle* objectToggleField() override;
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
@ -82,9 +82,13 @@ private:
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
virtual void initAfterRead() override;
void appearanceUiOrdering(caf::PdmUiOrdering& uiOrdering);
protected:
caf::PdmField<QString> m_name;
private:
caf::PdmField<bool> m_showCurve;
caf::PdmField<QString> m_name;
caf::PdmPtrField<RimCase*> m_case;
caf::PdmField<int> m_timeStep;

View File

@ -0,0 +1,158 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- 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 "Rim3dWellLogFileCurve.h"
#include "RigWellLogFile.h"
#include "RimWellLogFile.h"
#include "RimWellLogFileChannel.h"
#include "RimWellPath.h"
#include <QFileInfo>
//==================================================================================================
///
///
//==================================================================================================
CAF_PDM_SOURCE_INIT(Rim3dWellLogFileCurve, "Rim3dWellLogFileCurve");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Rim3dWellLogFileCurve::Rim3dWellLogFileCurve()
{
CAF_PDM_InitObject("3d Well Log File Curve", ":/WellLogCurve16x16.png", "", "");
CAF_PDM_InitFieldNoDefault(&m_wellLogChannnelName, "CurveWellLogChannel", "Well Log Channel", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_wellLogFile, "WellLogFile", "Well Log File", "", "", "");
m_name = "3D Well Log LAS Curve";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Rim3dWellLogFileCurve::~Rim3dWellLogFileCurve() {}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dWellLogFileCurve::setDefaultFileCurveDataInfo()
{
RimWellPath* wellPath = nullptr;
firstAncestorOrThisOfType(wellPath);
if (wellPath && !wellPath->wellLogFiles().empty())
{
m_wellLogFile = wellPath->wellLogFiles()[0];
}
if (m_wellLogFile)
{
std::vector<RimWellLogFileChannel*> fileLogs = m_wellLogFile->wellLogChannels();
if (!fileLogs.empty())
{
m_wellLogChannnelName = fileLogs[0]->name();
m_name = "LAS: " + m_wellLogChannnelName;
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dWellLogFileCurve::curveValuesAndMds(std::vector<double>* values, std::vector<double>* measuredDepthValues) const
{
if (m_wellLogFile)
{
RigWellLogFile* wellLogFile = m_wellLogFile->wellLogFileData();
if (wellLogFile)
{
*values = wellLogFile->values(m_wellLogChannnelName);
*measuredDepthValues = wellLogFile->depthValues();
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo> Rim3dWellLogFileCurve::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly)
{
QList<caf::PdmOptionItemInfo> options;
options = Rim3dWellLogCurve::calculateValueOptions(fieldNeedingOptions, useOptionsOnly);
if (!options.empty()) return options;
if (fieldNeedingOptions == &m_wellLogChannnelName)
{
if (m_wellLogFile)
{
std::vector<RimWellLogFileChannel*> fileLogs = m_wellLogFile->wellLogChannels();
for (size_t i = 0; i < fileLogs.size(); i++)
{
QString wellLogChannelName = fileLogs[i]->name();
options.push_back(caf::PdmOptionItemInfo(wellLogChannelName, wellLogChannelName));
}
}
if (options.size() == 0)
{
options.push_back(caf::PdmOptionItemInfo("None", "None"));
}
}
if (fieldNeedingOptions == &m_wellLogFile)
{
RimWellPath* wellPath = nullptr;
firstAncestorOrThisOfType(wellPath);
if (wellPath && !wellPath->wellLogFiles().empty())
{
for (RimWellLogFile* const wellLogFile : wellPath->wellLogFiles())
{
QFileInfo fileInfo(wellLogFile->fileName());
options.push_back(caf::PdmOptionItemInfo(fileInfo.baseName(), wellLogFile));
}
}
}
return options;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dWellLogFileCurve::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup("Curve Data");
curveDataGroup->add(&m_wellLogFile);
curveDataGroup->add(&m_wellLogChannnelName);
caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup("Appearance");
Rim3dWellLogCurve::appearanceUiOrdering(*appearanceGroup);
uiOrdering.skipRemainingFields(true);
}

View File

@ -0,0 +1,52 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- 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 "Rim3dWellLogCurve.h"
#include "cafPdmChildField.h"
#include "cafPdmField.h"
class RimWellLogFile;
//==================================================================================================
///
///
//==================================================================================================
class Rim3dWellLogFileCurve : public Rim3dWellLogCurve
{
CAF_PDM_HEADER_INIT;
public:
Rim3dWellLogFileCurve();
virtual ~Rim3dWellLogFileCurve();
void setDefaultFileCurveDataInfo();
virtual void curveValuesAndMds(std::vector<double>* values, std::vector<double>* measuredDepthValues) const override;
private:
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly) override;
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
private:
caf::PdmPtrField<RimWellLogFile*> m_wellLogFile;
caf::PdmField<QString> m_wellLogChannnelName;
};