#2460 Tensor Vectors: Use result as colormapping on the vectors

This commit is contained in:
Rebecca Cox
2018-02-20 13:38:45 +01:00
parent 9b1b94a4ae
commit 4ca78ca833
8 changed files with 267 additions and 57 deletions

View File

@@ -21,6 +21,7 @@
#include "RigFemResultAddress.h"
#include "RimGeoMechResultDefinition.h"
#include "RimGeoMechView.h"
#include "RimLegendConfig.h"
#include "cafAppEnum.h"
#include "cafPdmUiListEditor.h"
@@ -59,6 +60,10 @@ RimTensorResults::RimTensorResults()
{
CAF_PDM_InitObject("Tensor Results", ":/CellResult.png", "", "");
CAF_PDM_InitFieldNoDefault(&legendConfig, "LegendDefinition", "Legend Definition", "", "", "");
this->legendConfig = new RimLegendConfig();
legendConfig.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&m_resultPositionType, "ResultPositionType", "Result Position", "", "", "");
m_resultPositionType.uiCapability()->setUiHidden(true);
@@ -97,7 +102,7 @@ RimTensorResults::RimTensorResults()
//--------------------------------------------------------------------------------------------------
RimTensorResults::~RimTensorResults()
{
delete legendConfig;
}
//--------------------------------------------------------------------------------------------------
@@ -108,6 +113,16 @@ RigFemResultAddress RimTensorResults::selectedTensorResult() const
return RigFemResultAddress(m_resultPositionType(), m_resultFieldName().toStdString(), "");
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimTensorResults::setShowTensors(bool enableTensors)
{
m_showTensors = enableTensors;
updateConnectedEditors();
updateUiIconFromState(enableTensors);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -172,6 +187,22 @@ RimTensorResults::ScaleMethod RimTensorResults::scaleMethod() const
return m_scaleMethod();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigFemResultPosEnum RimTensorResults::resultPositionType() const
{
return m_resultPositionType();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimTensorResults::resultFieldName() const
{
return m_resultFieldName();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -208,6 +239,10 @@ void RimTensorResults::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
m_resultPositionType = m_resultPositionTypeUiField;
m_resultFieldName = m_resultFieldNameUiField;
}
if (changedField == &m_showTensors)
{
setShowTensors(m_showTensors);
}
RimGeoMechView* view;
firstAncestorOrThisOfType(view);