PolyVox
0.2.1
Open source voxel management library
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
PolyVoxCore
include
PolyVoxCore
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>
32
BaseVolume<VoxelType>::BaseVolume
(
const
Region
& regValid)
33
:m_regValidRegion(regValid)
34
{
35
}
36
44
template
<
typename
VoxelType>
45
BaseVolume<VoxelType>::BaseVolume
(
const
BaseVolume<VoxelType>
&
/*rhs*/
)
46
{
47
assert(
false
);
// See function comment above.
48
}
49
53
template
<
typename
VoxelType>
54
BaseVolume<VoxelType>::~BaseVolume
()
55
{
56
}
57
65
template
<
typename
VoxelType>
66
BaseVolume<VoxelType>
&
BaseVolume<VoxelType>::operator=
(
const
BaseVolume<VoxelType>
&
/*rhs*/
)
67
{
68
assert(
false
);
// See function comment above.
69
}
70
76
template
<
typename
VoxelType>
77
VoxelType
BaseVolume<VoxelType>::getBorderValue
(
void
)
const
78
{
79
assert(
false
);
80
return
VoxelType
();
81
}
82
86
template
<
typename
VoxelType>
87
Region
BaseVolume<VoxelType>::getEnclosingRegion
(
void
)
const
88
{
89
return
m_regValidRegion;
90
}
91
96
template
<
typename
VoxelType>
97
int32_t
BaseVolume<VoxelType>::getWidth
(
void
)
const
98
{
99
return
m_regValidRegion.getUpperCorner().getX() - m_regValidRegion.getLowerCorner().getX() + 1;
100
}
101
106
template
<
typename
VoxelType>
107
int32_t
BaseVolume<VoxelType>::getHeight
(
void
)
const
108
{
109
return
m_regValidRegion.getUpperCorner().getY() - m_regValidRegion.getLowerCorner().getY() + 1;
110
}
111
116
template
<
typename
VoxelType>
117
int32_t
BaseVolume<VoxelType>::getDepth
(
void
)
const
118
{
119
return
m_regValidRegion.getUpperCorner().getZ() - m_regValidRegion.getLowerCorner().getZ() + 1;
120
}
121
127
template
<
typename
VoxelType>
128
int32_t
BaseVolume<VoxelType>::getShortestSideLength
(
void
)
const
129
{
130
return
m_uShortestSideLength;
131
}
132
138
template
<
typename
VoxelType>
139
int32_t
BaseVolume<VoxelType>::getLongestSideLength
(
void
)
const
140
{
141
return
m_uLongestSideLength;
142
}
143
150
template
<
typename
VoxelType>
151
float
BaseVolume<VoxelType>::getDiagonalLength
(
void
)
const
152
{
153
return
m_fDiagonalLength;
154
}
155
162
template
<
typename
VoxelType>
163
VoxelType
BaseVolume<VoxelType>::getVoxelAt
(
int32_t
/*uXPos*/
,
int32_t
/*uYPos*/
,
int32_t
/*uZPos*/
)
const
164
{
165
assert(
false
);
166
return
VoxelType
();
167
}
168
173
template
<
typename
VoxelType>
174
VoxelType
BaseVolume<VoxelType>::getVoxelAt
(
const
Vector3DInt32
&
/*v3dPos*/
)
const
175
{
176
assert(
false
);
177
return
VoxelType
();
178
}
179
183
template
<
typename
VoxelType>
184
void
BaseVolume<VoxelType>::setBorderValue
(
const
VoxelType
&
/*tBorder*/
)
185
{
186
assert(
false
);
187
}
188
196
template
<
typename
VoxelType>
197
bool
BaseVolume<VoxelType>::setVoxelAt
(
int32_t
/*uXPos*/
,
int32_t
/*uYPos*/
,
int32_t
/*uZPos*/
,
VoxelType
/*tValue*/
)
198
{
199
assert(
false
);
200
return
false
;
201
}
202
208
template
<
typename
VoxelType>
209
bool
BaseVolume<VoxelType>::setVoxelAt
(
const
Vector3DInt32
&
/*v3dPos*/
,
VoxelType
/*tValue*/
)
210
{
211
assert(
false
);
212
return
false
;
213
}
214
218
template
<
typename
VoxelType>
219
uint32_t
BaseVolume<VoxelType>::calculateSizeInBytes
(
void
)
220
{
221
return
getWidth() * getHeight() * getDepth() *
sizeof
(
VoxelType
);
222
}
223
}
224
Generated by
1.8.1