#1645 Load dynamic NNC results from restart file

This commit is contained in:
Bjørnar Grip Fjær
2017-06-26 10:25:08 +02:00
parent 7b7af2b197
commit de414c4277
21 changed files with 423 additions and 47 deletions

View File

@@ -145,14 +145,26 @@ void RivNNCGeometryGenerator::computeArrays()
/// Calculates the texture coordinates in a "nearly" one dimensional texture.
/// Undefined values are coded with a y-texture coordinate value of 1.0 instead of the normal 0.5
//--------------------------------------------------------------------------------------------------
void RivNNCGeometryGenerator::textureCoordinates(cvf::Vec2fArray* textureCoords, const cvf::ScalarMapper* mapper, size_t scalarResultIndex) const
void RivNNCGeometryGenerator::textureCoordinates(cvf::Vec2fArray* textureCoords,
const cvf::ScalarMapper* mapper,
RimDefines::ResultCatType resultType,
size_t scalarResultIndex,
size_t timeStepIndex) const
{
size_t numVertices = m_vertices->size();
textureCoords->resize(numVertices);
cvf::Vec2f* rawPtr = textureCoords->ptr();
const std::vector<double>* nncResultVals = m_nncData->connectionScalarResult(scalarResultIndex);
const std::vector<double>* nncResultVals;
if (resultType == RimDefines::STATIC_NATIVE)
{
nncResultVals = m_nncData->staticConnectionScalarResult(scalarResultIndex);
}
else if (resultType == RimDefines::DYNAMIC_NATIVE)
{
nncResultVals = m_nncData->dynamicConnectionScalarResult(scalarResultIndex, timeStepIndex);
}
if (!nncResultVals)
{
textureCoords->setAll(cvf::Vec2f(0.0f, 1.0f));