#2663 Code adjustment to avoid creating a geometry generator when not needed

This commit is contained in:
Jacob Støren
2018-04-23 10:30:40 +02:00
parent f507a35c8f
commit 851e68ac31

View File

@@ -305,14 +305,6 @@ void RivWellPathPartMgr::buildWellPathParts(const caf::DisplayCoordTransform* di
double wellPathRadius = this->wellPathRadius(characteristicCellSize, wellPathCollection);
// Generate the well path geometry as a line and pipe structure
m_pipeGeomGenerator = new RivPipeGeometryGenerator;
m_pipeGeomGenerator->setRadius(wellPathRadius);
m_pipeGeomGenerator->setCrossSectionVertexCount(wellPathCollection->wellPathCrossSectionVertexCount());
std::vector<cvf::Vec3d> clippedWellPathCenterLine;
// Skip visualization if outside the domain of this case
@@ -337,6 +329,13 @@ void RivWellPathPartMgr::buildWellPathParts(const caf::DisplayCoordTransform* di
}
}
// Generate the well path geometry as a line and pipe structure
m_pipeGeomGenerator = new RivPipeGeometryGenerator;
m_pipeGeomGenerator->setRadius(wellPathRadius);
m_pipeGeomGenerator->setCrossSectionVertexCount(wellPathCollection->wellPathCrossSectionVertexCount());
double horizontalLengthAlongWellToClipPoint = 0.0;
size_t idxToFirstVisibleSegment = 0;
if ( wellPathCollection->wellPathClip )