mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2585 3D well log curves: Create visualization for a curve, random offsetted from a well path
This commit is contained in:
parent
16551c05c4
commit
06504b6fef
@ -37,6 +37,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RivWellConnectionsPartMgr.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RivFishbonesSubsPartMgr.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RivTensorResultPartMgr.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RivWellFracturePartMgr.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/Riv3dWellLogPlanePartMgr.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/Riv3dWellLogCurveGeomertyGenerator.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@ -72,6 +74,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RivWellConnectionsPartMgr.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RivFishbonesSubsPartMgr.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RivTensorResultPartMgr.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RivWellFracturePartMgr.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/Riv3dWellLogPlanePartMgr.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/Riv3dWellLogCurveGeomertyGenerator.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
@ -0,0 +1,41 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "Riv3dWellLogCurveGeomertyGenerator.h"
|
||||
|
||||
#include "cvfDrawableGeo.h"
|
||||
#include "cvfPrimitiveSetIndexedUInt.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::DrawableGeo> Riv3dWellLogCurveGeometryGenerator::createDrawable(const std::vector<cvf::Vec3f>& vertices, const std::vector<cvf::uint>& indices) const
|
||||
{
|
||||
cvf::ref<cvf::PrimitiveSetIndexedUInt> indexedUInt = new cvf::PrimitiveSetIndexedUInt(cvf::PrimitiveType::PT_LINES);
|
||||
cvf::ref<cvf::UIntArray> indexArray = new cvf::UIntArray(indices);
|
||||
|
||||
cvf::ref<cvf::DrawableGeo> drawable = new cvf::DrawableGeo();
|
||||
|
||||
indexedUInt->setIndices(indexArray.p());
|
||||
drawable->addPrimitiveSet(indexedUInt.p());
|
||||
|
||||
cvf::ref<cvf::Vec3fArray> vertexArray = new cvf::Vec3fArray(vertices);
|
||||
drawable->setVertexArray(vertexArray.p());
|
||||
|
||||
return drawable;
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "cvfObject.h"
|
||||
#include "cvfBase.h"
|
||||
#include "cvfDrawableGeo.h"
|
||||
#include "cvfVector3.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace caf
|
||||
{
|
||||
class DisplayCoordTransform;
|
||||
}
|
||||
|
||||
class Riv3dWellLogCurveGeometryGenerator : public cvf::Object
|
||||
{
|
||||
public:
|
||||
Riv3dWellLogCurveGeometryGenerator() = default;
|
||||
|
||||
cvf::ref<cvf::DrawableGeo> createDrawable(const std::vector<cvf::Vec3f>& vertices, const std::vector<cvf::uint>& indices ) const;
|
||||
};
|
@ -0,0 +1,90 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "Riv3dWellLogPlanePartMgr.h"
|
||||
|
||||
#include "RigWellPath.h"
|
||||
|
||||
#include "Riv3dWellLogCurveGeomertyGenerator.h"
|
||||
|
||||
#include "cafDisplayCoordTransform.h"
|
||||
#include "cafEffectGenerator.h"
|
||||
|
||||
#include "cvfModelBasicList.h"
|
||||
#include "cvfPart.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
Riv3dWellLogPlanePartMgr::Riv3dWellLogPlanePartMgr(RigWellPath* wellPathGeometry)
|
||||
:m_wellPathGeometry(wellPathGeometry)
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Riv3dWellLogPlanePartMgr::append3dWellLogCurvesToModel(cvf::ModelBasicList* model,
|
||||
const caf::DisplayCoordTransform* displayCoordTransform,
|
||||
std::vector<Rim3dWellLogCurve*>* rim3dWellLogCurves)
|
||||
{
|
||||
if (rim3dWellLogCurves->empty()) return;
|
||||
|
||||
m_3dWellLogCurveGeometryGenerator = new Riv3dWellLogCurveGeometryGenerator;
|
||||
|
||||
std::vector<cvf::Vec3d> wellPathPoints = m_wellPathGeometry->m_wellPathPoints;
|
||||
|
||||
std::vector<cvf::Vec3f> vertices;
|
||||
vertices.resize(wellPathPoints.size());
|
||||
|
||||
cvf::Mat4d transMat;
|
||||
transMat.setTranslation(cvf::Vec3d(0, 0, 10));
|
||||
|
||||
for (size_t i = 0; i < wellPathPoints.size(); i++)
|
||||
{
|
||||
wellPathPoints[i].transformPoint(transMat);
|
||||
vertices[i] = cvf::Vec3f(displayCoordTransform->transformToDisplayCoord(wellPathPoints[i]));
|
||||
}
|
||||
|
||||
std::vector<cvf::uint> indices;
|
||||
indices.resize((vertices.size() - 1) * 2);
|
||||
|
||||
cvf::uint counter = 0;
|
||||
for (size_t i = 0; i < indices.size(); i++)
|
||||
{
|
||||
indices[i] = counter;
|
||||
if (i % 2 == 0) counter++;
|
||||
}
|
||||
|
||||
for (Rim3dWellLogCurve* rim3dWellLogCurve : *rim3dWellLogCurves)
|
||||
{
|
||||
cvf::ref<cvf::Drawable> drawable = m_3dWellLogCurveGeometryGenerator->createDrawable(vertices, indices);
|
||||
|
||||
caf::SurfaceEffectGenerator surfaceGen(cvf::Color4f(255, 0, 0, 0.5), caf::PO_1);
|
||||
cvf::ref<cvf::Effect> effect = surfaceGen.generateCachedEffect();
|
||||
|
||||
cvf::ref<cvf::Part> part = new cvf::Part;
|
||||
part->setDrawable(drawable.p());
|
||||
part->setEffect(effect.p());
|
||||
|
||||
if (part.notNull())
|
||||
{
|
||||
model->addPart(part.p());
|
||||
}
|
||||
}
|
||||
}
|
@ -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 "cvfObject.h"
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
#include "Rim3dWellLogCurve.h"
|
||||
|
||||
namespace cvf
|
||||
{
|
||||
class ModelBasicList;
|
||||
class Part;
|
||||
}
|
||||
|
||||
namespace caf
|
||||
{
|
||||
class DisplayCoordTransform;
|
||||
}
|
||||
|
||||
class Riv3dWellLogCurveGeometryGenerator;
|
||||
class RigWellPath;
|
||||
|
||||
class Riv3dWellLogPlanePartMgr : public cvf::Object
|
||||
{
|
||||
public:
|
||||
Riv3dWellLogPlanePartMgr(RigWellPath* wellPathGeometry);
|
||||
|
||||
void append3dWellLogCurvesToModel(cvf::ModelBasicList* model,
|
||||
const caf::DisplayCoordTransform* displayCoordTransform,
|
||||
std::vector<Rim3dWellLogCurve*>* rim3dWellLogCurves);
|
||||
|
||||
private:
|
||||
cvf::ref<Riv3dWellLogCurveGeometryGenerator> m_3dWellLogCurveGeometryGenerator;
|
||||
cvf::ref<RigWellPath> m_wellPathGeometry;
|
||||
};
|
@ -40,15 +40,14 @@
|
||||
#include "RimWellPathFractureCollection.h"
|
||||
#include "RimWellPathFracture.h"
|
||||
|
||||
#include "Riv3dWellLogPlanePartMgr.h"
|
||||
#include "RivFishbonesSubsPartMgr.h"
|
||||
#include "RivObjectSourceInfo.h"
|
||||
#include "RivPartPriority.h"
|
||||
#include "RivPipeGeometryGenerator.h"
|
||||
#include "RivWellPathSourceInfo.h"
|
||||
|
||||
#include "RivPartPriority.h"
|
||||
#include "RivWellFracturePartMgr.h"
|
||||
#include "RivWellPathPartMgr.h"
|
||||
#include "RivWellPathSourceInfo.h"
|
||||
|
||||
#include "cafDisplayCoordTransform.h"
|
||||
#include "cafEffectGenerator.h"
|
||||
@ -418,6 +417,9 @@ void RivWellPathPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList*
|
||||
return;
|
||||
|
||||
appendPerforationsToModel(timeStamp, model, displayCoordTransform, characteristicCellSize);
|
||||
|
||||
m_3dWellLogCurvePartMgr = new Riv3dWellLogPlanePartMgr(m_rimWellPath->wellPathGeometry());
|
||||
m_3dWellLogCurvePartMgr->append3dWellLogCurvesToModel(model, displayCoordTransform, &m_rimWellPath->vectorOf3dWellLogCurves());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -45,6 +45,7 @@ class RimWellPath;
|
||||
class RivFishbonesSubsPartMgr;
|
||||
class RimWellPathCollection;
|
||||
class Rim3dView;
|
||||
class Riv3dWellLogPlanePartMgr;
|
||||
|
||||
class QDateTime;
|
||||
|
||||
@ -105,4 +106,6 @@ private:
|
||||
cvf::ref<cvf::Part> m_centerLinePart;
|
||||
cvf::ref<cvf::DrawableGeo> m_centerLineDrawable;
|
||||
cvf::ref<cvf::Part> m_wellLabelPart;
|
||||
|
||||
cvf::ref<Riv3dWellLogPlanePartMgr> m_3dWellLogCurvePartMgr;
|
||||
};
|
||||
|
@ -63,6 +63,20 @@ void Rim3dWellLogCurveCollection::add3dWellLogCurve(Rim3dWellLogCurve* curve)
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<Rim3dWellLogCurve*> Rim3dWellLogCurveCollection::vectorOf3dWellLogCurves() const
|
||||
{
|
||||
std::vector<Rim3dWellLogCurve*> curves;
|
||||
for (auto& wellLogCurve : m_3dWellLogCurves)
|
||||
{
|
||||
curves.push_back(wellLogCurve);
|
||||
}
|
||||
|
||||
return curves;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -39,6 +39,8 @@ public:
|
||||
bool has3dWellLogCurves() const;
|
||||
void add3dWellLogCurve(Rim3dWellLogCurve* curve);
|
||||
|
||||
std::vector<Rim3dWellLogCurve*> vectorOf3dWellLogCurves() const;
|
||||
|
||||
private:
|
||||
virtual caf::PdmFieldHandle* objectToggleField() override;
|
||||
|
||||
|
@ -809,6 +809,14 @@ void RimWellPath::add3dWellLogCurve(Rim3dWellLogCurve* rim3dWellLogCurve)
|
||||
m_3dWellLogCurves->add3dWellLogCurve(rim3dWellLogCurve);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<Rim3dWellLogCurve*> RimWellPath::vectorOf3dWellLogCurves() const
|
||||
{
|
||||
return m_3dWellLogCurves->vectorOf3dWellLogCurves();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -22,6 +22,8 @@
|
||||
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
|
||||
#include "Rim3dWellLogCurve.h"
|
||||
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmPointer.h"
|
||||
@ -51,7 +53,6 @@ class RigWellPathFormations;
|
||||
|
||||
class RimWellPathFractureCollection;
|
||||
class Rim3dWellLogCurveCollection;
|
||||
class Rim3dWellLogCurve;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@ -79,6 +80,7 @@ public:
|
||||
const RigWellPathFormations* formationsGeometry() const;
|
||||
|
||||
void add3dWellLogCurve(Rim3dWellLogCurve* rim3dWellLogCurve);
|
||||
std::vector<Rim3dWellLogCurve*> vectorOf3dWellLogCurves() const;
|
||||
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() override;
|
||||
virtual caf::PdmFieldHandle* objectToggleField() override;
|
||||
|
Loading…
Reference in New Issue
Block a user