#2457 Make 2d intersection view length start at well start

This commit is contained in:
Jacob Støren
2018-02-13 16:56:48 +01:00
parent 3b627ce1c4
commit cb38d435cd
5 changed files with 44 additions and 11 deletions

View File

@@ -45,12 +45,14 @@ RivIntersectionGeometryGenerator::RivIntersectionGeometryGenerator( RimIntersect
std::vector<std::vector<cvf::Vec3d> > &polylines,
const cvf::Vec3d& extrusionDirection,
const RivIntersectionHexGridInterface* grid,
bool isFlattened)
bool isFlattened,
double horizontalLengthAlongWellToPolylineStart)
: m_crossSection(crossSection),
m_polyLines(polylines),
m_extrusionDirection(extrusionDirection),
m_hexGrid(grid),
m_isFlattened(isFlattened)
m_isFlattened(isFlattened),
m_horizontalLengthAlongWellToPolylineStart(horizontalLengthAlongWellToPolylineStart)
{
m_triangleVxes = new cvf::Vec3fArray;
m_cellBorderLineVxes = new cvf::Vec3fArray;
@@ -109,7 +111,7 @@ void RivIntersectionGeometryGenerator::calculateSegementTransformPrLinePoint()
m_segementTransformPrLinePoint.clear();
double previousSectionFlattenedEndPosX = 0.0;
double previousSectionFlattenedEndPosX = m_horizontalLengthAlongWellToPolylineStart;
cvf::Vec3d previousSectionOrigo(cvf::Vec3d::ZERO);

View File

@@ -50,7 +50,8 @@ public:
std::vector<std::vector<cvf::Vec3d> > &polylines,
const cvf::Vec3d& extrusionDirection,
const RivIntersectionHexGridInterface* grid,
bool isFlattened );
bool isFlattened,
double horizontalLengthAlongWellToPolylineStart);
~RivIntersectionGeometryGenerator();
@@ -88,6 +89,7 @@ private:
const std::vector<std::vector<cvf::Vec3d> > m_polyLines;
cvf::Vec3d m_extrusionDirection;
bool m_isFlattened;
double m_horizontalLengthAlongWellToPolylineStart;
// Output arrays
cvf::ref<cvf::Vec3fArray> m_triangleVxes;

View File

@@ -81,13 +81,20 @@ RivIntersectionPartMgr::RivIntersectionPartMgr(RimIntersection* rimCrossSection,
CVF_ASSERT(m_rimCrossSection);
m_crossSectionFacesTextureCoords = new cvf::Vec2fArray;
double horizontalLengthAlongWellToPolylineStart;
std::vector< std::vector <cvf::Vec3d> > polyLines = m_rimCrossSection->polyLines();
std::vector< std::vector <cvf::Vec3d> > polyLines = m_rimCrossSection->polyLines(&horizontalLengthAlongWellToPolylineStart);
if (polyLines.size() > 0)
{
cvf::Vec3d direction = m_rimCrossSection->extrusionDirection();
cvf::ref<RivIntersectionHexGridInterface> hexGrid = createHexGridInterface();
m_crossSectionGenerator = new RivIntersectionGeometryGenerator(m_rimCrossSection, polyLines, direction, hexGrid.p(), m_isFlattened);
m_crossSectionGenerator = new RivIntersectionGeometryGenerator(m_rimCrossSection,
polyLines,
direction,
hexGrid.p(),
m_isFlattened,
horizontalLengthAlongWellToPolylineStart);
}
}