Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __PolyVox_Region_H__
00025 #define __PolyVox_Region_H__
00026
00027 #include "PolyVoxImpl/TypeDef.h"
00028
00029 #include "PolyVoxCore/Vector.h"
00030
00031 namespace PolyVox
00032 {
00033 #ifdef SWIG
00034 class Region
00035 #else
00036 class POLYVOX_API Region
00037 #endif
00038 {
00039 public:
00040
00041 static const Region MaxRegion;
00042
00043 Region();
00044 Region(const Vector3DInt32& v3dLowerCorner, const Vector3DInt32& v3dUpperCorner);
00045 Region(int32_t iLowerX, int32_t iLowerY, int32_t iLowerZ, int32_t iUpperX, int32_t iUpperY, int32_t iUpperZ);
00046
00048 bool operator==(const Region& rhs) const throw();
00050 bool operator!=(const Region& rhs) const throw();
00051
00052 const Vector3DInt32& getLowerCorner(void) const;
00053 const Vector3DInt32& getUpperCorner(void) const;
00054
00055 void setLowerCorner(const Vector3DInt32& v3dLowerCorner);
00056 void setUpperCorner(const Vector3DInt32& v3dUpperCorner);
00057
00058 bool containsPoint(const Vector3DFloat& pos, float boundary = 0.0f) const;
00059 bool containsPoint(const Vector3DInt32& pos, uint8_t boundary = 0) const;
00060
00061 bool containsPointInX(float pos, float boundary = 0.0f) const;
00062 bool containsPointInX(int32_t pos, uint8_t boundary = 0) const;
00063 bool containsPointInY(float pos, float boundary = 0.0f) const;
00064 bool containsPointInY(int32_t pos, uint8_t boundary = 0) const;
00065 bool containsPointInZ(float pos, float boundary = 0.0f) const;
00066 bool containsPointInZ(int32_t pos, uint8_t boundary = 0) const;
00067 void cropTo(const Region& other);
00069 int32_t depth(void) const;
00071 int32_t height(void) const;
00072 void shift(const Vector3DInt32& amount);
00073 void shiftLowerCorner(const Vector3DInt32& amount);
00074 void shiftUpperCorner(const Vector3DInt32& amount);
00076 Vector3DInt32 dimensions(void);
00078 int32_t width(void) const;
00079
00080 private:
00081 Vector3DInt32 m_v3dLowerCorner;
00082 Vector3DInt32 m_v3dUpperCorner;
00083
00084
00085
00086
00087
00088 uint8_t dummy;
00089 };
00090 }
00091
00092 #endif