diff --git a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.cpp b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.cpp index 136fcfea10..5f4099e843 100644 --- a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.cpp @@ -763,119 +763,6 @@ cvf::ref createStdLinePart(cvf::DrawableGeo* geometry, return part; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RivIntersectionPartMgr::appendWellPipePartsToModel(cvf::ModelBasicList* model, cvf::Transform* scaleTransform) -{ - if (m_rimCrossSection.isNull() || m_crossSectionGenerator.isNull()) return; - - // Get information on how to draw the pipe - - std::function< cvf::ref< cvf::Object > ( size_t ) > createSourceInfoFunc; - double pipeRadius = 1; - int pipeCrossSectionVxCount = 6; - cvf::Color3f wellPipeColor = cvf::Color3f::GRAY; - double characteristicCellSize = 0; - - if ( false)//m_rimCrossSection->type() == RimIntersection::CS_SIMULATION_WELL ) - { - RimSimWellInView * simWellInView = m_rimCrossSection->simulationWell(); - - if (!simWellInView) return; - - RimEclipseView* eclView = nullptr; - simWellInView->firstAncestorOrThisOfTypeAsserted(eclView); - - pipeRadius = simWellInView->pipeRadius(); - pipeCrossSectionVxCount = eclView->wellCollection()->pipeCrossSectionVertexCount(); - wellPipeColor = simWellInView->wellPipeColor(); - - createSourceInfoFunc = [&](size_t brIdx) { return new RivSimWellPipeSourceInfo(simWellInView, brIdx); }; - characteristicCellSize = eclView->eclipseCase()->characteristicCellSize(); - } - else if (false)//m_rimCrossSection->type() == RimIntersection::CS_WELL_PATH) - { - RimWellPath* wellPath = m_rimCrossSection->wellPath(); - - if (!wellPath) return; - - RimGridView* gridView = nullptr; - m_rimCrossSection->firstAncestorOrThisOfTypeAsserted(gridView); - double cellSize = gridView->ownerCase()->characteristicCellSize(); - - RimWellPathCollection* wellPathColl = nullptr; - wellPath->firstAncestorOrThisOfTypeAsserted(wellPathColl); - - pipeRadius = wellPath->wellPathRadius(cellSize); - pipeCrossSectionVxCount = wellPathColl->wellPathCrossSectionVertexCount(); - wellPipeColor = wellPath->wellPathColor(); - - createSourceInfoFunc = [&](size_t brIdx) { return new RivObjectSourceInfo(wellPath); }; //Temporary fix to avoid crash - } - - // Create pipe geometry - - if ( false //m_rimCrossSection->type() == RimIntersection::CS_SIMULATION_WELL - //|| - //m_rimCrossSection->type() == RimIntersection::CS_WELL_PATH - ) - { - std::vector > polyLines = m_crossSectionGenerator->flattenedOrOffsettedPolyLines(); - - // Remove intersectino extents from the polyline - for (auto & polyLine: polyLines) - { - if ( polyLine.size() > 2 ) - { - polyLine.pop_back(); - polyLine.erase(polyLine.begin()); - } - } - - m_wellBranches.clear(); - - for ( size_t brIdx = 0; brIdx < polyLines.size(); ++brIdx ) - { - cvf::ref sourceInfo = createSourceInfoFunc(brIdx); - - m_wellBranches.emplace_back(); - RivPipeBranchData& pbd = m_wellBranches.back(); - - pbd.m_pipeGeomGenerator = new RivPipeGeometryGenerator; - pbd.m_pipeGeomGenerator->setRadius(pipeRadius); - pbd.m_pipeGeomGenerator->setCrossSectionVertexCount(pipeCrossSectionVxCount); - - cvf::ref cvfCoords = new cvf::Vec3dArray; - cvfCoords->assign(polyLines[brIdx]); - - // Scale the centerline coordinates using the Z-scale transform of the grid. - - for ( size_t cIdx = 0; cIdx < cvfCoords->size(); ++cIdx ) - { - (*cvfCoords)[cIdx].transformPoint(scaleTransform->worldTransform()); - } - - (*cvfCoords)[0].z() += characteristicCellSize; - - pbd.m_pipeGeomGenerator->setPipeCenterCoords(cvfCoords.p()); - auto surfaceDrawable = pbd.m_pipeGeomGenerator->createPipeSurface(); - auto centerLineDrawable = pbd.m_pipeGeomGenerator->createCenterLine(); - - pbd.m_surfacePart = createStdSurfacePart(surfaceDrawable.p(), - wellPipeColor, - "FlattenedSimWellPipe", - sourceInfo.p()); - - pbd.m_centerLinePart = createStdLinePart(centerLineDrawable.p(), - wellPipeColor, - "FlattenedSimWellPipeCenterLine"); - model->addPart(pbd.m_surfacePart.p()); - model->addPart(pbd.m_centerLinePart.p()); - } - } -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.h b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.h index 1bdd72cd3d..6537664c13 100644 --- a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.h +++ b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.h @@ -73,7 +73,6 @@ class RivIntersectionPartMgr : public cvf::Object void appendNativeCrossSectionFacesToModel(cvf::ModelBasicList* model, cvf::Transform* scaleTransform); void appendMeshLinePartsToModel(cvf::ModelBasicList* model, cvf::Transform* scaleTransform); void appendPolylinePartsToModel(Rim3dView& view, cvf::ModelBasicList* model, cvf::Transform* scaleTransform); - void appendWellPipePartsToModel(cvf::ModelBasicList* model, cvf::Transform* scaleTransform); const RimIntersection* intersection() const; diff --git a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp index 6af5fa373e..458f374d78 100644 --- a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp @@ -313,48 +313,6 @@ void RivWellPathPartMgr::buildWellPathParts(const caf::DisplayCoordTransform* di clippedWellPathCenterLine = RigWellPath::clipPolylineStartAboveZ(wellpathCenterLine, maxZClipHeight, &horizontalLengthAlongWellToClipPoint); - - #if 0 - size_t firstVisibleSegmentIndex = cvf::UNDEFINED_SIZE_T; - for ( size_t idx = 0; idx < wellPathGeometry->m_wellPathPoints.size(); idx++ ) - { - cvf::Vec3d point = wellPathGeometry->m_wellPathPoints[idx]; - if ( point.z() < (wellPathClipBoundingBox.max().z() + wellPathCollection->wellPathClipZDistance) ) - { - firstVisibleSegmentIndex = idx; - break; - } - } - - - - if ( firstVisibleSegmentIndex != cvf::UNDEFINED_SIZE_T ) - { - if ( firstVisibleSegmentIndex > 0 ) - { - double wellPathStartPoint = wellPathClipBoundingBox.max().z() + wellPathCollection->wellPathClipZDistance; - double stepsize = (wellPathStartPoint - wellPathGeometry->m_wellPathPoints[firstVisibleSegmentIndex - 1].z()) / - (wellPathGeometry->m_wellPathPoints[firstVisibleSegmentIndex].z() - wellPathGeometry->m_wellPathPoints[firstVisibleSegmentIndex - 1].z()); - - cvf::Vec3d newPoint = wellPathGeometry->m_wellPathPoints[firstVisibleSegmentIndex - 1] + - stepsize * (wellPathGeometry->m_wellPathPoints[firstVisibleSegmentIndex] - wellPathGeometry->m_wellPathPoints[firstVisibleSegmentIndex - 1]); - - clippedPoints.push_back(newPoint); - m_pipeGeomGenerator->setFirstVisibleSegmentIndex(firstVisibleSegmentIndex - 1); - } - else - { - m_pipeGeomGenerator->setFirstVisibleSegmentIndex(firstVisibleSegmentIndex); - } - - for ( size_t idx = firstVisibleSegmentIndex; idx < wellPathGeometry->m_wellPathPoints.size(); idx++ ) - { - clippedPoints.push_back(wellPathGeometry->m_wellPathPoints[idx]); - } - - } - #endif - } else { diff --git a/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.cpp b/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.cpp index d04f930ee9..5903219d02 100644 --- a/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.cpp +++ b/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.cpp @@ -411,7 +411,6 @@ void Rim2dIntersectionView::createDisplayModel() m_flatIntersectionPartMgr->appendNativeCrossSectionFacesToModel(m_intersectionVizModel.p(), scaleTransform()); m_flatIntersectionPartMgr->appendMeshLinePartsToModel(m_intersectionVizModel.p(), scaleTransform()); m_flatIntersectionPartMgr->appendPolylinePartsToModel(*this, m_intersectionVizModel.p(), scaleTransform()); - m_flatIntersectionPartMgr->appendWellPipePartsToModel(m_intersectionVizModel.p(), scaleTransform()); m_flatIntersectionPartMgr->applySingleColorEffect();