mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1724 Apply fix on dev branch
This commit is contained in:
@@ -38,7 +38,7 @@ RivPipeGeometryGenerator::RivPipeGeometryGenerator()
|
||||
m_crossSectionNodeCount = 8;
|
||||
m_minimumBendAngle = 80.0;
|
||||
m_bendScalingFactor = 0.00001;
|
||||
m_firstSegmentIndex = 0;
|
||||
m_firstVisibleSegmentIndex = 0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -592,17 +592,20 @@ void RivPipeGeometryGenerator::clearComputedData()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RivPipeGeometryGenerator::segmentIndexFromTriangleIndex(size_t triangleIndex) const
|
||||
{
|
||||
size_t filteredIndex = triangleIndex / (m_crossSectionNodeCount * 2);
|
||||
size_t segIndex = triangleIndex / (m_crossSectionNodeCount * 2);
|
||||
|
||||
return filteredIndex + m_firstSegmentIndex;
|
||||
CVF_ASSERT(segIndex < m_filteredPipeSegmentToResult.size());
|
||||
size_t resultIndex = m_filteredPipeSegmentToResult[segIndex];
|
||||
|
||||
return resultIndex + m_firstVisibleSegmentIndex;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Well pipes are clipped, set index to first segment in visible well path
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivPipeGeometryGenerator::setFirstSegmentIndex(size_t segmentIndex)
|
||||
void RivPipeGeometryGenerator::setFirstVisibleSegmentIndex(size_t segmentIndex)
|
||||
{
|
||||
m_firstSegmentIndex = segmentIndex;
|
||||
m_firstVisibleSegmentIndex = segmentIndex;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
void pipeSurfaceTextureCoords(cvf::Vec2fArray* textureCoords, const std::vector<double>& segmentResults, const cvf::ScalarMapper* mapper) const;
|
||||
void centerlineTextureCoords(cvf::Vec2fArray* textureCoords, const std::vector<double>& segmentResults, const cvf::ScalarMapper* mapper) const;
|
||||
|
||||
void setFirstSegmentIndex(size_t segmentIndex);
|
||||
void setFirstVisibleSegmentIndex(size_t segmentIndex);
|
||||
size_t segmentIndexFromTriangleIndex(size_t triangleIndex) const;
|
||||
|
||||
void cylinderWithCenterLineParts(cvf::Collection<cvf::Part>* destinationParts, const std::vector<cvf::Vec3d>& centerCoords, const cvf::Color3f& color, double radius);
|
||||
@@ -91,7 +91,7 @@ private:
|
||||
// Map from generated cylinder segments to pipe result indices
|
||||
std::vector<size_t> m_filteredPipeSegmentToResult;
|
||||
|
||||
size_t m_firstSegmentIndex;
|
||||
size_t m_firstVisibleSegmentIndex;
|
||||
|
||||
double m_radius;
|
||||
double m_minimumBendAngle;
|
||||
|
||||
@@ -255,7 +255,7 @@ void RivWellPathPartMgr::buildWellPathParts(const caf::DisplayCoordTransform* di
|
||||
clippedPoints.push_back(wellPathGeometry->m_wellPathPoints[idx]);
|
||||
}
|
||||
|
||||
pbd.m_pipeGeomGenerator->setFirstSegmentIndex(firstVisibleSegmentIndex);
|
||||
pbd.m_pipeGeomGenerator->setFirstVisibleSegmentIndex(firstVisibleSegmentIndex);
|
||||
}
|
||||
|
||||
if (clippedPoints.size() < 2) return;
|
||||
|
||||
Reference in New Issue
Block a user