Removed use of cvfStructGridScalarDataAccess

This commit is contained in:
Magne Sjaastad
2014-08-19 14:56:20 +02:00
parent 2fe63ece50
commit cdf2b07118
7 changed files with 0 additions and 271 deletions

View File

@@ -23,7 +23,6 @@
#include "cvfDrawableGeo.h"
#include "cvfPrimitiveSetIndexedUInt.h"
#include "cvfOutlineEdgeExtractor.h"
#include "cvfStructGridScalarDataAccess.h"
#include "cvfStructGridGeometryGenerator.h"
#include "cvfScalarMapper.h"
@@ -201,40 +200,6 @@ void RivFaultGeometryGenerator::computeArrays()
m_vertices->assign(vertices);
}
//--------------------------------------------------------------------------------------------------
/// Calculates the texture coordinates in a "nearly" one dimensional texture.
/// Undefined values are coded with a y-texture coordinate value of 1.0 instead of the normal 0.5
//--------------------------------------------------------------------------------------------------
void RivFaultGeometryGenerator::textureCoordinates(cvf::Vec2fArray* textureCoords, const cvf::StructGridScalarDataAccess* resultAccessor, const cvf::ScalarMapper* mapper) const
{
if (!resultAccessor) return;
size_t numVertices = m_quadMapper->quadCount()*4;
textureCoords->resize(numVertices);
cvf::Vec2f* rawPtr = textureCoords->ptr();
double cellScalarValue;
cvf::Vec2f texCoord;
#pragma omp parallel for private(texCoord, cellScalarValue)
for (int i = 0; i < static_cast<int>(m_quadMapper->quadCount()); i++)
{
cellScalarValue = resultAccessor->cellScalar(m_quadMapper->cellIndex(i));
texCoord = mapper->mapToTextureCoord(cellScalarValue);
if (cellScalarValue == HUGE_VAL || cellScalarValue != cellScalarValue) // a != a is true for NAN's
{
texCoord[1] = 1.0f;
}
size_t j;
for (j = 0; j < 4; j++)
{
rawPtr[i*4 + j] = texCoord;
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -47,10 +47,6 @@ public:
void setCellVisibility(const cvf::UByteArray* cellVisibilities );
void textureCoordinates(cvf::Vec2fArray* textureCoords,
const cvf::StructGridScalarDataAccess* resultAccessor,
const cvf::ScalarMapper* mapper) const;
// Mapping between cells and geometry
const cvf::StructGridQuadToCellFaceMapper* quadToCellFaceMapper() { return m_quadMapper.p(); }

View File

@@ -58,7 +58,6 @@
#include "cvfShaderSourceProvider.h"
#include "cvfShaderSourceRepository.h"
#include "cvfStructGrid.h"
#include "cvfStructGridGeometryGenerator.h"
#include "cvfUniform.h"
@@ -295,20 +294,3 @@ RivGridPartMgr::~RivGridPartMgr()
}
//--------------------------------------------------------------------------------------------------
/// Helper class used to provide zero for all cells
/// This way we can avoid to test if a StructGridScalarDataAccess object is valid before reading out the value.
//--------------------------------------------------------------------------------------------------
class ScalarDataAccessZeroForAllCells : public cvf::StructGridScalarDataAccess
{
public:
virtual double cellScalar(size_t cellIndex) const
{
return 0.0;
}
virtual void setCellScalar(size_t cellIndex, double value)
{
}
};