Minor fixes for result accessors

This commit is contained in:
Magne Sjaastad 2014-08-11 07:41:28 +02:00
parent 85d4de6746
commit 68bc378abe
4 changed files with 5 additions and 63 deletions

View File

@ -35,57 +35,3 @@ public:
virtual double cellFaceScalar(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId) const = 0;
};
#if 0
//==================================================================================================
///
//==================================================================================================
class RigResultAccessor2d : public cvf::Object
{
public:
virtual cvf::Vec2d cellScalar(size_t gridLocalCellIndex) const = 0;
virtual cvf::Vec2d cellFaceScalar(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId) const = 0;
virtual QString resultName() const = 0;
};
//==================================================================================================
///
//==================================================================================================
class RigTernaryResultAccessor : public Rig2DResultAccessor
{
public:
/// Requires two of the arguments to be present
void setTernaryResultAccessors(RigResultAccessObject* soil, RigResultAccessObject* sgas, RigResultAccessObject* swat);
/// Returns [SOil, SWat] 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) { };
virtual cvf::Vec2d cellFaceScalar(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId) { return cellScalar(size_t gridLocalCellIndex); };
virtual QString resultName() const = 0;
};
class RivTernaryScalarMapper : public cvf::Object
{
public:
RivTernaryScalarMapper(const cvf::Color3f& undefScalarColor, float opacityLevel) : m_undefScalarColor(undefScalarColor), m_opacityLevel(opacityLevel)
{
}
/// Calculate texture coords into an image produced by updateTexture, from the scalarValue
Vec2f mapToTextureCoord(double soil, double swat, bool isTransparent) {}
/// Update the supplied TextureImage to be addressable by the texture coords delivered by mapToTextureCoord
bool updateTexture(TextureImage* image){}
private:
cvf::Color3f m_undefScalarColor;
float m_opacityLevel;
};
#endif

View File

@ -33,7 +33,4 @@ class RigResultAccessor2d : public cvf::Object
public:
virtual cvf::Vec2d cellScalar(size_t gridLocalCellIndex) const = 0;
virtual cvf::Vec2d cellFaceScalar(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId) const = 0;
virtual QString resultName() const = 0;
};

View File

@ -49,7 +49,7 @@ void RigTernaryResultAccessor::setTernaryResultAccessors(RigResultAccessor* soil
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Vec2d RigTernaryResultAccessor::cellScalar(size_t gridLocalCellIndex)
cvf::Vec2d RigTernaryResultAccessor::cellScalar(size_t gridLocalCellIndex) const
{
double soil = 0.0;
double swat = 0.0;
@ -80,7 +80,7 @@ cvf::Vec2d RigTernaryResultAccessor::cellScalar(size_t gridLocalCellIndex)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Vec2d RigTernaryResultAccessor::cellFaceScalar(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId)
cvf::Vec2d RigTernaryResultAccessor::cellFaceScalar(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId) const
{
return cellScalar(gridLocalCellIndex);
}

View File

@ -19,8 +19,7 @@
#pragma once
#include "RigResultAccessor2d.h"
class RigResultAccessor;
#include "RigResultAccessor.h"
//==================================================================================================
///
@ -35,8 +34,8 @@ public:
/// Returns [SOil, SWat] 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);
virtual cvf::Vec2d cellFaceScalar(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId);;
virtual cvf::Vec2d cellScalar(size_t gridLocalCellIndex) const;
virtual cvf::Vec2d cellFaceScalar(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId) const;
private:
cvf::ref<RigResultAccessor> m_soilAccessor;