PolyVox  0.3.0-dev
Open source voxel management library
BaseVolume.inl
Go to the documentation of this file.
1 /*******************************************************************************
2 Copyright (c) 2005-2009 David Williams
3 
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7 
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11 
12  1. The origin of this software must not be misrepresented; you must not
13  claim that you wrote the original software. If you use this software
14  in a product, an acknowledgment in the product documentation would be
15  appreciated but is not required.
16 
17  2. Altered source versions must be plainly marked as such, and must not be
18  misrepresented as being the original software.
19 
20  3. This notice may not be removed or altered from any source
21  distribution.
22 *******************************************************************************/
23 
24 namespace PolyVox
25 {
31  template <typename VoxelType>
33  :m_regValidRegion(regValid)
34  ,m_tBorderValue()
35  {
36  }
37 
45  template <typename VoxelType>
47  {
48  POLYVOX_ASSERT(false, "Copy constructor not implemented."); // See function comment above.
49  }
50 
54  template <typename VoxelType>
56  {
57  }
58 
66  template <typename VoxelType>
68  {
69  POLYVOX_ASSERT(false, "Assignment operator not implemented."); // See function comment above.
70  }
71 
77  template <typename VoxelType>
79  {
80  return m_tBorderValue;
81  }
82 
86  template <typename VoxelType>
88  {
89  return m_regValidRegion;
90  }
91 
96  template <typename VoxelType>
98  {
99  return m_regValidRegion.getUpperX() - m_regValidRegion.getLowerX() + 1;
100  }
101 
106  template <typename VoxelType>
108  {
109  return m_regValidRegion.getUpperY() - m_regValidRegion.getLowerY() + 1;
110  }
111 
116  template <typename VoxelType>
118  {
119  return m_regValidRegion.getUpperZ() - m_regValidRegion.getLowerZ() + 1;
120  }
121 
127  template <typename VoxelType>
129  {
130  return m_uShortestSideLength;
131  }
132 
138  template <typename VoxelType>
140  {
141  return m_uLongestSideLength;
142  }
143 
150  template <typename VoxelType>
152  {
153  return m_fDiagonalLength;
154  }
155 
162  template <typename VoxelType>
163  VoxelType BaseVolume<VoxelType>::getVoxel(int32_t /*uXPos*/, int32_t /*uYPos*/, int32_t /*uZPos*/) const
164  {
165  POLYVOX_ASSERT(false, "You should never call the base class version of this function.");
166  return VoxelType();
167  }
168 
173  template <typename VoxelType>
175  {
176  POLYVOX_ASSERT(false, "You should never call the base class version of this function.");
177  return VoxelType();
178  }
179 
186  template <typename VoxelType>
187  VoxelType BaseVolume<VoxelType>::getVoxelAt(int32_t /*uXPos*/, int32_t /*uYPos*/, int32_t /*uZPos*/) const
188  {
189  POLYVOX_ASSERT(false, "You should never call the base class version of this function.");
190  return VoxelType();
191  }
192 
197  template <typename VoxelType>
199  {
200  POLYVOX_ASSERT(false, "You should never call the base class version of this function.");
201  return VoxelType();
202  }
203 
210  template <typename VoxelType>
211  VoxelType BaseVolume<VoxelType>::getVoxelWithWrapping(int32_t /*uXPos*/, int32_t /*uYPos*/, int32_t /*uZPos*/, WrapMode /*eWrapMode*/, VoxelType /*tBorder*/) const
212  {
213  POLYVOX_ASSERT(false, "You should never call the base class version of this function.");
214  return VoxelType();
215  }
216 
221  template <typename VoxelType>
222  VoxelType BaseVolume<VoxelType>::getVoxelWithWrapping(const Vector3DInt32& /*v3dPos*/, WrapMode /*eWrapMode*/, VoxelType /*tBorder*/) const
223  {
224  POLYVOX_ASSERT(false, "You should never call the base class version of this function.");
225  return VoxelType();
226  }
227 
231  template <typename VoxelType>
233  {
234  m_tBorderValue = tBorder;
235  }
236 
244  template <typename VoxelType>
245  bool BaseVolume<VoxelType>::setVoxelAt(int32_t /*uXPos*/, int32_t /*uYPos*/, int32_t /*uZPos*/, VoxelType /*tValue*/)
246  {
247  POLYVOX_ASSERT(false, "You should never call the base class version of this function.");
248  return false;
249  }
250 
256  template <typename VoxelType>
257  bool BaseVolume<VoxelType>::setVoxelAt(const Vector3DInt32& /*v3dPos*/, VoxelType /*tValue*/)
258  {
259  POLYVOX_ASSERT(false, "You should never call the base class version of this function.");
260  return false;
261  }
262 
266  template <typename VoxelType>
268  {
269  return getWidth() * getHeight() * getDepth() * sizeof(VoxelType);
270  }
271 }
272