mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#401) WIP: Prototyped total cell visibility calculation and
calculation of overridden cell visibility.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user