mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-25 14:40:26 -05:00
Refactor: simplify VTK surface parsing using pugixml
This commit is contained in:
1 parent
c66f4f8158
commit
7908c8186f
18 files changed
+282
-330
No files matched your search
@@ -19,14 +19,15 @@
|
||||
#include "RimSurface.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimRegularLegendConfig.h"
|
||||
#include "RimSurfaceCollection.h"
|
||||
|
||||
#include "RigStatisticsMath.h"
|
||||
#include "RigSurface.h"
|
||||
|
||||
#include "RifSurfaceImporter.h"
|
||||
|
||||
#include "cafPdmFieldScriptingCapability.h"
|
||||
#include "cafPdmObjectScriptingCapability.h"
|
||||
#include "cafPdmUiDoubleSliderEditor.h"
|
||||
@@ -322,3 +323,27 @@ void RimSurface::defineEditorAttribute( const caf::PdmFieldHandle* field, QStrin
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSurface::updateMinMaxValues( RimRegularLegendConfig* legend, const QString& propertyName, int currentTimeStep ) const
|
||||
{
|
||||
if ( !m_surfaceData.isNull() )
|
||||
{
|
||||
MinMaxAccumulator minMaxAccumulator;
|
||||
PosNegAccumulator posNegAccumulator;
|
||||
|
||||
auto values = m_surfaceData->propertyValues( propertyName );
|
||||
minMaxAccumulator.addData( values );
|
||||
posNegAccumulator.addData( values );
|
||||
|
||||
double globalPosClosestToZero = posNegAccumulator.pos;
|
||||
double globalNegClosestToZero = posNegAccumulator.neg;
|
||||
double globalMin = minMaxAccumulator.min;
|
||||
double globalMax = minMaxAccumulator.max;
|
||||
|
||||
legend->setClosestToZeroValues( globalPosClosestToZero, globalNegClosestToZero, globalPosClosestToZero, globalNegClosestToZero );
|
||||
legend->setAutomaticRanges( globalMin, globalMax, globalMin, globalMax );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user