Vector specialization.
More...
#include <FieldSampler.h>
|
static void | getMinMax (const WrapperVec_T &f, const Box3d &wsBounds, float *min, float *max) |
|
static void | getMinMaxMIP (const WrapperVec_T &f, const Box3d &wsBounds, float *min, float *max) |
|
static void | sample (const WrapperVec_T &f, const V3d &p, float *value, bool isVs) |
|
static void | sampleMIP (const WrapperVec_T &f, const V3d &p, const float wsSpotSize, float *value, bool isVs) |
|
template<typename WrapperVec_T>
struct FieldSampler< WrapperVec_T, 3 >
Vector specialization.
Definition at line 139 of file FieldSampler.h.
template<typename WrapperVec_T >
static void FieldSampler< WrapperVec_T, 3 >::sample |
( |
const WrapperVec_T & |
f, |
|
|
const V3d & |
p, |
|
|
float * |
value, |
|
|
bool |
isVs |
|
) |
| |
|
inlinestatic |
Definition at line 142 of file FieldSampler.h.
145 V3f v(value[0], value[1], value[2]);
147 for (
size_t i = 0, end = f.size(); i < end; ++i) {
148 if (f[i].vsBounds.intersects(p)) {
149 v += f[i].interp.sample(*f[i].field, p);
154 for (
size_t i = 0, end = f.size(); i < end; ++i) {
155 f[i].mapping->worldToVoxel(p, vsP);
156 if (f[i].vsBounds.intersects(vsP)) {
157 v += f[i].interp.sample(*f[i].field, vsP);
161 memcpy(value, &v[0],
sizeof(
V3f));
template<typename WrapperVec_T >
static void FieldSampler< WrapperVec_T, 3 >::sampleMIP |
( |
const WrapperVec_T & |
f, |
|
|
const V3d & |
p, |
|
|
const float |
wsSpotSize, |
|
|
float * |
value, |
|
|
bool |
isVs |
|
) |
| |
|
inlinestatic |
Definition at line 165 of file FieldSampler.h.
168 V3f v(value[0], value[1], value[2]);
170 for (
size_t i = 0, end = f.size(); i < end; ++i) {
171 if (f[i].vsBounds.intersects(p)) {
172 v += f[i].interp->sample(p, wsSpotSize);
177 for (
size_t i = 0, end = f.size(); i < end; ++i) {
178 f[i].mapping->worldToVoxel(p, vsP);
179 if (f[i].vsBounds.intersects(vsP)) {
180 v += f[i].interp->sample(vsP, wsSpotSize);
184 memcpy(value, &v[0],
sizeof(
V3f));
template<typename WrapperVec_T >
static void FieldSampler< WrapperVec_T, 3 >::getMinMax |
( |
const WrapperVec_T & |
f, |
|
|
const Box3d & |
wsBounds, |
|
|
float * |
min, |
|
|
float * |
max |
|
) |
| |
|
inlinestatic |
Definition at line 187 of file FieldSampler.h.
References clipBounds(), discreteBounds(), and worldToVoxel().
190 for (
size_t field = 0, end = f.size(); field < end; ++field) {
192 const Box3i dw = f[field].field->dataWindow();
198 if (!dw.intersects(dvsBounds)) {
201 for (
int k = dvsBounds.min.z; k <= dvsBounds.max.z; ++k) {
202 for (
int j = dvsBounds.min.y; j <= dvsBounds.max.y; ++j) {
203 for (
int i = dvsBounds.min.x; i <= dvsBounds.max.x; ++i) {
204 V3f val = f[field].field->fastValue(i, j, k);
205 min[0] = std::min(val.x, min[0]);
206 min[1] = std::min(val.y, min[1]);
207 min[2] = std::min(val.z, min[2]);
208 max[0] = std::max(val.x, max[0]);
209 max[1] = std::max(val.y, max[1]);
210 max[2] = std::max(val.z, max[2]);
Box3i clipBounds(const Box3i &bbox, const Box3i &bounds)
void worldToVoxel(const Field3D::FieldMapping *mapping, const Box3d &wsBounds, Box3d &vsBounds)
Computes a voxel space bounds given a bounding box in world space. This is done by transforming each ...
Box3i discreteBounds(const Box3d &bbox)
template<typename WrapperVec_T >
static void FieldSampler< WrapperVec_T, 3 >::getMinMaxMIP |
( |
const WrapperVec_T & |
f, |
|
|
const Box3d & |
wsBounds, |
|
|
float * |
min, |
|
|
float * |
max |
|
) |
| |
|
inlinestatic |
Definition at line 217 of file FieldSampler.h.
References clipBounds(), discreteBounds(), FIELD3D_NAMESPACE_HEADER_CLOSE, and worldToVoxel().
220 for (
size_t field = 0, end = f.size(); field < end; ++field) {
222 const Box3i dw = f[field].field->dataWindow();
228 if (!dw.intersects(dvsBounds)) {
231 for (
int k = dvsBounds.min.z; k <= dvsBounds.max.z; ++k) {
232 for (
int j = dvsBounds.min.y; j <= dvsBounds.max.y; ++j) {
233 for (
int i = dvsBounds.min.x; i <= dvsBounds.max.x; ++i) {
234 V3f val = f[field].field->fastMipValue(0, i, j, k);
235 min[0] = std::min(val.x, min[0]);
236 min[1] = std::min(val.y, min[1]);
237 min[2] = std::min(val.z, min[2]);
238 max[0] = std::max(val.x, max[0]);
239 max[1] = std::max(val.y, max[1]);
240 max[2] = std::max(val.z, max[2]);
Box3i clipBounds(const Box3i &bbox, const Box3i &bounds)
void worldToVoxel(const Field3D::FieldMapping *mapping, const Box3d &wsBounds, Box3d &vsBounds)
Computes a voxel space bounds given a bounding box in world space. This is done by transforming each ...
Box3i discreteBounds(const Box3d &bbox)
The documentation for this struct was generated from the following file: