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

View File

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

View File

@ -50,7 +50,7 @@
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RivWellConnectionFactorPartMgr::RivWellConnectionFactorPartMgr(RimWellPath* well, RivWellConnectionFactorPartMgr::RivWellConnectionFactorPartMgr(RimWellPath* well,
RimVirtualPerforationResults* virtualPerforationResult) RimVirtualPerforationResults* virtualPerforationResult)
: m_rimWell(well) : m_rimWellPath(well)
, m_virtualPerforationResult(virtualPerforationResult) , m_virtualPerforationResult(virtualPerforationResult)
{ {
} }
@ -80,11 +80,11 @@ void RivWellConnectionFactorPartMgr::appendDynamicGeometryPartsToModel(cvf::Mode
const RigVirtualPerforationTransmissibilities* trans = eclipseCase->computeAndGetVirtualPerforationTransmissibilities(); const RigVirtualPerforationTransmissibilities* trans = eclipseCase->computeAndGetVirtualPerforationTransmissibilities();
if (!trans) return; if (!trans) return;
auto conn = trans->multipleCompletionsPerEclipseCell(m_rimWell, frameIndex); auto conn = trans->multipleCompletionsPerEclipseCell(m_rimWellPath, frameIndex);
std::vector<WellPathCellIntersectionInfo> wellPathCellIntersections; std::vector<WellPathCellIntersectionInfo> wellPathCellIntersections;
{ {
RigEclipseWellLogExtractor* extractor = RiaExtractionTools::wellLogExtractorEclipseCase(m_rimWell, eclipseCase); RigEclipseWellLogExtractor* extractor = RiaExtractionTools::wellLogExtractorEclipseCase(m_rimWellPath, eclipseCase);
if (extractor) if (extractor)
{ {
wellPathCellIntersections = extractor->cellIntersectionInfosAlongWellPath(); wellPathCellIntersections = extractor->cellIntersectionInfosAlongWellPath();
@ -109,11 +109,11 @@ void RivWellConnectionFactorPartMgr::appendDynamicGeometryPartsToModel(cvf::Mode
double middleMD = (startMD + endMD) / 2.0; 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 p1;
cvf::Vec3d p2; cvf::Vec3d p2;
m_rimWell->wellPathGeometry()->twoClosestPoints(defaultLocationInDomainCoord, &p1, &p2); m_rimWellPath->wellPathGeometry()->twoClosestPoints(defaultLocationInDomainCoord, &p1, &p2);
cvf::Vec3d defaultWellPathDirection = (p2 - p1).getNormalized(); cvf::Vec3d defaultWellPathDirection = (p2 - p1).getNormalized();
@ -151,7 +151,7 @@ void RivWellConnectionFactorPartMgr::appendDynamicGeometryPartsToModel(cvf::Mode
{ {
double characteristicCellSize = eclView->ownerCase()->characteristicCellSize(); 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 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); 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()); cvf::ref<cvf::Part> part = m_geometryGenerator->createSurfacePart(scalarMapper, eclView->isLightingDisabled());
if (part.notNull()) 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()); part->setSourceInfo(sourceInfo.p());
model->addPart(part.p()); model->addPart(part.p());

View File

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