From cc4902b4d7f39c2faf5c469e98effc1165c2cc4c Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 11 Feb 2008 19:54:57 +0000 Subject: [PATCH] Removed IntegralVector3.h --- CMakeLists.txt | 1 - include/IntegralVector3.h | 114 --------------------------------- include/PolyVoxSceneManager.h | 2 +- include/RegionGeometry.h | 1 - include/SurfaceVertex.h | 2 +- include/Volume.h | 4 +- include/VolumeIterator.h | 1 + source/PolyVoxSceneManager.cpp | 4 +- source/Volume.cpp | 15 ++--- 9 files changed, 14 insertions(+), 130 deletions(-) delete mode 100644 include/IntegralVector3.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 0507ef51..55796f80 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,6 @@ SET(INC_FILES include/Constants.h include/ForwardDeclarations.h include/IndexedSurfacePatch.h - include/IntegralVector3.h include/MarchingCubesTables.h include/PolyVoxSceneManager.h include/RegionGeometry.h diff --git a/include/IntegralVector3.h b/include/IntegralVector3.h deleted file mode 100644 index 6e034ba5..00000000 --- a/include/IntegralVector3.h +++ /dev/null @@ -1,114 +0,0 @@ -/****************************************************************************** -This file is part of a voxel plugin for OGRE -Copyright (C) 2006 David Williams - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -******************************************************************************/ -#ifndef __IntegralVector3_H__ -#define __IntegralVector3_H__ - -#include "boost/cstdint.hpp" - -#include "Vector.h" - -namespace PolyVox -{ - template class IntegralVector3 - { - public: - IntegralVector3() - :x(0) - ,y(0) - ,z(0) - { - } - - IntegralVector3(Type xToSet, Type yToSet, Type zToSet) - :x(xToSet) - ,y(yToSet) - ,z(zToSet) - { - } - - void setData(Type xToSet, Type yToSet, Type zToSet) - { - x = xToSet; - y = yToSet; - z = zToSet; - } - - bool operator==(const IntegralVector3& rhs) const throw() - { - return ((x == rhs.x) && (y == rhs.y) && (z == rhs.z)); - } - - bool operator<(const IntegralVector3& rhs) const throw() - { - if(x != rhs.x) - return (x < rhs.x); - else if(y != rhs.y) - return (y < rhs.y); - else if(z != rhs.z) - return (z < rhs.z); - else - return false; //They are equal - } - - Vector3DFloat toVector3DFloat(void) const - { - return Vector3DFloat(x, y, z); - } - - Type x; - Type y; - Type z; - }; - - template - IntegralVector3 operator-(const IntegralVector3& lhs, const IntegralVector3& rhs) - { - IntegralVector3 result; - - result.x = lhs.x - rhs.x; - result.y = lhs.y - rhs.y; - result.z = lhs.z - rhs.z; - - return result; - } - - template - IntegralVector3 operator+(const IntegralVector3& lhs, const IntegralVector3& rhs) - { - IntegralVector3 result; - - result.x = lhs.x + rhs.x; - result.y = lhs.y + rhs.y; - result.z = lhs.z + rhs.z; - - return result; - } - - typedef IntegralVector3 CharVector3; - typedef IntegralVector3 ShortVector3; - typedef IntegralVector3 IntVector3; - typedef IntegralVector3 LongVector3; - - typedef IntegralVector3 UCharVector3; - typedef IntegralVector3 UShortVector3; - typedef IntegralVector3 UIntVector3; - typedef IntegralVector3 ULongVector3; -} - -#endif diff --git a/include/PolyVoxSceneManager.h b/include/PolyVoxSceneManager.h index 2bb76a0a..556a6aab 100644 --- a/include/PolyVoxSceneManager.h +++ b/include/PolyVoxSceneManager.h @@ -73,7 +73,7 @@ namespace PolyVox void generateMeshDataForRegion(boost::uint16_t regionX,boost:: uint16_t regionY, boost::uint16_t regionZ, IndexedSurfacePatch* singleMaterialPatch, IndexedSurfacePatch* multiMaterialPatch) const; bool containsPoint(Vector3DFloat pos, float boundary); - bool containsPoint(IntVector3 pos, boost::uint16_t boundary); + bool containsPoint(Vector3DInt32 pos, boost::uint16_t boundary); diff --git a/include/RegionGeometry.h b/include/RegionGeometry.h index 35a51229..d62c039e 100644 --- a/include/RegionGeometry.h +++ b/include/RegionGeometry.h @@ -21,7 +21,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define __RegionGeometry_H__ #include "IndexedSurfacePatch.h" -#include "IntegralVector3.h" namespace PolyVox { diff --git a/include/SurfaceVertex.h b/include/SurfaceVertex.h index 4f2ac0eb..b4ea57f8 100644 --- a/include/SurfaceVertex.h +++ b/include/SurfaceVertex.h @@ -22,8 +22,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "TypeDef.h" -#include "IntegralVector3.h" #include "SurfaceTypes.h" +#include "Vector.h" namespace PolyVox { diff --git a/include/Volume.h b/include/Volume.h index ec9bdb25..973b2dc8 100644 --- a/include/Volume.h +++ b/include/Volume.h @@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "Block.h" #include "Constants.h" #include "TypeDef.h" -#include "IntegralVector3.h" +#include "Vector.h" namespace PolyVox { @@ -45,7 +45,7 @@ namespace PolyVox Block* getBlock(boost::uint16_t index); bool containsPoint(Vector3DFloat pos, float boundary); - bool containsPoint(IntVector3 pos, boost::uint16_t boundary); + bool containsPoint(Vector3DInt32 pos, boost::uint16_t boundary); bool loadFromFile(const std::string& sFilename); bool saveToFile(const std::string& sFilename); diff --git a/include/VolumeIterator.h b/include/VolumeIterator.h index 2e3d92b4..468daa28 100644 --- a/include/VolumeIterator.h +++ b/include/VolumeIterator.h @@ -22,6 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "boost/cstdint.hpp" #include "TypeDef.h" +#include "Vector.h" namespace PolyVox { diff --git a/source/PolyVoxSceneManager.cpp b/source/PolyVoxSceneManager.cpp index 400a7bd9..e81163a4 100644 --- a/source/PolyVoxSceneManager.cpp +++ b/source/PolyVoxSceneManager.cpp @@ -685,7 +685,7 @@ namespace PolyVox uint8_t PolyVoxSceneManager::getMaterialIndexAt(uint16_t uX, uint16_t uY, uint16_t uZ) { - if(volumeData->containsPoint(IntVector3(uX,uY,uZ),0)) + if(volumeData->containsPoint(Vector3DInt32(uX,uY,uZ),0)) { VolumeIterator volIter(*volumeData); return volIter.getVoxelAt(uX,uY,uZ); @@ -706,7 +706,7 @@ namespace PolyVox return volumeData->containsPoint(pos, boundary); } - bool PolyVoxSceneManager::containsPoint(IntVector3 pos, uint16_t boundary) + bool PolyVoxSceneManager::containsPoint(Vector3DInt32 pos, uint16_t boundary) { return volumeData->containsPoint(pos, boundary); } diff --git a/source/Volume.cpp b/source/Volume.cpp index 5a20adea..9578b0f5 100644 --- a/source/Volume.cpp +++ b/source/Volume.cpp @@ -17,7 +17,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ******************************************************************************/ -#include "IntegralVector3.h" #include "Volume.h" #include "VolumeIterator.h" @@ -148,14 +147,14 @@ namespace PolyVox && (pos.z() > boundary); } - bool Volume::containsPoint(IntVector3 pos, uint16_t boundary) + bool Volume::containsPoint(Vector3DInt32 pos, uint16_t boundary) { - return (pos.x < OGRE_VOLUME_SIDE_LENGTH - 1 - boundary) - && (pos.y < OGRE_VOLUME_SIDE_LENGTH - 1 - boundary) - && (pos.z < OGRE_VOLUME_SIDE_LENGTH - 1 - boundary) - && (pos.x > boundary) - && (pos.y > boundary) - && (pos.z > boundary); + return (pos.x() < OGRE_VOLUME_SIDE_LENGTH - 1 - boundary) + && (pos.y() < OGRE_VOLUME_SIDE_LENGTH - 1 - boundary) + && (pos.z() < OGRE_VOLUME_SIDE_LENGTH - 1 - boundary) + && (pos.x() > boundary) + && (pos.y() > boundary) + && (pos.z() > boundary); } bool Volume::loadFromFile(const std::string& sFilename)