Removed old getVoxelAt()/setVoxelAt() functions. they've been flagged as deprecated for a while now, and are replaced by just getVoxel()/setVoxel().

This commit is contained in:
David Williams
2015-02-27 11:07:15 +01:00
parent 42e8b2cf44
commit 64d010527b
26 changed files with 48 additions and 287 deletions

View File

@ -92,7 +92,7 @@ void TestAStarPathfinder::testExecute()
for(int x = 0; x < uVolumeSideLength; x++)
{
uint8_t solidVoxel(0);
volData.setVoxelAt(x,y,z,solidVoxel);
volData.setVoxel(x,y,z,solidVoxel);
}
}
}
@ -105,7 +105,7 @@ void TestAStarPathfinder::testExecute()
for(int x = 4; x < 12; x++)
{
uint8_t solidVoxel(1);
volData.setVoxelAt(x,y,z,solidVoxel);
volData.setVoxel(x,y,z,solidVoxel);
}
}
}

View File

@ -60,7 +60,7 @@ void TestAmbientOcclusionGenerator::testExecute()
{
for (int32_t x = 0; x < g_uVolumeSideLength; x++)
{
volData.setVoxelAt(x, y, z, 1);
volData.setVoxel(x, y, z, 1);
}
}
}

View File

@ -78,7 +78,7 @@ VolumeType* createAndFillVolumeWithNoise(int32_t iVolumeSideLength, typename Vol
if (minValue == maxValue)
{
// In this case we are filling the whole volume with a single value.
volData->setVoxelAt(x, y, z, minValue);
volData->setVoxel(x, y, z, minValue);
}
else
{
@ -86,7 +86,7 @@ VolumeType* createAndFillVolumeWithNoise(int32_t iVolumeSideLength, typename Vol
// We can't use std distributions because they vary between platforms (breaking tests).
int voxelValue = (rng() % (maxValue - minValue + 1)) + minValue; // +1 for inclusive bounds
volData->setVoxelAt(x, y, z, static_cast<typename VolumeType::VoxelType>(voxelValue));
volData->setVoxel(x, y, z, static_cast<typename VolumeType::VoxelType>(voxelValue));
}
}
}
@ -113,11 +113,11 @@ VolumeType* createAndFillVolumeRealistic(int32_t iVolumeSideLength)
// that it's not empty/random data, and should allow significant decimation to be performed.
if ((x ^ y) & 0x01)
{
volData->setVoxelAt(x, y, z, 0);
volData->setVoxel(x, y, z, 0);
}
else
{
volData->setVoxelAt(x, y, z, 1);
volData->setVoxel(x, y, z, 1);
}
}
}

View File

@ -50,7 +50,7 @@ void TestLowPassFilter::testExecute()
if(x % 2 == 0)
{
Density8 voxel(32);
volData.setVoxelAt(x, y, z, voxel);
volData.setVoxel(x, y, z, voxel);
}
}
}

View File

@ -43,11 +43,11 @@ void TestPicking::testExecute()
{
if((x > uVolumeSideLength/2)) //x > 16 is filled
{
volData.setVoxelAt(x, y, z, 100);
volData.setVoxel(x, y, z, 100);
}
else
{
volData.setVoxelAt(x, y, z, 0);
volData.setVoxel(x, y, z, 0);
}
}
}

View File

@ -82,11 +82,11 @@ void TestRaycast::testExecute()
{
if((x == 0) || (x == uVolumeSideLength-1) || (y == 0) || (y == uVolumeSideLength-1))
{
volData.setVoxelAt(x, y, z, 100);
volData.setVoxel(x, y, z, 100);
}
else
{
volData.setVoxelAt(x, y, z, -100);
volData.setVoxel(x, y, z, -100);
}
}
}

View File

@ -120,7 +120,7 @@ VolumeType* createAndFillVolume(void)
typename VolumeType::VoxelType voxelValue;
writeDensityValueToVoxel<typename VolumeType::VoxelType>(x + y + z, voxelValue);
writeMaterialValueToVoxel<typename VolumeType::VoxelType>(z > uVolumeSideLength / 2 ? 42 : 79, voxelValue);
volData->setVoxelAt(x, y, z, voxelValue);
volData->setVoxel(x, y, z, voxelValue);
}
}
}
@ -150,7 +150,7 @@ VolumeType* createAndFillVolumeWithNoise(int32_t iVolumeSideLength, float minVal
float voxelValue = static_cast<float>(rng()) / static_cast<float>(std::numeric_limits<int32_t>::max()); // Float in range 0.0 to 1.0
voxelValue = voxelValue * (maxValue - minValue) + minValue; // Float in range minValue to maxValue
volData->setVoxelAt(x, y, z, voxelValue);
volData->setVoxel(x, y, z, voxelValue);
}
}
}

View File

@ -145,7 +145,7 @@ public:
/// Sets the value used for voxels which are outside the volume
void setBorderValue(const VoxelType& tBorder) { }
/// Sets the voxel at the position given by <tt>x,y,z</tt> coordinates
bool setVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue)
bool setVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue)
{
if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos)))
{
@ -158,7 +158,7 @@ public:
}
}
/// Sets the voxel at the position given by a 3D vector
bool setVoxelAt(const Vector3DInt32& v3dPos, VoxelType tValue) { return setVoxelAt(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tValue); }
bool setVoxel(const Vector3DInt32& v3dPos, VoxelType tValue) { return setVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tValue); }
/// Calculates approximatly how many bytes of memory the volume is currently using.
uint32_t calculateSizeInBytes(void) { return 0; }
@ -181,7 +181,7 @@ void TestVolumeSubclass::testExtractSurface()
for(int32_t x = 0; x < volumeSubclass.getWidth(); x++)
{
Material8 mat(1);
volumeSubclass.setVoxelAt(Vector3DInt32(x,y,z),mat);
volumeSubclass.setVoxel(Vector3DInt32(x,y,z),mat);
}
}
}

View File

@ -255,8 +255,8 @@ TestVolume::TestVolume()
for(int x = region.getLowerX(); x <= region.getUpperX(); x++)
{
int32_t value = x + y + z;
m_pRawVolume->setVoxelAt(x, y, z, value);
m_pPagedVolume->setVoxelAt(x, y, z, value);
m_pRawVolume->setVoxel(x, y, z, value);
m_pPagedVolume->setVoxel(x, y, z, value);
}
}
}