Use texture based ternary visualization

This commit is contained in:
Magne Sjaastad committed 2014-08-14 10:56:38 +02:00
1 parent 1b69f93a11
commit 24a464ecf9
5 files changed
+66 -33

No files matched your search

@@ -52,29 +52,29 @@ void RigTernaryResultAccessor::setTernaryResultAccessors(RigResultAccessor* soil
cvf::Vec2d RigTernaryResultAccessor::cellScalar(size_t gridLocalCellIndex) const
{
double soil = 0.0;
double swat = 0.0;
double sgas = 0.0;
if (m_soilAccessor.notNull())
{
soil = m_soilAccessor->cellScalar(gridLocalCellIndex);
if (m_swatAccessor.notNull())
if (m_sgasAccessor.notNull())
{
swat = m_swatAccessor->cellScalar(gridLocalCellIndex);
sgas = m_sgasAccessor->cellScalar(gridLocalCellIndex);
}
else
{
swat = 1.0 - soil - m_sgasAccessor->cellScalar(gridLocalCellIndex);
sgas = 1.0 - soil - m_swatAccessor->cellScalar(gridLocalCellIndex);
}
}
else
{
swat = m_swatAccessor->cellScalar(gridLocalCellIndex);
sgas = m_sgasAccessor->cellScalar(gridLocalCellIndex);
soil = 1.0 - swat - m_sgasAccessor->cellScalar(gridLocalCellIndex);
soil = 1.0 - sgas - m_swatAccessor->cellScalar(gridLocalCellIndex);
}
return cvf::Vec2d(soil, swat);
return cvf::Vec2d(soil, sgas);
}
//--------------------------------------------------------------------------------------------------
@@ -32,7 +32,7 @@ public:
/// Requires two of the arguments to be present
void setTernaryResultAccessors(RigResultAccessor* soil, RigResultAccessor* sgas, RigResultAccessor* swat);
/// Returns [SOil, SWat] regardless of which one of the three is missing. if Soil or SWat is missing, it is calculated
/// Returns [SOIL, SGAS] regardless of which one of the three is missing. if Soil or SWat is missing, it is calculated
/// based on the two others
virtual cvf::Vec2d cellScalar(size_t gridLocalCellIndex) const;
virtual cvf::Vec2d cellFaceScalar(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId) const;