28 #ifndef __Ogre_Volume_GridSource_H__
29 #define __Ogre_Volume_GridSource_H__
78 virtual Vector3 getIntersectionStart(
const Ray &ray,
Real maxDistance)
const;
82 virtual Vector3 getIntersectionEnd(
const Ray &ray,
Real maxDistance)
const;
94 virtual float getVolumeGridValue(
size_t x,
size_t y,
size_t z)
const = 0;
106 virtual void setVolumeGridValue(
int x,
int y,
int z,
float value) = 0;
122 (getVolumeGridValue(x + 1, y - 1, z) - getVolumeGridValue(x - 1, y - 1, z))
123 + (
Real)2.0 * (getVolumeGridValue(x + 1, y, z) - getVolumeGridValue(x - 1, y, z))
124 + (getVolumeGridValue(x + 1, y + 1, z) - getVolumeGridValue(x - 1, y + 1, z)),
125 (getVolumeGridValue(x, y + 1, z - 1) - getVolumeGridValue(x, y - 1, z - 1))
126 + (
Real)2.0 * (getVolumeGridValue(x, y + 1, z) - getVolumeGridValue(x, y - 1, z))
127 + (getVolumeGridValue(x, y + 1, z + 1) - getVolumeGridValue(x, y - 1, z + 1)),
128 (getVolumeGridValue(x - 1, y, z + 1) - getVolumeGridValue(x - 1, y, z - 1))
129 + (
Real)2.0 * (getVolumeGridValue(x, y, z + 1) - getVolumeGridValue(x, y, z - 1))
130 + (getVolumeGridValue(x + 1, y, z + 1) - getVolumeGridValue(x + 1, y, z - 1))) / (
Real)4.0;
134 getVolumeGridValue(x + 1, y, z) - getVolumeGridValue(x - 1, y, z),
135 getVolumeGridValue(x, y + 1, z) - getVolumeGridValue(x, y - 1, z),
136 getVolumeGridValue(x, y, z + 1) - getVolumeGridValue(x, y, z - 1));
141 GridSource(
bool trilinearValue,
bool trilinearGradient,
bool sobelGradient);
149 virtual Vector4 getValueAndGradient(
const Vector3 &position)
const;
153 virtual Real getValue(
const Vector3 &position)
const;
159 size_t getWidth(
void)
const;
165 size_t getHeight(
void)
const;
171 size_t getDepth(
void)
const;
192 Real getVolumeSpaceToWorldSpaceFactor(
void)
const;