Deep fix of #316 and also implements #317

#316 Do not show wrong results ...
#317 Avoid stopping animation when switching results
This commit cleans up some of the inconsistencies etc in the top of the
display model generation logic.
This commit is contained in:
Jacob Støren
2015-06-09 16:18:11 +02:00
parent 05315bc7a9
commit 30fcbebc8e
12 changed files with 100 additions and 83 deletions

View File

@@ -96,6 +96,7 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::findOrLoadScalarResult(in
{
CVF_ASSERT(partIndex < (int)(m_femPartResults.size()));
CVF_ASSERT(m_readerInterface.notNull());
CVF_ASSERT(resVarAddr.isValid());
RigFemScalarResultFrames* frames = m_femPartResults[partIndex]->findScalarResult(resVarAddr);
if (frames) return frames;
@@ -145,17 +146,27 @@ int RigFemPartResultsCollection::frameCount()
}
//--------------------------------------------------------------------------------------------------
///
/// Returns whether any of the parts actually had any of the requested results
//--------------------------------------------------------------------------------------------------
void RigFemPartResultsCollection::assertResultsLoaded(const RigFemResultAddress& resVarAddr)
bool RigFemPartResultsCollection::assertResultsLoaded(const RigFemResultAddress& resVarAddr)
{
if (!resVarAddr.isValid()) return false;
bool foundResults = false;
for (int pIdx = 0; pIdx < static_cast<int>(m_femPartResults.size()); ++pIdx)
{
if (m_femPartResults[pIdx].notNull())
{
findOrLoadScalarResult(pIdx, resVarAddr);
RigFemScalarResultFrames* scalarResults = findOrLoadScalarResult(pIdx, resVarAddr);
for (int fIdx = 0; fIdx < scalarResults->frameCount(); ++fIdx)
{
foundResults = foundResults || scalarResults->frameData(fIdx).size();
}
}
}
return foundResults;
}
//--------------------------------------------------------------------------------------------------
@@ -163,6 +174,8 @@ void RigFemPartResultsCollection::assertResultsLoaded(const RigFemResultAddress&
//--------------------------------------------------------------------------------------------------
const std::vector<float>& RigFemPartResultsCollection::resultValues(const RigFemResultAddress& resVarAddr, int partIndex, int frameIndex)
{
CVF_ASSERT(resVarAddr.isValid());
RigFemScalarResultFrames* scalarResults = findOrLoadScalarResult(partIndex, resVarAddr);
return scalarResults->frameData(frameIndex);
}