#3943 Stop regenerating map geometry when altering other geometry.

* Do this by caching results and clearing the cache in three stages with each dependent on the previous stages:
  1. Grid Mapping
  2. Results
  3. Geometry
* Clearing grid mapping clears results and clearing results clears geometry.
* Some operations require only geometry changes, while others require a full change to grid mapping and consequently everything else.
This commit is contained in:
Gaute Lindkvist
2019-01-11 10:48:28 +01:00
parent 65ee55c96d
commit d1a457bf07
5 changed files with 464 additions and 336 deletions

View File

@@ -41,9 +41,10 @@ RivContourMapProjectionPartMgr::RivContourMapProjectionPartMgr(RimContourMapProj
//--------------------------------------------------------------------------------------------------
void RivContourMapProjectionPartMgr::createProjectionGeometry()
{
m_contourMapProjection->generateContourPolygons();
m_contourMapProjection->generateGeometryIfNecessary();
m_contourLinePolygons = m_contourMapProjection->contourPolygons();
m_contourMapTriangles = m_contourMapProjection->generateTrianglesWithVertexValues();
m_contourMapTriangles = m_contourMapProjection->trianglesWithVertexValues();
}
//--------------------------------------------------------------------------------------------------
@@ -343,7 +344,10 @@ std::vector<std::vector<cvf::ref<cvf::Drawable>>> RivContourMapProjectionPartMgr
geo->setVertexArray(vertexArray.p());
contourDrawables.push_back(geo);
}
contourDrawablesForAllLevels[i] = contourDrawables;
if (!contourDrawables.empty())
{
contourDrawablesForAllLevels[i] = contourDrawables;
}
}
return contourDrawablesForAllLevels;
}