#2552 Small refactorings

This commit is contained in:
Jacob Støren 2018-03-12 14:08:45 +01:00
parent e314450e2e
commit 1fa898b798
3 changed files with 14 additions and 8 deletions

View File

@ -26,7 +26,9 @@
/// ///
/// Returns size_t(-1) if no point is found /// Returns size_t(-1) if no point is found
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
size_t RivSectionFlattner::indexToNextValidPoint(const std::vector<cvf::Vec3d>& polyLine, const cvf::Vec3d extrDir, size_t idxToStartOfLineSegment) size_t RivSectionFlattner::indexToNextValidPoint(const std::vector<cvf::Vec3d>& polyLine,
const cvf::Vec3d extrDir,
size_t idxToStartOfLineSegment)
{ {
size_t lineCount = polyLine.size(); size_t lineCount = polyLine.size();
if ( !(idxToStartOfLineSegment + 1 < lineCount) ) return -1; if ( !(idxToStartOfLineSegment + 1 < lineCount) ) return -1;
@ -51,7 +53,10 @@ size_t RivSectionFlattner::indexToNextValidPoint(const std::vector<cvf::Vec3d>&
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// Returns one CS pr point, valid for the next segment /// Returns one CS pr point, valid for the next segment
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::vector<cvf::Mat4d> RivSectionFlattner::calculateFlatteningCSsForPolyline(const std::vector<cvf::Vec3d> & polyLine, const cvf::Vec3d& extrusionDir, const cvf::Vec3d& startOffset, cvf::Vec3d* endOffset) std::vector<cvf::Mat4d> RivSectionFlattner::calculateFlatteningCSsForPolyline(const std::vector<cvf::Vec3d> & polyLine,
const cvf::Vec3d& extrusionDir,
const cvf::Vec3d& startOffset,
cvf::Vec3d* endOffset)
{ {
CVF_ASSERT(endOffset); CVF_ASSERT(endOffset);
size_t pointCount = polyLine.size(); size_t pointCount = polyLine.size();

View File

@ -103,6 +103,7 @@ void RivWellHeadPartMgr::buildWellHeadParts(size_t frameIndex)
const RigWellResultFrame& wellResultFrame = well->simWellData()->wellResultFrame(frameIndex); const RigWellResultFrame& wellResultFrame = well->simWellData()->wellResultFrame(frameIndex);
double pipeRadius = m_rimWell->pipeRadius(); double pipeRadius = m_rimWell->pipeRadius();
int pipeCrossSectionVxCount = m_rimWell->pipeCrossSectionVertexCount();
if (wellResultFrame.m_isOpen) if (wellResultFrame.m_isOpen)
{ {
@ -125,7 +126,7 @@ void RivWellHeadPartMgr::buildWellHeadParts(size_t frameIndex)
cvf::ref<RivPipeGeometryGenerator> pipeGeomGenerator = new RivPipeGeometryGenerator; cvf::ref<RivPipeGeometryGenerator> pipeGeomGenerator = new RivPipeGeometryGenerator;
pipeGeomGenerator->setPipeCenterCoords(wellHeadPipeCoords.p()); pipeGeomGenerator->setPipeCenterCoords(wellHeadPipeCoords.p());
pipeGeomGenerator->setCrossSectionVertexCount(m_rimReservoirView->wellCollection()->pipeCrossSectionVertexCount()); pipeGeomGenerator->setCrossSectionVertexCount(pipeCrossSectionVxCount);
pipeGeomGenerator->setRadius(pipeRadius); pipeGeomGenerator->setRadius(pipeRadius);
@ -207,7 +208,7 @@ void RivWellHeadPartMgr::buildWellHeadParts(size_t frameIndex)
gen.setShaftRelativeRadius(0.5f); gen.setShaftRelativeRadius(0.5f);
gen.setHeadRelativeRadius(1.0f); gen.setHeadRelativeRadius(1.0f);
gen.setHeadRelativeLength(0.4f); gen.setHeadRelativeLength(0.4f);
gen.setNumSlices(m_rimReservoirView->wellCollection()->pipeCrossSectionVertexCount()); gen.setNumSlices(pipeCrossSectionVxCount);
gen.generate(&builder); gen.generate(&builder);
cvf::ref<cvf::Vec3fArray> vertices = builder.vertices(); cvf::ref<cvf::Vec3fArray> vertices = builder.vertices();