#2528 Tensor Vectors: Make tensor vectors for result "E"

This commit is contained in:
Rebecca Cox
2018-02-26 10:59:47 +01:00
parent 75bcf7dcf4
commit f3859a6bee
4 changed files with 35 additions and 7 deletions

View File

@@ -2146,7 +2146,7 @@ std::vector<caf::Ten3f> RigFemPartResultsCollection::tensors(const RigFemResultA
address13.componentName = "S13";
address23.componentName = "S23";
}
else if (resVarAddr.fieldName == "E")
else if (resVarAddr.fieldName == "NE")
{
address11.componentName = "E11";
address22.componentName = "E22";
@@ -2312,7 +2312,7 @@ std::vector<RigFemResultAddress> RigFemPartResultsCollection::tensorPrincipalCom
addresses[1].componentName = "S2";
addresses[2].componentName = "S3";
}
else if (resVarAddr.fieldName == "E")
else if (resVarAddr.fieldName == "NE")
{
addresses[0].componentName = "E1";
addresses[1].componentName = "E2";

View File

@@ -340,7 +340,6 @@ cvf::ref<cvf::Part> RivTensorResultPartMgr::createPart(const std::vector<TensorV
auto vectorColors = m_rimReservoirView->tensorResults()->vectorColors();
if (vectorColors == RimTensorResults::MAGENTA_BROWN_BLACK || vectorColors == RimTensorResults::WHITE_GRAY_BLACK)
{
activeScalerMapper = discreteScalarMapper.p();
createOneColorPerPrincipalScalarMapper(vectorColors, discreteScalarMapper.p());
@@ -453,7 +452,7 @@ bool RivTensorResultPartMgr::isTensorAddress(RigFemResultAddress address)
{
return false;
}
if (!(address.fieldName == "SE" || address.fieldName == "ST" || address.fieldName == "E"))
if (!(address.fieldName == "SE" || address.fieldName == "ST" || address.fieldName == "NE"))
{
return false;
}

View File

@@ -226,7 +226,7 @@ void RimTensorResults::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
std::vector<std::string> fieldCompNames = getResultMetaDataForUIFieldSetting();
if (m_resultPositionTypeUiField() == m_resultPositionType())
{
m_resultFieldNameUiField = m_resultFieldName();
m_resultFieldNameUiField = uiFieldName(m_resultFieldName());
}
else
{
@@ -237,7 +237,7 @@ void RimTensorResults::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
if (changedField == &m_resultFieldNameUiField)
{
m_resultPositionType = m_resultPositionTypeUiField;
m_resultFieldName = m_resultFieldNameUiField;
m_resultFieldName = fieldNameFromUi(m_resultFieldNameUiField);
}
if (changedField == &m_showTensors)
{
@@ -319,7 +319,7 @@ void RimTensorResults::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering
void RimTensorResults::initAfterRead()
{
m_resultPositionTypeUiField = m_resultPositionType;
m_resultFieldNameUiField = m_resultFieldName();
m_resultFieldNameUiField = uiFieldName(m_resultFieldName());
}
//--------------------------------------------------------------------------------------------------
@@ -336,3 +336,29 @@ void RimTensorResults::defineEditorAttribute(const caf::PdmFieldHandle* field, Q
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimTensorResults::uiFieldName(const QString& fieldName)
{
if (fieldName == "NE")
{
return QString("E");
}
return fieldName;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimTensorResults::fieldNameFromUi(const QString& uiFieldName)
{
if (uiFieldName == "E")
{
return QString("NE");
}
return uiFieldName;
}

View File

@@ -82,6 +82,9 @@ private:
virtual void initAfterRead() override;
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override;
static QString uiFieldName(const QString& fieldName);
static QString fieldNameFromUi(const QString& uiFieldName);
private:
caf::PdmField<bool> m_showTensors;