(#401) WIP: Prototyped total cell visibility calculation and

calculation of overridden cell visibility.
This commit is contained in:
Jacob Støren
2015-09-14 16:14:44 +02:00
parent c8751bebe0
commit b6fb85e0a4
14 changed files with 260 additions and 9 deletions

View File

@@ -32,6 +32,8 @@
#include "RigGeoMechCaseData.h"
#include "RigFemPartResultsCollection.h"
#include "RimViewLink.h"
#include "RimViewLinker.h"
//--------------------------------------------------------------------------------------------------
///
@@ -166,3 +168,38 @@ void RivFemElmVisibilityCalculator::computePropertyVisibility(cvf::UByteArray* c
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivFemElmVisibilityCalculator::computeOverriddenCellVisibility(cvf::UByteArray* elmVisibilities,
const RigFemPart* femPart,
RimViewLink* masterViewLink)
{
#if 0
CVF_ASSERT(elmVisibilities != NULL);
CVF_ASSERT(femPart != NULL);
RimView* masterView = masterViewLink->ownerViewLinker()->mainView();
cvf::ref<cvf::UByteArray> totCellVisibility = masterView->currentTotalCellVisibility();
int elmCount = femPart->elementCount();
elmVisibilities->resize(elmCount);
elmVisibilities->setAll(false);
RigCaseCellMapper* cellMapper = masterViewLink->cellMapper();
for (size_t elmIdx = 0; elmIdx < elmCount; ++elmIdx)
{
// We are assuming that there is only one part.
int cellCount = 0;
const int* cellIndicesInMasterCase = cellMapper->masterCaseCellIndex(elmIdx, &cellCount);
for (int mcIdx = 0; mcIdx < cellCount; ++mcIdx)
{
(*elmVisibilities)[elmIdx] |= (*totCellVisibility)[cellIndicesInMasterCase[mcIdx]]; // If any is visible, show
}
}
#endif
}