mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
parent
a9daea0938
commit
65b35cff92
@ -763,119 +763,6 @@ cvf::ref<cvf::Part> createStdLinePart(cvf::DrawableGeo* geometry,
|
|||||||
return part;
|
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<std::vector<cvf::Vec3d> > 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<cvf::Object> 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<cvf::Vec3dArray> 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());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -73,7 +73,6 @@ public:
|
|||||||
void appendNativeCrossSectionFacesToModel(cvf::ModelBasicList* model, cvf::Transform* scaleTransform);
|
void appendNativeCrossSectionFacesToModel(cvf::ModelBasicList* model, cvf::Transform* scaleTransform);
|
||||||
void appendMeshLinePartsToModel(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 appendPolylinePartsToModel(Rim3dView& view, cvf::ModelBasicList* model, cvf::Transform* scaleTransform);
|
||||||
void appendWellPipePartsToModel(cvf::ModelBasicList* model, cvf::Transform* scaleTransform);
|
|
||||||
|
|
||||||
const RimIntersection* intersection() const;
|
const RimIntersection* intersection() const;
|
||||||
|
|
||||||
|
@ -313,48 +313,6 @@ void RivWellPathPartMgr::buildWellPathParts(const caf::DisplayCoordTransform* di
|
|||||||
clippedWellPathCenterLine = RigWellPath::clipPolylineStartAboveZ(wellpathCenterLine,
|
clippedWellPathCenterLine = RigWellPath::clipPolylineStartAboveZ(wellpathCenterLine,
|
||||||
maxZClipHeight,
|
maxZClipHeight,
|
||||||
&horizontalLengthAlongWellToClipPoint);
|
&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
|
else
|
||||||
{
|
{
|
||||||
|
@ -411,7 +411,6 @@ void Rim2dIntersectionView::createDisplayModel()
|
|||||||
m_flatIntersectionPartMgr->appendNativeCrossSectionFacesToModel(m_intersectionVizModel.p(), scaleTransform());
|
m_flatIntersectionPartMgr->appendNativeCrossSectionFacesToModel(m_intersectionVizModel.p(), scaleTransform());
|
||||||
m_flatIntersectionPartMgr->appendMeshLinePartsToModel(m_intersectionVizModel.p(), scaleTransform());
|
m_flatIntersectionPartMgr->appendMeshLinePartsToModel(m_intersectionVizModel.p(), scaleTransform());
|
||||||
m_flatIntersectionPartMgr->appendPolylinePartsToModel(*this, m_intersectionVizModel.p(), scaleTransform());
|
m_flatIntersectionPartMgr->appendPolylinePartsToModel(*this, m_intersectionVizModel.p(), scaleTransform());
|
||||||
m_flatIntersectionPartMgr->appendWellPipePartsToModel(m_intersectionVizModel.p(), scaleTransform());
|
|
||||||
|
|
||||||
m_flatIntersectionPartMgr->applySingleColorEffect();
|
m_flatIntersectionPartMgr->applySingleColorEffect();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user