Skip to content

Commit

Permalink
#2481, #2605, #2486, #2568 Remove obsolete code
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobStoren committed Mar 20, 2018
1 parent a9daea0 commit 65b35cf
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 157 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -763,119 +763,6 @@ cvf::ref<cvf::Part> 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<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());
}
}
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
42 changes: 0 additions & 42 deletions ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
1 change: 0 additions & 1 deletion ApplicationCode/ProjectDataModel/Rim2dIntersectionView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 65b35cf

Please sign in to comment.