MIPUtil.cpp File Reference
`#include "MIPUtil.h"`
`#include <cmath>`
`#include <boost/foreach.hpp>`
`#include "CoordSys.h"`

Go to the source code of this file.

## Namespaces

namespace | detail

## Functions

FIELD3D_API FieldMapping::Ptr | detail::adjustedMIPFieldMapping (const FieldRes *base, const V3i &baseRes, const Box3i &extents, const size_t level)
V3i | computeOffset (const FieldRes &f)
| Computes the origin/offset of a field.
FIELD3D_API V3i | detail::mipResolution (const V3i &baseRes, const size_t level, const V3i &add)

## Detailed Description

Contains implementations of resampling-related functions.

Definition in file MIPUtil.cpp.

## Function Documentation

## computeOffset()

V3i computeOffset | ( | const FieldRes & | f | ) |

Computes the origin/offset of a field.

Definition at line 157 of file MIPUtil.cpp.

{
V3d wsOrigin(0.0), vsOrigin;
f.mapping()->worldToVoxel(wsOrigin, vsOrigin);
V3i offset(-static_cast<int>(std::floor(vsOrigin.x + 0.5)),
-static_cast<int>(std::floor(vsOrigin.y + 0.5)),
-static_cast<int>(std::floor(vsOrigin.z + 0.5)));
return offset;
}
V3i
Imath::V3i V3i
Definition SpiMathLib.h:71
V3d
Imath::V3d V3d
Definition SpiMathLib.h:74
FieldRes::mapping
FieldMapping::Ptr mapping()
Returns a pointer to the mapping.
Definition Field.h:263

References FieldRes::mapping().