(#633) Cross sections on simulation wells

This commit is contained in:
Jacob Støren
2015-11-26 11:08:38 +01:00
parent faf35d32c6
commit 3e78eebee3
5 changed files with 117 additions and 111 deletions

View File

@@ -29,10 +29,10 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RivCrossSectionGeometryGenerator::RivCrossSectionGeometryGenerator(const std::vector<cvf::Vec3d> &polyline,
RivCrossSectionGeometryGenerator::RivCrossSectionGeometryGenerator(const std::vector<std::vector<cvf::Vec3d> > &polylines,
const cvf::Vec3d& extrusionDirection,
const RivCrossSectionHexGridIntf* grid)
: m_polyLine(polyline),
: m_polyLines(polylines),
m_extrusionDirection(extrusionDirection),
m_hexGrid(grid)
{
@@ -968,16 +968,17 @@ void RivCrossSectionGeometryGenerator::calculateArrays()
if (m_triangleVxes->size()) return;
m_extrusionDirection.normalize();
std::vector<cvf::Vec3d> m_adjustedPolyline;
adjustPolyline(m_polyLine, m_extrusionDirection, &m_adjustedPolyline);
std::vector<cvf::Vec3f> triangleVertices;
std::vector<cvf::Vec3f> cellBorderLineVxes;
cvf::Vec3d displayOffset = m_hexGrid->displayOffset();
cvf::BoundingBox gridBBox = m_hexGrid->boundingBox();
for (size_t pLineIdx = 0; pLineIdx < m_polyLines.size(); ++pLineIdx)
{
const std::vector<cvf::Vec3d>& m_polyLine = m_polyLines[pLineIdx];
std::vector<cvf::Vec3d> m_adjustedPolyline;
adjustPolyline(m_polyLine, m_extrusionDirection, &m_adjustedPolyline);
size_t lineCount = m_adjustedPolyline.size();
for (size_t lIdx = 0; lIdx < lineCount - 1; ++lIdx)
{
@@ -1097,7 +1098,7 @@ void RivCrossSectionGeometryGenerator::calculateArrays()
}
}
}
}
m_triangleVxes->assign(triangleVertices);
m_cellBorderLineVxes->assign(cellBorderLineVxes);
}

View File

@@ -124,7 +124,7 @@ private:
class RivCrossSectionGeometryGenerator : public cvf::Object
{
public:
RivCrossSectionGeometryGenerator(const std::vector<cvf::Vec3d> &polyline,
RivCrossSectionGeometryGenerator(const std::vector<std::vector<cvf::Vec3d> > &polylines,
const cvf::Vec3d& extrusionDirection,
const RivCrossSectionHexGridIntf* grid );
@@ -145,7 +145,7 @@ private:
std::vector<cvf::Vec3d>* adjustedPolyline);
cvf::cref<RivCrossSectionHexGridIntf> m_hexGrid;
std::vector<cvf::Vec3d> m_polyLine;
const std::vector<std::vector<cvf::Vec3d> > m_polyLines;
cvf::Vec3d m_extrusionDirection;
// Output arrays

View File

@@ -412,12 +412,12 @@ void RivCrossSectionPartMgr::appendMeshLinePartsToModel(cvf::ModelBasicList* mod
//--------------------------------------------------------------------------------------------------
void RivCrossSectionPartMgr::computeData()
{
std::vector< std::vector <cvf::Vec3d> > polyLine = m_rimCrossSection->polyLines();
if (polyLine.size() > 0)
std::vector< std::vector <cvf::Vec3d> > polyLines = m_rimCrossSection->polyLines();
if (polyLines.size() > 0)
{
cvf::Vec3d direction = extrusionDirection(polyLine[0]);
cvf::Vec3d direction = extrusionDirection(polyLines[0]);
cvf::ref<RivCrossSectionHexGridIntf> hexGrid = createHexGridInterface();
m_crossSectionGenerator = new RivCrossSectionGeometryGenerator(polyLine[0], direction, hexGrid.p());
m_crossSectionGenerator = new RivCrossSectionGeometryGenerator(polyLines, direction, hexGrid.p());
}
}

View File

@@ -29,6 +29,7 @@
#include "RimWellPath.h"
#include "RivCrossSectionPartMgr.h"
#include "RigSimulationWellCenterLineCalculator.h"
namespace caf {
@@ -37,7 +38,7 @@ template<>
void caf::AppEnum< RimCrossSection::CrossSectionEnum >::setUp()
{
addItem(RimCrossSection::CS_WELL_PATH, "CS_WELL_PATH", "Well Path");
// addItem(RimCrossSection::CS_SIMULATION_WELL, "CS_SIMULATION_WELL", "Simulation Well");
addItem(RimCrossSection::CS_SIMULATION_WELL, "CS_SIMULATION_WELL", "Simulation Well");
// addItem(RimCrossSection::CS_USER_DEFINED, "CS_USER_DEFINED", "User defined");
setDefault(RimCrossSection::CS_WELL_PATH);
}
@@ -111,7 +112,7 @@ void RimCrossSection::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
}
else if (type == CS_SIMULATION_WELL)
{
//uiOrdering.add(&simulationWell);
uiOrdering.add(&simulationWell);
}
else
{
@@ -211,14 +212,18 @@ std::vector< std::vector <cvf::Vec3d> > RimCrossSection::polyLines() const
std::vector< std::vector <cvf::Vec3d> > lines;
if (type == CS_WELL_PATH)
{
if (wellPath)
if (wellPath())
{
lines.push_back(wellPath->wellPathGeometry()->m_wellPathPoints);
}
}
else if (type == CS_SIMULATION_WELL)
{
if (simulationWell())
{
std::vector< std::vector <RigWellResultPoint> > pipeBranchesCellIds;
RigSimulationWellCenterLineCalculator::calculateWellPipeCenterline(simulationWell(), lines, pipeBranchesCellIds);
}
}
else
{
@@ -231,8 +236,10 @@ std::vector< std::vector <cvf::Vec3d> > RimCrossSection::polyLines() const
{
cvf::Vec3d startToEnd = (lines[lIdx].back() - lines[lIdx].front());
startToEnd[2] = 0.0;
cvf::Vec3d newStart = lines[lIdx].front() - startToEnd * 0.1;
cvf::Vec3d newEnd = lines[lIdx].back() + startToEnd * 0.1;
lines[lIdx].insert(lines[lIdx].begin(), newStart);
lines[lIdx].push_back(newEnd);
}

View File

@@ -240,8 +240,6 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
}
}
// TODO: Include when cross section from simulation wells are ready
/*
const RivEclipseWellSourceInfo* eclipseWellSourceInfo = dynamic_cast<const RivEclipseWellSourceInfo*>(firstHitPart->sourceInfo());
if (eclipseWellSourceInfo)
{
@@ -253,7 +251,7 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
commandIds << "RicNewSimWellCrossSectionFeature";
}
}
*/
}
// View Link commands