SparseField.h File Reference

Contains the SparseField class. More...

`#include <vector>`
`#include <boost/thread/mutex.hpp>`
`#include <boost/lexical_cast.hpp>`
`#include "Field.h"`
`#include "SparseFile.h"`
`#include "ns.h"`

Go to the source code of this file.

## Classes

class | LinearSparseFieldInterp< Data_T >
struct | Sparse::CheckAllEqual< Data_T >
| Checks if all the values in the SparseBlock are equal. Used by SparseField::releaseBlocks(). More...
struct | Sparse::CheckMaxAbs< Data_T >
| Checks if all the absolute values in the SparseBlock are greater than some number. Useful for making narrow band levelsets Used by SparseField::releaseBlocks(). More...
class | Sparse::SparseBlock< Data_T >
| Storage for one individual block of a SparseField. More...
class | SparseField< Data_T >
| This Field subclass stores voxel data in block-allocated arrays. More...
class | SparseField< Data_T >::block_iterator
class | SparseField< Data_T >::const_iterator
class | SparseField< Data_T >::iterator

## Namespaces

namespace | Sparse
| Namespace for sparse field specifics.

## Macros

#define | BLOCK_ORDER 4

## Typedefs

typedef SparseField< V3d > | SparseField3d
typedef SparseField< V3f > | SparseField3f
typedef SparseField< V3h > | SparseField3h
typedef SparseField< double > | SparseFieldd
typedef SparseField< float > | SparseFieldf
typedef SparseField< half > | SparseFieldh

## Functions

template<typename Data_T>
Box3i | blockCoords (const Box3i &dvsBounds, const SparseField< Data_T > *f)
| FIELD3D_CLASSTYPE_TEMPL_INSTANTIATION (LinearSparseFieldInterp)
| FIELD3D_CLASSTYPE_TEMPL_INSTANTIATION (SparseField)
template<typename Data_T>
bool | Sparse::isAnyLess (const Data_T &left, const Data_T &right)
template<>
bool | Sparse::isAnyLess (const V3d &left, const V3d &right)
template<>
bool | Sparse::isAnyLess (const V3f &left, const V3f &right)
template<>
bool | Sparse::isAnyLess (const V3h &left, const V3h &right)

## Variables

template<typename Data_T>
boost::mutex | Sparse::SparseBlock< Data_T >::ms_resizeMutex

## Detailed Description

Contains the SparseField class.

Definition in file SparseField.h.

## Macro Definition Documentation

## BLOCK_ORDER

#define BLOCK_ORDER 4

Definition at line 57 of file SparseField.h.

Referenced by SparseField< Data_T >::SparseField().

## Typedef Documentation

## SparseFieldh

typedef SparseField<half> SparseFieldh

Definition at line 664 of file SparseField.h.

## SparseFieldf

typedef SparseField<float> SparseFieldf

Definition at line 665 of file SparseField.h.

## SparseFieldd

typedef SparseField<double> SparseFieldd

Definition at line 666 of file SparseField.h.

## SparseField3h

typedef SparseField<V3h> SparseField3h

Definition at line 667 of file SparseField.h.

## SparseField3f

typedef SparseField<V3f> SparseField3f

Definition at line 668 of file SparseField.h.

## SparseField3d

typedef SparseField<V3d> SparseField3d

Definition at line 669 of file SparseField.h.

## Function Documentation

## FIELD3D_CLASSTYPE_TEMPL_INSTANTIATION() [1/2]

FIELD3D_CLASSTYPE_TEMPL_INSTANTIATION | ( | LinearSparseFieldInterp |  | ) |

## FIELD3D_CLASSTYPE_TEMPL_INSTANTIATION() [2/2]

FIELD3D_CLASSTYPE_TEMPL_INSTANTIATION | ( | SparseField |  | ) |

## blockCoords()

template<typename Data_T>

Box3i blockCoords | ( | const Box3i & | dvsBounds,
|  | const SparseField< Data_T > * | f )

Definition at line 676 of file SparseField.h.

{
// Check empty bbox input
if (!continuousBounds(dvsBounds).hasVolume()) {
return Box3i();
}
// Discrete offset voxel space
Box3i dovsBounds = dvsBounds;
f->applyDataWindowOffset(dovsBounds.min.x,
dovsBounds.min.y,
dovsBounds.min.z);
f->applyDataWindowOffset(dovsBounds.max.x,
dovsBounds.max.y,
dovsBounds.max.z);
// Discrete block space bounds
Box3i dbsBounds;
if (f) {
f->getBlockCoord(dovsBounds.min.x, dovsBounds.min.y, dovsBounds.min.z,
dbsBounds.min.x, dbsBounds.min.y, dbsBounds.min.z);
f->getBlockCoord(dovsBounds.max.x, dovsBounds.max.y, dovsBounds.max.z,
dbsBounds.max.x, dbsBounds.max.y, dbsBounds.max.z);
}
return dbsBounds;
}
continuousBounds
Box3d continuousBounds(const Box3i &bbox)
Definition Field.h:1111
Box3i
Imath::Box3i Box3i
Definition SpiMathLib.h:77
SparseField::applyDataWindowOffset
void applyDataWindowOffset(int &i, int &j, int &k) const
Applies data window offset.
Definition SparseField.h:455
SparseField::getBlockCoord
void getBlockCoord(int i, int j, int k, int &bi, int &bj, int &bk) const
Calculates the block coordinates that a given set of voxel coords are in.
Definition SparseField.h:1890

References SparseField< Data_T >::applyDataWindowOffset(), continuousBounds(), and SparseField< Data_T >::getBlockCoord().

Referenced by detail::checkInputEmpty().