This commit is contained in:
Magne Sjaastad 2018-04-19 20:20:57 +02:00
parent c16c10e774
commit 7156779e3d
4 changed files with 29 additions and 29 deletions

View File

@ -54,7 +54,7 @@
///
//--------------------------------------------------------------------------------------------------
RivSimWellPipesPartMgr::RivSimWellPipesPartMgr(RimSimWellInView* well)
: m_rimWell(well)
: m_simWellInView(well)
{
}
@ -72,7 +72,7 @@ RivSimWellPipesPartMgr::~RivSimWellPipesPartMgr()
Rim3dView* RivSimWellPipesPartMgr::viewWithSettings()
{
Rim3dView* view = nullptr;
if (m_rimWell) m_rimWell->firstAncestorOrThisOfType(view);
if (m_simWellInView) m_simWellInView->firstAncestorOrThisOfType(view);
return view;
}
@ -86,7 +86,7 @@ void RivSimWellPipesPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicLi
{
if (!viewWithSettings()) return;
if (!m_rimWell->isWellPipeVisible(frameIndex)) return;
if (!m_simWellInView->isWellPipeVisible(frameIndex)) return;
buildWellPipeParts(displayXf, false, 0.0, -1, frameIndex);
@ -121,7 +121,7 @@ void RivSimWellPipesPartMgr::appendFlattenedDynamicGeometryPartsToModel(cvf::Mod
{
if (!viewWithSettings()) return;
if (!m_rimWell->isWellPipeVisible(frameIndex)) return;
if (!m_simWellInView->isWellPipeVisible(frameIndex)) return;
buildWellPipeParts(displayXf, true, flattenedIntersectionExtentLength, branchIndex, frameIndex);
@ -156,10 +156,10 @@ void RivSimWellPipesPartMgr::buildWellPipeParts(const caf::DisplayCoordTransform
m_pipeBranchesCLCoords.clear();
std::vector< std::vector <RigWellResultPoint> > pipeBranchesCellIds;
m_rimWell->calculateWellPipeStaticCenterLine(m_pipeBranchesCLCoords, pipeBranchesCellIds);
m_simWellInView->calculateWellPipeStaticCenterLine(m_pipeBranchesCLCoords, pipeBranchesCellIds);
double pipeRadius = m_rimWell->pipeRadius();
int crossSectionVertexCount = m_rimWell->pipeCrossSectionVertexCount();
double pipeRadius = m_simWellInView->pipeRadius();
int crossSectionVertexCount = m_simWellInView->pipeCrossSectionVertexCount();
// Take branch selection into account
size_t branchIdxStart = 0;
@ -181,7 +181,7 @@ void RivSimWellPipesPartMgr::buildWellPipeParts(const caf::DisplayCoordTransform
for (size_t brIdx = branchIdxStart; brIdx <branchIdxStop; ++brIdx)
{
cvf::ref<RivSimWellPipeSourceInfo> sourceInfo = new RivSimWellPipeSourceInfo(m_rimWell, brIdx);
cvf::ref<RivSimWellPipeSourceInfo> sourceInfo = new RivSimWellPipeSourceInfo(m_simWellInView, brIdx);
m_wellBranches.push_back(RivPipeBranchData());
RivPipeBranchData& pbd = m_wellBranches.back();
@ -231,7 +231,7 @@ void RivSimWellPipesPartMgr::buildWellPipeParts(const caf::DisplayCoordTransform
pbd.m_surfacePart = new cvf::Part(0,"SimWellPipeSurface");
pbd.m_surfacePart->setDrawable(pbd.m_surfaceDrawable.p());
caf::SurfaceEffectGenerator surfaceGen(cvf::Color4f(m_rimWell->wellPipeColor()), caf::PO_1);
caf::SurfaceEffectGenerator surfaceGen(cvf::Color4f(m_simWellInView->wellPipeColor()), caf::PO_1);
cvf::ref<cvf::Effect> eff = surfaceGen.generateCachedEffect();
pbd.m_surfacePart->setEffect(eff.p());
@ -244,7 +244,7 @@ void RivSimWellPipesPartMgr::buildWellPipeParts(const caf::DisplayCoordTransform
pbd.m_centerLinePart = new cvf::Part(0,"SimWellPipeCenterLine");
pbd.m_centerLinePart->setDrawable(pbd.m_centerLineDrawable.p());
caf::MeshEffectGenerator gen(m_rimWell->wellPipeColor());
caf::MeshEffectGenerator gen(m_simWellInView->wellPipeColor());
cvf::ref<cvf::Effect> eff = gen.generateCachedEffect();
pbd.m_centerLinePart->setEffect(eff.p());
@ -261,11 +261,11 @@ void RivSimWellPipesPartMgr::buildWellPipeParts(const caf::DisplayCoordTransform
pbd.m_connectionFactorsPart = nullptr;
RimEclipseView* eclipseView = nullptr;
m_rimWell->firstAncestorOrThisOfType(eclipseView);
m_simWellInView->firstAncestorOrThisOfType(eclipseView);
if (eclipseView && eclipseView->isVirtualConnectionFactorGeometryVisible())
{
RigSimWellData* simWellData = m_rimWell->simWellData();
RigSimWellData* simWellData = m_simWellInView->simWellData();
if (simWellData && simWellData->hasWellResult(frameIndex))
{
@ -275,11 +275,11 @@ void RivSimWellPipesPartMgr::buildWellPipeParts(const caf::DisplayCoordTransform
RimVirtualPerforationResults* virtualPerforationResult = eclipseView->virtualPerforationResult();
{
auto wellPaths = m_rimWell->wellPipeBranches();
auto wellPaths = m_simWellInView->wellPipeBranches();
const RigWellPath* wellPath = wellPaths[brIdx];
RigEclipseWellLogExtractor* extractor = RiaExtractionTools::findOrCreateSimWellExtractor(m_rimWell, wellPath);
RigEclipseWellLogExtractor* extractor = RiaExtractionTools::findOrCreateSimWellExtractor(m_simWellInView, wellPath);
if (extractor)
{
std::vector<WellPathCellIntersectionInfo> wellPathCellIntersections = extractor->cellIntersectionInfosAlongWellPath();
@ -331,7 +331,7 @@ void RivSimWellPipesPartMgr::buildWellPipeParts(const caf::DisplayCoordTransform
cvf::ref<cvf::Part> part = pbd.m_connectionFactorGeometryGenerator->createSurfacePart(scalarMapper, eclipseView->isLightingDisabled());
if (part.notNull())
{
cvf::ref<RivSimWellConnectionSourceInfo> sourceInfo = new RivSimWellConnectionSourceInfo(m_rimWell, pbd.m_connectionFactorGeometryGenerator.p());
cvf::ref<RivSimWellConnectionSourceInfo> sourceInfo = new RivSimWellConnectionSourceInfo(m_simWellInView, pbd.m_connectionFactorGeometryGenerator.p());
part->setSourceInfo(sourceInfo.p());
}
@ -349,9 +349,9 @@ void RivSimWellPipesPartMgr::buildWellPipeParts(const caf::DisplayCoordTransform
//--------------------------------------------------------------------------------------------------
void RivSimWellPipesPartMgr::updatePipeResultColor(size_t frameIndex)
{
if (m_rimWell == nullptr) return;
if (m_simWellInView == nullptr) return;
RigSimWellData* simWellData = m_rimWell->simWellData();
RigSimWellData* simWellData = m_simWellInView->simWellData();
if (simWellData == nullptr) return;
if (!simWellData->hasWellResult(frameIndex)) return; // Or reset colors or something
@ -370,7 +370,7 @@ void RivSimWellPipesPartMgr::updatePipeResultColor(size_t frameIndex)
{
cvf::Color3ubArray legendColors;
legendColors.resize(5);
legendColors[0] = cvf::Color3ub(m_rimWell->wellPipeColor());
legendColors[0] = cvf::Color3ub(m_simWellInView->wellPipeColor());
legendColors[1] = cvf::Color3::GREEN;
legendColors[2] = cvf::Color3::BLUE;
legendColors[3] = cvf::Color3::RED;
@ -398,9 +398,9 @@ void RivSimWellPipesPartMgr::updatePipeResultColor(size_t frameIndex)
wellCellStates.resize(wellBranch.m_cellIds.size(), defaultState);
RimSimWellInViewCollection* wellColl = nullptr;
if (m_rimWell)
if (m_simWellInView)
{
m_rimWell->firstAncestorOrThisOfType(wellColl);
m_simWellInView->firstAncestorOrThisOfType(wellColl);
}
if (wellColl && wellColl->showConnectionStatusColors())

View File

@ -74,7 +74,7 @@ private:
int branchIndex,
size_t frameIndex);
caf::PdmPointer<RimSimWellInView> m_rimWell;
caf::PdmPointer<RimSimWellInView> m_simWellInView;
struct RivPipeBranchData
{

View File

@ -50,7 +50,7 @@
//--------------------------------------------------------------------------------------------------
RivWellConnectionFactorPartMgr::RivWellConnectionFactorPartMgr(RimWellPath* well,
RimVirtualPerforationResults* virtualPerforationResult)
: m_rimWell(well)
: m_rimWellPath(well)
, m_virtualPerforationResult(virtualPerforationResult)
{
}
@ -80,11 +80,11 @@ void RivWellConnectionFactorPartMgr::appendDynamicGeometryPartsToModel(cvf::Mode
const RigVirtualPerforationTransmissibilities* trans = eclipseCase->computeAndGetVirtualPerforationTransmissibilities();
if (!trans) return;
auto conn = trans->multipleCompletionsPerEclipseCell(m_rimWell, frameIndex);
auto conn = trans->multipleCompletionsPerEclipseCell(m_rimWellPath, frameIndex);
std::vector<WellPathCellIntersectionInfo> wellPathCellIntersections;
{
RigEclipseWellLogExtractor* extractor = RiaExtractionTools::wellLogExtractorEclipseCase(m_rimWell, eclipseCase);
RigEclipseWellLogExtractor* extractor = RiaExtractionTools::wellLogExtractorEclipseCase(m_rimWellPath, eclipseCase);
if (extractor)
{
wellPathCellIntersections = extractor->cellIntersectionInfosAlongWellPath();
@ -109,11 +109,11 @@ void RivWellConnectionFactorPartMgr::appendDynamicGeometryPartsToModel(cvf::Mode
double middleMD = (startMD + endMD) / 2.0;
cvf::Vec3d defaultLocationInDomainCoord = m_rimWell->wellPathGeometry()->interpolatedPointAlongWellPath(middleMD);
cvf::Vec3d defaultLocationInDomainCoord = m_rimWellPath->wellPathGeometry()->interpolatedPointAlongWellPath(middleMD);
cvf::Vec3d p1;
cvf::Vec3d p2;
m_rimWell->wellPathGeometry()->twoClosestPoints(defaultLocationInDomainCoord, &p1, &p2);
m_rimWellPath->wellPathGeometry()->twoClosestPoints(defaultLocationInDomainCoord, &p1, &p2);
cvf::Vec3d defaultWellPathDirection = (p2 - p1).getNormalized();
@ -151,7 +151,7 @@ void RivWellConnectionFactorPartMgr::appendDynamicGeometryPartsToModel(cvf::Mode
{
double characteristicCellSize = eclView->ownerCase()->characteristicCellSize();
double radius = m_rimWell->wellPathRadius(characteristicCellSize) * m_virtualPerforationResult->geometryScaleFactor();
double radius = m_rimWellPath->wellPathRadius(characteristicCellSize) * m_virtualPerforationResult->geometryScaleFactor();
radius *= 2.0; // Enlarge the radius slightly to make the connection factor visible if geometry scale factor is set to 1.0
m_geometryGenerator = new RivWellConnectionFactorGeometryGenerator(completionVizDataItems, radius);
@ -160,7 +160,7 @@ void RivWellConnectionFactorPartMgr::appendDynamicGeometryPartsToModel(cvf::Mode
cvf::ref<cvf::Part> part = m_geometryGenerator->createSurfacePart(scalarMapper, eclView->isLightingDisabled());
if (part.notNull())
{
cvf::ref<RivWellConnectionSourceInfo> sourceInfo = new RivWellConnectionSourceInfo(m_rimWell, m_geometryGenerator.p());
cvf::ref<RivWellConnectionSourceInfo> sourceInfo = new RivWellConnectionSourceInfo(m_rimWellPath, m_geometryGenerator.p());
part->setSourceInfo(sourceInfo.p());
model->addPart(part.p());

View File

@ -46,7 +46,7 @@ public:
void appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model, size_t frameIndex);
private:
caf::PdmPointer<RimWellPath> m_rimWell;
caf::PdmPointer<RimWellPath> m_rimWellPath;
caf::PdmPointer<RimVirtualPerforationResults> m_virtualPerforationResult;
cvf::ref<RivWellConnectionFactorGeometryGenerator> m_geometryGenerator;