mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Tensor results: Add function to create arrow indices
This commit is contained in:
parent
82a394d588
commit
6bb06ce53c
@ -168,6 +168,7 @@ void RivTensorResultPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicLi
|
||||
tensorVisualizations.push_back(TensorVisualization(
|
||||
cvf::Vec3f(displayCoord), -result2, faceNormal, isPressure(elmPrincipals[1][elmIdx]), 2, elmPrincipals[1][elmIdx]));
|
||||
}
|
||||
|
||||
if (isDrawable(result3, m_rimReservoirView->tensorResults()->showPrincipal3()))
|
||||
{
|
||||
tensorVisualizations.push_back(TensorVisualization(
|
||||
@ -304,14 +305,10 @@ cvf::ref<cvf::Part> RivTensorResultPartMgr::createPart(const std::vector<TensorV
|
||||
vertices.push_back(vertex);
|
||||
}
|
||||
|
||||
indices.push_back(counter);
|
||||
indices.push_back(counter + 1);
|
||||
indices.push_back(counter + 2);
|
||||
indices.push_back(counter + 3);
|
||||
indices.push_back(counter + 3);
|
||||
indices.push_back(counter + 4);
|
||||
indices.push_back(counter + 4);
|
||||
indices.push_back(counter + 2);
|
||||
for (const uint& index : createArrowIndices(counter))
|
||||
{
|
||||
indices.push_back(index);
|
||||
}
|
||||
|
||||
counter += 5;
|
||||
}
|
||||
@ -562,3 +559,22 @@ std::array<cvf::Vec3f, 5> RivTensorResultPartMgr::createArrowVertices(const Tens
|
||||
|
||||
return vertices;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::array<uint, 8> RivTensorResultPartMgr::createArrowIndices(uint startIndex) const
|
||||
{
|
||||
std::array<uint, 8> indices;
|
||||
|
||||
indices[0] = startIndex;
|
||||
indices[1] = startIndex + 1;
|
||||
indices[2] = startIndex + 2;
|
||||
indices[3] = startIndex + 3;
|
||||
indices[4] = startIndex + 3;
|
||||
indices[5] = startIndex + 4;
|
||||
indices[6] = startIndex + 4;
|
||||
indices[7] = startIndex + 2;
|
||||
|
||||
return indices;
|
||||
}
|
||||
|
@ -101,7 +101,8 @@ private:
|
||||
static bool isPressure(float principalValue);
|
||||
bool isDrawable(cvf::Vec3f resultVector, bool showPrincipal) const;
|
||||
|
||||
std::array<cvf::Vec3f, 5> createArrowVertices(const TensorVisualization &tensorVisualization) const;
|
||||
std::array<cvf::Vec3f, 5> createArrowVertices(const TensorVisualization &tensorVisualization) const;
|
||||
std::array<uint, 8> createArrowIndices(uint startIndex) const;
|
||||
|
||||
private:
|
||||
caf::PdmPointer<RimGeoMechView> m_rimReservoirView;
|
||||
|
@ -224,7 +224,6 @@ void RimTensorResults::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
{
|
||||
if (changedField == &m_resultPositionTypeUiField)
|
||||
{
|
||||
std::vector<std::string> fieldCompNames = getResultMetaDataForUIFieldSetting();
|
||||
if (m_resultPositionTypeUiField() == m_resultPositionType())
|
||||
{
|
||||
m_resultFieldNameUiField = uiFieldName(m_resultFieldName());
|
||||
@ -284,7 +283,6 @@ QList<caf::PdmOptionItemInfo> RimTensorResults::calculateValueOptions(const caf:
|
||||
{
|
||||
options.push_back(caf::PdmOptionItemInfo(QString::fromStdString(fieldCompNames[oIdx]), QString::fromStdString(fieldCompNames[oIdx])));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return options;
|
||||
|
Loading…
Reference in New Issue
Block a user