mirror of
https://github.com/OPM/ResInsight.git
synced 2026-09-03 20:53:13 -05:00
Merge remote-tracking branch 'refs/remotes/origin/dev'
Conflicts: ApplicationCode/ModelVisualization/RivPipeGeometryGenerator.h ApplicationCode/ProjectDataModel/RimEclipseWell.cpp ApplicationCode/ProjectDataModel/RimEclipseWell.h ApplicationCode/UserInterface/RiuViewerCommands.cpp
This commit is contained in:
@@ -126,8 +126,7 @@ void RivIntersectionBoxPartMgr::updateCellResultColor(size_t timeStepIndex)
|
||||
}
|
||||
else
|
||||
{
|
||||
resultAccessor = RigResultAccessorFactory::createFromResultDefinition(cellResultColors->reservoirView()->eclipseCase()->reservoirData(),
|
||||
0,
|
||||
resultAccessor = RigResultAccessorFactory::createFromResultDefinition(0,
|
||||
timeStepIndex,
|
||||
cellResultColors);
|
||||
}
|
||||
|
||||
+4
-1
@@ -24,13 +24,16 @@
|
||||
|
||||
#include "RimIntersection.h"
|
||||
|
||||
#include "RivHexGridIntersectionTools.h"
|
||||
|
||||
#include "cafHexGridIntersectionTools/cafHexGridIntersectionTools.h"
|
||||
|
||||
#include "cvfDrawableGeo.h"
|
||||
#include "cvfGeometryTools.h"
|
||||
#include "cvfPlane.h"
|
||||
#include "cvfPrimitiveSetDirect.h"
|
||||
#include "cvfPrimitiveSetIndexedUInt.h"
|
||||
#include "cvfScalarMapper.h"
|
||||
#include "cvfGeometryTools.h"
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RivHexGridIntersectionTools.h"
|
||||
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
#include "cvfArray.h"
|
||||
@@ -35,6 +33,8 @@ class RigMainGrid;
|
||||
class RigActiveCellInfo;
|
||||
class RigResultAccessor;
|
||||
class RimIntersection;
|
||||
class RivIntersectionHexGridInterface;
|
||||
class RivIntersectionVertexWeights;
|
||||
|
||||
namespace cvf
|
||||
{
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
#include "RimLegendConfig.h"
|
||||
#include "RimTernaryLegendConfig.h"
|
||||
|
||||
#include "RivHexGridIntersectionTools.h"
|
||||
#include "RivIntersectionGeometryGenerator.h"
|
||||
#include "RivIntersectionSourceInfo.h"
|
||||
#include "RivResultToTextureMapper.h"
|
||||
#include "RivScalarMapperUtils.h"
|
||||
@@ -45,6 +47,7 @@
|
||||
#include "RiuGeoMechXfTensorResultAccessor.h"
|
||||
|
||||
#include "cafTensor3.h"
|
||||
|
||||
#include "cvfDrawableGeo.h"
|
||||
#include "cvfGeometryTools.h"
|
||||
#include "cvfModelBasicList.h"
|
||||
@@ -131,8 +134,7 @@ void RivIntersectionPartMgr::updateCellResultColor(size_t timeStepIndex)
|
||||
}
|
||||
else
|
||||
{
|
||||
resultAccessor = RigResultAccessorFactory::createFromResultDefinition(cellResultColors->reservoirView()->eclipseCase()->reservoirData(),
|
||||
0,
|
||||
resultAccessor = RigResultAccessorFactory::createFromResultDefinition(0,
|
||||
timeStepIndex,
|
||||
cellResultColors);
|
||||
}
|
||||
|
||||
@@ -19,12 +19,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RivIntersectionGeometryGenerator.h"
|
||||
|
||||
#include "cvfBase.h"
|
||||
#include "cvfObject.h"
|
||||
#include "cvfColor4.h"
|
||||
#include "cvfVector3.h"
|
||||
#include "cvfArray.h"
|
||||
|
||||
|
||||
namespace cvf
|
||||
@@ -32,14 +31,21 @@ namespace cvf
|
||||
class ModelBasicList;
|
||||
class Transform;
|
||||
class Part;
|
||||
class ScalarMapper;
|
||||
}
|
||||
|
||||
class RigMainGrid;
|
||||
class RimEclipseCellColors;
|
||||
class RimCellEdgeColors;
|
||||
class RimIntersection;
|
||||
class RigGeoMechCaseData;
|
||||
class RigFemPart;
|
||||
class RigFemResultAddress;
|
||||
class RigGeoMechCaseData;
|
||||
class RigMainGrid;
|
||||
class RigResultAccessor;
|
||||
class RimCellEdgeColors;
|
||||
class RimEclipseCellColors;
|
||||
class RimIntersection;
|
||||
class RivIntersectionGeometryGenerator;
|
||||
class RivIntersectionHexGridInterface;
|
||||
class RivIntersectionVertexWeights;
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
|
||||
@@ -60,7 +60,7 @@ void RivCellEdgeGeometryUtils::addCellEdgeResultsToDrawableGeo(
|
||||
|
||||
// Create result access objects
|
||||
|
||||
cvf::ref<RigResultAccessor> cellCenterDataAccessObject = createCellCenterResultAccessor(cellResultColors, timeStepIndex, eclipseCase, eclipseCase->grid(gridIndex));
|
||||
cvf::ref<RigResultAccessor> cellCenterDataAccessObject = RigResultAccessorFactory::createFromResultDefinition(gridIndex, timeStepIndex, cellResultColors);
|
||||
cvf::ref<RigResultAccessor> cellEdgeResultAccessor = createCellEdgeResultAccessor(cellResultColors, cellEdgeResultColors, timeStepIndex, eclipseCase, eclipseCase->grid(gridIndex));
|
||||
|
||||
size_t vertexCount = geo->vertexArray()->size();
|
||||
@@ -298,10 +298,22 @@ cvf::ref<RigResultAccessor> RivCellEdgeGeometryUtils::createCellEdgeResultAccess
|
||||
const RigGridBase* grid)
|
||||
{
|
||||
cvf::ref<RigCellEdgeResultAccessor> cellEdgeResultAccessor = new RigCellEdgeResultAccessor();
|
||||
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultColors->porosityModel());
|
||||
|
||||
if (cellEdgeResultColors->propertyType() == RimCellEdgeColors::ANY_SINGLE_PROPERTY)
|
||||
{
|
||||
cvf::ref<RigResultAccessor> daObj = RigResultAccessorFactory::createFromResultDefinition(grid->gridIndex(), timeStepIndex, cellEdgeResultColors->singleVarEdgeResultColors());
|
||||
|
||||
for (size_t cubeFaceIdx = 0; cubeFaceIdx < 6; cubeFaceIdx++)
|
||||
{
|
||||
cellEdgeResultAccessor->setDataAccessObjectForFace(static_cast<cvf::StructGridInterface::FaceType>(cubeFaceIdx), daObj.p());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t resultIndices[6];
|
||||
cellEdgeResultColors->gridScalarIndices(resultIndices);
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultColors->porosityModel());
|
||||
|
||||
std::vector<RimCellEdgeMetaData> metaData;
|
||||
cellEdgeResultColors->cellEdgeMetaData(&metaData);
|
||||
@@ -323,29 +335,3 @@ cvf::ref<RigResultAccessor> RivCellEdgeGeometryUtils::createCellEdgeResultAccess
|
||||
return cellEdgeResultAccessor;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<RigResultAccessor> RivCellEdgeGeometryUtils::createCellCenterResultAccessor(RimEclipseCellColors* cellResultColors, size_t timeStepIndex, RigEclipseCaseData* eclipseCase, const RigGridBase* grid)
|
||||
{
|
||||
cvf::ref<RigResultAccessor> resultAccessor = NULL;
|
||||
|
||||
if (cellResultColors->hasResult())
|
||||
{
|
||||
resultAccessor = RigResultAccessorFactory::createFromResultDefinition(eclipseCase, grid->gridIndex(), timeStepIndex, cellResultColors);
|
||||
}
|
||||
|
||||
if (resultAccessor.isNull())
|
||||
{
|
||||
resultAccessor = new RigHugeValResultAccessor;
|
||||
}
|
||||
|
||||
return resultAccessor;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -57,12 +57,6 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
static cvf::ref<RigResultAccessor> createCellCenterResultAccessor(
|
||||
RimEclipseCellColors* cellResultColors,
|
||||
size_t timeStepIndex,
|
||||
RigEclipseCaseData* eclipseCase,
|
||||
const RigGridBase* grid);
|
||||
|
||||
static cvf::ref<RigResultAccessor> createCellEdgeResultAccessor(
|
||||
RimEclipseCellColors* cellResultColors,
|
||||
RimCellEdgeColors* cellEdgeResultColors,
|
||||
|
||||
@@ -19,14 +19,13 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#include "cvfLibCore.h"
|
||||
#include "cvfLibRender.h"
|
||||
#include "cvfLibGeometry.h"
|
||||
#include "cvfLibViewing.h"
|
||||
|
||||
#include "RivPipeGeometryGenerator.h"
|
||||
#include <vector>
|
||||
|
||||
#include "cafEffectGenerator.h"
|
||||
#include "cvfDrawableGeo.h"
|
||||
#include "cvfPlane.h"
|
||||
#include "cvfPrimitiveSetIndexedUInt.h"
|
||||
#include "cvfRay.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@@ -48,7 +47,6 @@ RivPipeGeometryGenerator::~RivPipeGeometryGenerator()
|
||||
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -59,7 +57,6 @@ void RivPipeGeometryGenerator::setPipeCenterCoords(const cvf::Vec3dArray* coords
|
||||
clearComputedData();
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -80,7 +77,6 @@ void RivPipeGeometryGenerator::setBendScalingFactor(double scaleFactor)
|
||||
clearComputedData();
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -103,7 +99,6 @@ void RivPipeGeometryGenerator::setCrossSectionVertexCount(size_t nodeCount)
|
||||
clearComputedData();
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -257,7 +252,6 @@ cvf::ref<cvf::DrawableGeo> RivPipeGeometryGenerator::generateLine(const cvf::Vec
|
||||
return geo;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -466,7 +460,6 @@ void RivPipeGeometryGenerator::computeExtrudedCoordsAndNormals( cvf::Vec3d inter
|
||||
*extrudedNodes = nextExtrudedNodes;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -789,9 +789,7 @@ void RivReservoirViewPartMgr::computePropertyVisibility(cvf::UByteArray* cellVis
|
||||
{
|
||||
const RimCellFilter::FilterModeType filterType = propertyFilter->filterMode();
|
||||
|
||||
RigEclipseCaseData* eclipseCase = propFilterColl->reservoirView()->eclipseCase()->reservoirData();
|
||||
|
||||
cvf::ref<RigResultAccessor> resultAccessor = RigResultAccessorFactory::createFromResultDefinition(eclipseCase, grid->gridIndex(), timeStepIndex, propertyFilter->resultDefinition);
|
||||
cvf::ref<RigResultAccessor> resultAccessor = RigResultAccessorFactory::createFromResultDefinition(grid->gridIndex(), timeStepIndex, propertyFilter->resultDefinition);
|
||||
|
||||
CVF_ASSERT(resultAccessor.notNull());
|
||||
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
#include "cafPdmFieldCvfMat4d.h"
|
||||
|
||||
#include "cvfDrawableGeo.h"
|
||||
#include "cvfLibCore.h"
|
||||
#include "cvfModelBasicList.h"
|
||||
#include "cvfPart.h"
|
||||
#include "cvfRay.h"
|
||||
@@ -61,26 +60,6 @@ RivSimWellPipesPartMgr::RivSimWellPipesPartMgr(RimEclipseView* reservoirView, Ri
|
||||
m_rimReservoirView = reservoirView;
|
||||
m_rimWell = well;
|
||||
m_needsTransformUpdate = true;
|
||||
|
||||
// Setup a scalar mapper
|
||||
cvf::ref<cvf::ScalarMapperDiscreteLinear> scalarMapper = new cvf::ScalarMapperDiscreteLinear;
|
||||
cvf::Color3ubArray legendColors;
|
||||
legendColors.resize(4);
|
||||
legendColors[0] = cvf::Color3::GRAY;
|
||||
legendColors[1] = cvf::Color3::GREEN;
|
||||
legendColors[2] = cvf::Color3::BLUE;
|
||||
legendColors[3] = cvf::Color3::RED;
|
||||
scalarMapper->setColors(legendColors);
|
||||
scalarMapper->setRange(0.0 , 4.0);
|
||||
scalarMapper->setLevelCount(4, true);
|
||||
|
||||
m_scalarMapper = scalarMapper;
|
||||
|
||||
caf::ScalarMapperEffectGenerator surfEffGen(scalarMapper.p(), caf::PO_1);
|
||||
m_scalarMapperSurfaceEffect = surfEffGen.generateCachedEffect();
|
||||
|
||||
caf::ScalarMapperMeshEffectGenerator meshEffGen(scalarMapper.p());
|
||||
m_scalarMapperMeshEffect = meshEffGen.generateCachedEffect();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -105,6 +84,39 @@ void RivSimWellPipesPartMgr::buildWellPipeParts()
|
||||
|
||||
RigSimulationWellCenterLineCalculator::calculateWellPipeCenterline(m_rimWell.p(), m_pipeBranchesCLCoords, pipeBranchesCellIds);
|
||||
|
||||
RimEclipseWellCollection* wellColl = nullptr;
|
||||
m_rimWell->firstAncestorOrThisOfType(wellColl);
|
||||
if (wellColl && wellColl->wellPipeCoordType() == RimEclipseWellCollection::WELLPIPE_CELLCENTER)
|
||||
{
|
||||
// Compute coords based on connection centers
|
||||
// Loop over all well cells, and overwrite with cell center instead of interpolated coordinates
|
||||
|
||||
RigMainGrid* mainGrid = m_rimReservoirView->mainGrid();
|
||||
|
||||
for (size_t i = 0; i < pipeBranchesCellIds.size(); i++)
|
||||
{
|
||||
const std::vector<RigWellResultPoint>& resPoints = pipeBranchesCellIds[i];
|
||||
for (size_t j = 0; j < resPoints.size(); j++)
|
||||
{
|
||||
if (resPoints[j].isCell())
|
||||
{
|
||||
size_t gridIndex = resPoints[j].m_gridIndex;
|
||||
size_t gridCellIndex = resPoints[j].m_gridCellIndex;
|
||||
|
||||
if (gridIndex < mainGrid->gridCount())
|
||||
{
|
||||
RigGridBase* rigGrid = mainGrid->gridByIndex(gridIndex);
|
||||
if (gridCellIndex < rigGrid->cellCount())
|
||||
{
|
||||
cvf::Vec3d center = rigGrid->cell(gridCellIndex).center();
|
||||
m_pipeBranchesCLCoords[i][j] = center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
double characteristicCellSize = m_rimReservoirView->mainGrid()->characteristicIJCellSize();
|
||||
double pipeRadius = m_rimReservoirView->wellCollection()->pipeRadiusScaleFactor() *m_rimWell->pipeRadiusScaleFactor() * characteristicCellSize;
|
||||
|
||||
@@ -236,6 +248,26 @@ void RivSimWellPipesPartMgr::updatePipeResultColor(size_t frameIndex)
|
||||
|
||||
std::vector<double> wellCellStates;
|
||||
|
||||
// Setup a scalar mapper
|
||||
cvf::ref<cvf::ScalarMapperDiscreteLinear> scalarMapper = new cvf::ScalarMapperDiscreteLinear;
|
||||
{
|
||||
cvf::Color3ubArray legendColors;
|
||||
legendColors.resize(4);
|
||||
legendColors[0] = cvf::Color3ub(m_rimWell->wellPipeColor());
|
||||
legendColors[1] = cvf::Color3::GREEN;
|
||||
legendColors[2] = cvf::Color3::BLUE;
|
||||
legendColors[3] = cvf::Color3::RED;
|
||||
scalarMapper->setColors(legendColors);
|
||||
scalarMapper->setRange(0.0, 4.0);
|
||||
scalarMapper->setLevelCount(4, true);
|
||||
}
|
||||
|
||||
caf::ScalarMapperEffectGenerator surfEffGen(scalarMapper.p(), caf::PO_1);
|
||||
cvf::ref<cvf::Effect> scalarMapperSurfaceEffect = surfEffGen.generateUnCachedEffect();
|
||||
|
||||
caf::ScalarMapperMeshEffectGenerator meshEffGen(scalarMapper.p());
|
||||
cvf::ref<cvf::Effect> scalarMapperMeshEffect = meshEffGen.generateUnCachedEffect();
|
||||
|
||||
for (brIt = m_wellBranches.begin(); brIt != m_wellBranches.end(); ++brIt)
|
||||
{
|
||||
// Initialize well states to "closed" state
|
||||
@@ -299,10 +331,10 @@ void RivSimWellPipesPartMgr::updatePipeResultColor(size_t frameIndex)
|
||||
surfTexCoords = new cvf::Vec2fArray;
|
||||
}
|
||||
|
||||
brIt->m_pipeGeomGenerator->pipeSurfaceTextureCoords( surfTexCoords.p(), wellCellStates, m_scalarMapper.p());
|
||||
brIt->m_pipeGeomGenerator->pipeSurfaceTextureCoords( surfTexCoords.p(), wellCellStates, scalarMapper.p());
|
||||
brIt->m_surfaceDrawable->setTextureCoordArray( surfTexCoords.p());
|
||||
|
||||
brIt->m_surfacePart->setEffect(m_scalarMapperSurfaceEffect.p());
|
||||
brIt->m_surfacePart->setEffect(scalarMapperSurfaceEffect.p());
|
||||
}
|
||||
|
||||
// Find or create texture coords array for pipe center line
|
||||
@@ -316,7 +348,7 @@ void RivSimWellPipesPartMgr::updatePipeResultColor(size_t frameIndex)
|
||||
}
|
||||
|
||||
// Calculate new texture coordinates
|
||||
brIt->m_pipeGeomGenerator->centerlineTextureCoords( lineTexCoords.p(), wellCellStates, m_scalarMapper.p());
|
||||
brIt->m_pipeGeomGenerator->centerlineTextureCoords( lineTexCoords.p(), wellCellStates, scalarMapper.p());
|
||||
|
||||
// Set the new texture coordinates
|
||||
|
||||
@@ -324,7 +356,7 @@ void RivSimWellPipesPartMgr::updatePipeResultColor(size_t frameIndex)
|
||||
|
||||
// Set effects
|
||||
|
||||
brIt->m_centerLinePart->setEffect(m_scalarMapperMeshEffect.p());
|
||||
brIt->m_centerLinePart->setEffect(scalarMapperMeshEffect.p());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ namespace cvf
|
||||
class Transform;
|
||||
class Effect;
|
||||
class DrawableGeo;
|
||||
class ScalarMapper;
|
||||
}
|
||||
|
||||
class RivPipeGeometryGenerator;
|
||||
@@ -69,7 +68,6 @@ private:
|
||||
struct RivPipeBranchData
|
||||
{
|
||||
std::vector <RigWellResultPoint> m_cellIds;
|
||||
//std::vector< std::vector<WellCellStatus> > m_cellStatusPrFrame;
|
||||
cvf::ref<RivPipeGeometryGenerator> m_pipeGeomGenerator;
|
||||
|
||||
cvf::ref<cvf::Part> m_surfacePart;
|
||||
@@ -83,9 +81,5 @@ private:
|
||||
|
||||
std::list<RivPipeBranchData> m_wellBranches;
|
||||
|
||||
cvf::ref<cvf::ScalarMapper> m_scalarMapper;
|
||||
cvf::ref<cvf::Effect> m_scalarMapperSurfaceEffect;
|
||||
cvf::ref<cvf::Effect> m_scalarMapperMeshEffect;
|
||||
|
||||
std::vector< std::vector <cvf::Vec3d> > m_pipeBranchesCLCoords;
|
||||
};
|
||||
|
||||
@@ -45,7 +45,7 @@ RivTextureCoordsCreator::RivTextureCoordsCreator(RimEclipseCellColors* cellResul
|
||||
m_quadMapper = quadMapper;
|
||||
CVF_ASSERT(quadMapper && eclipseCase );
|
||||
|
||||
m_resultAccessor = RigResultAccessorFactory::createFromResultDefinition(eclipseCase, gridIndex, timeStepIndex, cellResultColors);
|
||||
m_resultAccessor = RigResultAccessorFactory::createFromResultDefinition(gridIndex, timeStepIndex, cellResultColors);
|
||||
|
||||
cvf::ref<RigPipeInCellEvaluator> pipeInCellEval =
|
||||
new RigPipeInCellEvaluator(cellResultColors->reservoirView()->wellCollection()->resultWellGeometryVisibilities(timeStepIndex),
|
||||
|
||||
@@ -25,41 +25,30 @@
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RigActiveCellInfo.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigCell.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigSingleWellResultsData.h"
|
||||
|
||||
#include "Rim3dOverlayInfoConfig.h"
|
||||
#include "RimCellEdgeColors.h"
|
||||
#include "RimCellRangeFilterCollection.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseCellColors.h"
|
||||
#include "RimEclipsePropertyFilterCollection.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimEclipseWell.h"
|
||||
#include "RimEclipseWellCollection.h"
|
||||
#include "RimLegendConfig.h"
|
||||
#include "RimReservoirCellResultsStorage.h"
|
||||
|
||||
#include "RivPipeGeometryGenerator.h"
|
||||
#include "RivSimWellPipesPartMgr.h"
|
||||
#include "RivSimWellPipeSourceInfo.h"
|
||||
|
||||
#include "cafEffectGenerator.h"
|
||||
#include "cafPdmFieldCvfMat4d.h"
|
||||
|
||||
#include "cvfArrowGenerator.h"
|
||||
#include "cvfDrawableGeo.h"
|
||||
#include "cvfDrawableText.h"
|
||||
#include "cvfFixedAtlasFont.h"
|
||||
#include "cvfGeometryBuilderFaceList.h"
|
||||
#include "cvfLibCore.h"
|
||||
#include "cvfModelBasicList.h"
|
||||
#include "cvfPart.h"
|
||||
#include "cvfPrimitiveSetIndexedUShort.h"
|
||||
#include "cvfTransform.h"
|
||||
#include "cvfqtUtils.h"
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -77,13 +66,12 @@ RivWellHeadPartMgr::~RivWellHeadPartMgr()
|
||||
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivWellHeadPartMgr::buildWellHeadParts(size_t frameIndex)
|
||||
{
|
||||
m_wellHeadParts.clear();
|
||||
clearAllGeometry();
|
||||
|
||||
if (m_rimReservoirView.isNull()) return;
|
||||
|
||||
@@ -154,6 +142,9 @@ void RivWellHeadPartMgr::buildWellHeadParts(size_t frameIndex)
|
||||
whEndPos.z() = activeCellsBoundingBoxMax.z();
|
||||
}
|
||||
|
||||
// Upper part of simulation well pipe is defined to use branch index 0
|
||||
cvf::ref<RivSimWellPipeSourceInfo> sourceInfo = new RivSimWellPipeSourceInfo(m_rimWell, 0);
|
||||
|
||||
cvf::Vec3d arrowPosition = whEndPos;
|
||||
arrowPosition.z() += 2.0;
|
||||
|
||||
@@ -185,8 +176,9 @@ void RivWellHeadPartMgr::buildWellHeadParts(size_t frameIndex)
|
||||
cvf::ref<cvf::Effect> eff = surfaceGen.generateCachedEffect();
|
||||
|
||||
part->setEffect(eff.p());
|
||||
part->setSourceInfo(sourceInfo.p());
|
||||
|
||||
m_wellHeadParts.push_back(part.p());
|
||||
m_wellHeadPipeSurfacePart = part;
|
||||
}
|
||||
|
||||
if (centerLineDrawable.notNull())
|
||||
@@ -199,8 +191,9 @@ void RivWellHeadPartMgr::buildWellHeadParts(size_t frameIndex)
|
||||
cvf::ref<cvf::Effect> eff = meshGen.generateCachedEffect();
|
||||
|
||||
part->setEffect(eff.p());
|
||||
part->setSourceInfo(sourceInfo.p());
|
||||
|
||||
m_wellHeadParts.push_back(part.p());
|
||||
m_wellHeadPipeCenterPart = part;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,7 +274,9 @@ void RivWellHeadPartMgr::buildWellHeadParts(size_t frameIndex)
|
||||
cvf::ref<cvf::Effect> eff = surfaceGen.generateCachedEffect();
|
||||
|
||||
part->setEffect(eff.p());
|
||||
m_wellHeadParts.push_back(part.p());
|
||||
part->setSourceInfo(sourceInfo.p());
|
||||
|
||||
m_wellHeadArrowPart = part;
|
||||
}
|
||||
|
||||
if (m_rimReservoirView->wellCollection()->showWellLabel() && well->showWellLabel() && !well->name().isEmpty())
|
||||
@@ -309,29 +304,55 @@ void RivWellHeadPartMgr::buildWellHeadParts(size_t frameIndex)
|
||||
|
||||
part->setEffect(eff.p());
|
||||
part->setPriority(11);
|
||||
part->setSourceInfo(sourceInfo.p());
|
||||
|
||||
m_wellHeadParts.push_back(part.p());
|
||||
m_wellHeadLabelPart = part;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivWellHeadPartMgr::clearAllGeometry()
|
||||
{
|
||||
m_wellHeadArrowPart = nullptr;
|
||||
m_wellHeadLabelPart = nullptr;
|
||||
m_wellHeadPipeCenterPart = nullptr;
|
||||
m_wellHeadPipeSurfacePart = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivWellHeadPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model, size_t frameIndex)
|
||||
{
|
||||
if (m_rimWell.isNull()) return;
|
||||
if (m_rimReservoirView.isNull()) return;
|
||||
if (m_rimReservoirView->wellCollection()->showWellHead() == false) return;
|
||||
if (m_rimWell.isNull()) return;
|
||||
|
||||
RimEclipseWellCollection* wellCollection = nullptr;
|
||||
m_rimWell->firstAncestorOrThisOfType(wellCollection);
|
||||
if (!wellCollection) return;
|
||||
|
||||
if (!m_rimWell->isWellPipeVisible(frameIndex)) return;
|
||||
|
||||
buildWellHeadParts(frameIndex);
|
||||
|
||||
size_t i;
|
||||
for (i = 0; i < m_wellHeadParts.size(); i++)
|
||||
// Always add pipe part of well head
|
||||
if (m_wellHeadPipeCenterPart.notNull()) model->addPart(m_wellHeadPipeCenterPart.p());
|
||||
if (m_wellHeadPipeSurfacePart.notNull()) model->addPart(m_wellHeadPipeSurfacePart.p());
|
||||
|
||||
if (wellCollection->showWellLabel() &&
|
||||
m_rimWell->showWellLabel() &&
|
||||
m_wellHeadLabelPart.notNull())
|
||||
{
|
||||
model->addPart(m_wellHeadParts.at(i));
|
||||
model->addPart(m_wellHeadLabelPart.p());
|
||||
}
|
||||
|
||||
if (wellCollection->showWellHead() &&
|
||||
m_wellHeadArrowPart.notNull())
|
||||
{
|
||||
model->addPart(m_wellHeadArrowPart.p());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include "cvfAssert.h"
|
||||
#include "cvfObject.h"
|
||||
#include "cafPdmPointer.h"
|
||||
#include "cvfCollection.h"
|
||||
|
||||
namespace cvf
|
||||
{
|
||||
@@ -48,12 +47,17 @@ public:
|
||||
|
||||
private:
|
||||
void buildWellHeadParts(size_t frameIndex);
|
||||
void clearAllGeometry();
|
||||
|
||||
|
||||
private:
|
||||
caf::PdmPointer<RimEclipseView> m_rimReservoirView;
|
||||
caf::PdmPointer<RimEclipseWell> m_rimWell;
|
||||
caf::PdmPointer<RimEclipseView> m_rimReservoirView;
|
||||
caf::PdmPointer<RimEclipseWell> m_rimWell;
|
||||
|
||||
cvf::ref<cvf::Transform> m_scaleTransform;
|
||||
cvf::Collection< cvf::Part > m_wellHeadParts;
|
||||
cvf::ref<cvf::Transform> m_scaleTransform;
|
||||
|
||||
cvf::ref< cvf::Part > m_wellHeadArrowPart;
|
||||
cvf::ref< cvf::Part > m_wellHeadLabelPart;
|
||||
cvf::ref< cvf::Part > m_wellHeadPipeSurfacePart;
|
||||
cvf::ref< cvf::Part > m_wellHeadPipeCenterPart;
|
||||
};
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigSingleWellResultsData.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
|
||||
Reference in New Issue
Block a user