(#404) Compute well segment index from triangle index

This commit is contained in:
Magne Sjaastad
2015-12-04 12:05:06 +01:00
parent 6d60088a5b
commit 622e49fe69
4 changed files with 58 additions and 9 deletions

View File

@@ -1,6 +1,8 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
// Copyright (C) Statoil ASA
// Copyright (C) Ceetron Solutions AS
// Copyright (C) 2011-2012 Ceetron AS
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -35,6 +37,7 @@ RivPipeGeometryGenerator::RivPipeGeometryGenerator()
m_crossSectionNodeCount = 8;
m_minimumBendAngle = 80.0;
m_bendScalingFactor = 0.00001;
m_firstSegmentIndex = 0;
}
//--------------------------------------------------------------------------------------------------
@@ -582,3 +585,21 @@ void RivPipeGeometryGenerator::clearComputedData()
m_filteredPipeSegmentToResult.clear();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RivPipeGeometryGenerator::segmentIndexFromTriangleIndex(size_t triangleIndex) const
{
size_t filteredIndex = triangleIndex / (m_crossSectionNodeCount * 2);
return filteredIndex + m_firstSegmentIndex;
}
//--------------------------------------------------------------------------------------------------
/// Well pipes are clipped, set index to first segment in visible well path
//--------------------------------------------------------------------------------------------------
void RivPipeGeometryGenerator::setFirstSegmentIndex(size_t segmentIndex)
{
m_firstSegmentIndex = segmentIndex;
}