DenseField.h
Go to the documentation of this file.
//----------------------------------------------------------------------------//
/*
* Copyright (c) 2009 Sony Pictures Imageworks Inc
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution. Neither the name of Sony Pictures Imageworks nor the
* names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
//----------------------------------------------------------------------------//
//----------------------------------------------------------------------------//
#ifndef _INCLUDED_Field3D_DenseField_H_
#define _INCLUDED_Field3D_DenseField_H_
#include <vector>
#include <boost/lexical_cast.hpp>
#include "Field.h"
//----------------------------------------------------------------------------//
#include "ns.h"
FIELD3D_NAMESPACE_OPEN
//----------------------------------------------------------------------------//
// Forward declarations
//----------------------------------------------------------------------------//
template <class Field_T>
class LinearGenericFieldInterp;
template <class Field_T>
class CubicGenericFieldInterp;
//----------------------------------------------------------------------------//
// DenseField
//----------------------------------------------------------------------------//
//----------------------------------------------------------------------------//
template <class Data_T>
class DenseField
: public ResizableField<Data_T>
{
public:
// Typedefs ------------------------------------------------------------------
typedef boost::intrusive_ptr<DenseField> Ptr;
typedef std::vector<Ptr> Vec;
typedef LinearGenericFieldInterp<DenseField<Data_T> > LinearInterp;
typedef CubicGenericFieldInterp<DenseField<Data_T> > CubicInterp;
typedef ResizableField<Data_T> base;
// Constructors --------------------------------------------------------------
DenseField();
// \}
// Main methods --------------------------------------------------------------
virtual void clear(const Data_T &value);
// Threading-related ---------------------------------------------------------
size_t numGrains() const;
bool getGrainBounds(const size_t idx, Box3i &vsBounds) const;
// From Field base class -----------------------------------------------------
virtual Data_T value(int i, int j, int k) const;
virtual long long int memSize() const;
// RTTI replacement ----------------------------------------------------------
typedef DenseField<Data_T> class_type;
DEFINE_FIELD_RTTI_CONCRETE_CLASS
static const char *staticClassName()
{
return "DenseField";
}
static const char *staticClassType()
{
return DenseField<Data_T>::ms_classType.name();
}
// From WritableField base class ---------------------------------------------
virtual Data_T& lvalue(int i, int j, int k);
// Concrete voxel access -----------------------------------------------------
const Data_T& fastValue(int i, int j, int k) const;
Data_T& fastLValue(int i, int j, int k);
// Iterators -----------------------------------------------------------------
class const_iterator;
class iterator;
const_iterator cbegin() const;
const_iterator cbegin(const Box3i &subset) const;
const_iterator cend() const;
const_iterator cend(const Box3i &subset) const;
iterator begin();
iterator begin(const Box3i &subset);
iterator end();
iterator end(const Box3i &subset);
// Utility methods -----------------------------------------------------------
const FIELD3D_VEC3_T<size_t> &internalMemSize() const
{ return m_memSize; }
// From FieldBase ------------------------------------------------------------
FIELD3D_CLASSNAME_CLASSTYPE_IMPLEMENTATION;
virtual FieldBase::Ptr clone() const
{ return Ptr(new DenseField(*this)); }
protected:
// From ResizableField class -------------------------------------------------
virtual void sizeChanged();
// Data members --------------------------------------------------------------
FIELD3D_VEC3_T<size_t> m_memSize;
size_t m_memSizeXY;
std::vector<Data_T> m_data;
private:
// Static data members -------------------------------------------------------
static TemplatedFieldType<DenseField<Data_T> > ms_classType;
// Direct access to memory for iterators -------------------------------------
inline Data_T* ptr(int i, int j, int k);
inline const Data_T* ptr(int i, int j, int k) const;
};
//----------------------------------------------------------------------------//
// Typedefs
//----------------------------------------------------------------------------//
typedef DenseField<half> DenseFieldh;
typedef DenseField<float> DenseFieldf;
typedef DenseField<double> DenseFieldd;
typedef DenseField<V3h> DenseField3h;
typedef DenseField<V3f> DenseField3f;
typedef DenseField<V3d> DenseField3d;
//----------------------------------------------------------------------------//
// DenseField::const_iterator
//----------------------------------------------------------------------------//
template <class Data_T>
class DenseField<Data_T>::const_iterator
{
public:
#if defined(WIN32) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
typedef std::forward_iterator_tag iterator_category;
typedef Data_T value_type;
typedef ptrdiff_t difference_type;
typedef ptrdiff_t distance_type;
typedef const Data_T *pointer;
typedef const Data_T& reference;
#endif
// Typedefs ------------------------------------------------------------------
typedef DenseField<Data_T> class_type;
// Constructors --------------------------------------------------------------
const_iterator(const class_type &field, const Box3i &window,
const V3i &currentPos)
: x(currentPos.x), y(currentPos.y), z(currentPos.z),
m_window(window), m_field(field)
{
if (window.intersects(currentPos))
m_p = m_field.ptr(x, y, z);
else
m_p = 0;
}
// Operators -----------------------------------------------------------------
const const_iterator& operator ++ ()
{
if (x == m_window.max.x) {
if (y == m_window.max.y) {
if (z == m_window.max.z) {
m_p = 0;
} else {
m_p = m_field.ptr(x = m_window.min.x, y = m_window.min.y, ++z);
}
} else {
m_p = m_field.ptr(x = m_window.min.x, ++y, z);
}
} else {
++x;
++m_p;
}
return *this;
}
template <class Iter_T>
inline bool operator == (const Iter_T &rhs) const
{
return m_p == &(*rhs);
}
template <class Iter_T>
inline bool operator != (const Iter_T &rhs) const
{
return m_p != &(*rhs);
}
inline const Data_T& operator * () const
{
return *m_p;
}
inline const Data_T* operator -> () const
{
return m_p;
}
// Public data members -------------------------------------------------------
int x, y, z;
private:
// Private data members ------------------------------------------------------
const Data_T *m_p;
Box3i m_window;
const class_type &m_field;
};
//----------------------------------------------------------------------------//
// DenseField::iterator
//----------------------------------------------------------------------------//
template <class Data_T>
class DenseField<Data_T>::iterator
{
public:
#if defined(WIN32) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
typedef std::forward_iterator_tag iterator_category;
typedef Data_T value_type;
typedef ptrdiff_t difference_type;
typedef ptrdiff_t distance_type;
typedef Data_T *pointer;
typedef Data_T& reference;
#endif
// Typedefs ------------------------------------------------------------------
typedef DenseField<Data_T> class_type;
// Constructors --------------------------------------------------------------
iterator(class_type &field, const Box3i &window,
const V3i &currentPos)
: x(currentPos.x), y(currentPos.y), z(currentPos.z),
m_window(window), m_field(field)
{
if (window.intersects(currentPos))
m_p = m_field.ptr(x, y, z);
else
m_p = 0;
}
// Operators -----------------------------------------------------------------
const iterator& operator ++ ()
{
if (x == m_window.max.x) {
if (y == m_window.max.y) {
if (z == m_window.max.z) {
m_p = 0;
} else {
m_p = m_field.ptr(x = m_window.min.x, y = m_window.min.y, ++z);
}
} else {
m_p = m_field.ptr(x = m_window.min.x, ++y, z);
}
} else {
++x;
++m_p;
}
return *this;
}
template <class Iter_T>
inline bool operator == (const Iter_T &rhs) const
{
return m_p == &(*rhs);
}
template <class Iter_T>
inline bool operator != (const Iter_T &rhs) const
{
return m_p != &(*rhs);
}
inline Data_T& operator * () const
{
return *m_p;
}
inline Data_T* operator -> () const
{
return m_p;
}
// Public data members -------------------------------------------------------
int x, y, z;
private:
// Private data members ------------------------------------------------------
Data_T *m_p;
Box3i m_window;
class_type &m_field;
};
//----------------------------------------------------------------------------//
// DenseField implementations
//----------------------------------------------------------------------------//
template <class Data_T>
DenseField<Data_T>::DenseField()
: base(),
m_memSize(0), m_memSizeXY(0)
{
// Empty
}
//----------------------------------------------------------------------------//
template <class Data_T>
void DenseField<Data_T>::clear(const Data_T &value)
{
std::fill(m_data.begin(), m_data.end(), value);
}
//----------------------------------------------------------------------------//
template <class Data_T>
size_t DenseField<Data_T>::numGrains() const
{
// Grain resolution
const V3i res = base::m_dataWindow.size() + V3i(1);
// Num grains is Y * Z
return res.y * res.z;
}
//----------------------------------------------------------------------------//
template <class Data_T>
bool DenseField<Data_T>::getGrainBounds(const size_t idx, Box3i &bounds) const
{
// Grain resolution
const V3i res = base::m_dataWindow.size() + V3i(1);
// Compute coordinate
const int y = idx % res.y;
const int z = idx / res.y;
// Build bbox
const V3i start = base::m_dataWindow.min + V3i(0, y, z);
const V3i end = base::m_dataWindow.min + V3i(res.x, y, z);
bounds = Field3D::clipBounds(Box3i(start, end), base::m_dataWindow);
// Done
return true;
}
//----------------------------------------------------------------------------//
template <class Data_T>
Data_T DenseField<Data_T>::value(int i, int j, int k) const
{
return fastValue(i, j, k);
}
//----------------------------------------------------------------------------//
template <class Data_T>
long long int DenseField<Data_T>::memSize() const
{
long long int superClassMemSize = base::memSize();
long long int vectorMemSize = m_data.capacity() * sizeof(Data_T);
return sizeof(*this) + vectorMemSize + superClassMemSize;
}
//----------------------------------------------------------------------------//
template <class Data_T>
Data_T& DenseField<Data_T>::lvalue(int i, int j, int k)
{
return fastLValue(i, j, k);
}
//----------------------------------------------------------------------------//
template <class Data_T>
const Data_T& DenseField<Data_T>::fastValue(int i, int j, int k) const
{
assert (i >= base::m_dataWindow.min.x);
assert (i <= base::m_dataWindow.max.x);
assert (j >= base::m_dataWindow.min.y);
assert (j <= base::m_dataWindow.max.y);
assert (k >= base::m_dataWindow.min.z);
assert (k <= base::m_dataWindow.max.z);
// Add crop window offset
i -= base::m_dataWindow.min.x;
j -= base::m_dataWindow.min.y;
k -= base::m_dataWindow.min.z;
// Access data
return m_data[i + j * m_memSize.x + k * m_memSizeXY];
}
//----------------------------------------------------------------------------//
template <class Data_T>
Data_T& DenseField<Data_T>::fastLValue(int i, int j, int k)
{
assert (i >= base::m_dataWindow.min.x);
assert (i <= base::m_dataWindow.max.x);
assert (j >= base::m_dataWindow.min.y);
assert (j <= base::m_dataWindow.max.y);
assert (k >= base::m_dataWindow.min.z);
assert (k <= base::m_dataWindow.max.z);
// Add crop window offset
i -= base::m_dataWindow.min.x;
j -= base::m_dataWindow.min.y;
k -= base::m_dataWindow.min.z;
// Access data
return m_data[i + j * m_memSize.x + k * m_memSizeXY];
}
//----------------------------------------------------------------------------//
template <class Data_T>
typename DenseField<Data_T>::const_iterator
DenseField<Data_T>::cbegin() const
{
if (FieldRes::dataResolution() == V3i(0))
return cend();
return const_iterator(*this, base::m_dataWindow, base::m_dataWindow.min);
}
//----------------------------------------------------------------------------//
template <class Data_T>
typename DenseField<Data_T>::const_iterator
DenseField<Data_T>::cbegin(const Box3i &subset) const
{
if (subset.isEmpty())
return cend(subset);
return const_iterator(*this, subset, subset.min);
}
//----------------------------------------------------------------------------//
template <class Data_T>
typename DenseField<Data_T>::const_iterator
DenseField<Data_T>::cend() const
{
return const_iterator(*this, base::m_dataWindow,
V3i(base::m_dataWindow.min.x,
base::m_dataWindow.min.y,
base::m_dataWindow.max.z + 1));
}
//----------------------------------------------------------------------------//
template <class Data_T>
typename DenseField<Data_T>::const_iterator
DenseField<Data_T>::cend(const Box3i &subset) const
{
return const_iterator(*this, subset,
V3i(subset.min.x, subset.min.y, subset.max.z + 1));
}
//----------------------------------------------------------------------------//
template <class Data_T>
typename DenseField<Data_T>::iterator
DenseField<Data_T>::begin()
{
if (FieldRes::dataResolution() == V3i(0))
return end();
return iterator(*this, base::m_dataWindow, base::m_dataWindow.min); }
//----------------------------------------------------------------------------//
template <class Data_T>
typename DenseField<Data_T>::iterator
DenseField<Data_T>::begin(const Box3i &subset)
{
if (subset.isEmpty())
return end(subset);
return iterator(*this, subset, subset.min);
}
//----------------------------------------------------------------------------//
template <class Data_T>
typename DenseField<Data_T>::iterator
DenseField<Data_T>::end()
{
return iterator(*this, base::m_dataWindow,
V3i(base::m_dataWindow.min.x,
base::m_dataWindow.min.y,
base::m_dataWindow.max.z + 1));
}
//----------------------------------------------------------------------------//
template <class Data_T>
typename DenseField<Data_T>::iterator
DenseField<Data_T>::end(const Box3i &subset)
{
return iterator(*this, subset,
V3i(subset.min.x, subset.min.y, subset.max.z + 1));
}
//----------------------------------------------------------------------------//
template <class Data_T>
void DenseField<Data_T>::sizeChanged()
{
// Call base class
base::sizeChanged();
// Calculate offsets
m_memSize = base::m_dataWindow.max - base::m_dataWindow.min + V3i(1);
m_memSizeXY = m_memSize.x * m_memSize.y;
// Check that mem size is >= 0 in all dimensions
if (base::m_dataWindow.max.x < base::m_dataWindow.min.x ||
base::m_dataWindow.max.y < base::m_dataWindow.min.y ||
base::m_dataWindow.max.z < base::m_dataWindow.min.z)
throw Exc::ResizeException("Attempt to resize ResizableField object "
"using negative size. Data window was: " +
boost::lexical_cast<std::string>(
base::m_dataWindow.min) + " - " +
boost::lexical_cast<std::string>(
base::m_dataWindow.max));
// Allocate memory
try {
std::vector<Data_T>().swap(m_data);
m_data.resize(m_memSize.x * m_memSize.y * m_memSize.z);
}
catch (std::bad_alloc &) {
throw Exc::MemoryException("Couldn't allocate DenseField of size " +
boost::lexical_cast<std::string>(m_memSize));
}
}
//----------------------------------------------------------------------------//
template <class Data_T>
inline Data_T* DenseField<Data_T>::ptr(int i, int j, int k)
{
// Add crop window offset
i -= base::m_dataWindow.min.x;
j -= base::m_dataWindow.min.y;
k -= base::m_dataWindow.min.z;
// Access data
return &m_data[i + j * m_memSize.x + k * m_memSizeXY];
}
//----------------------------------------------------------------------------//
template <class Data_T>
inline const Data_T* DenseField<Data_T>::ptr(int i, int j, int k) const
{
// Add crop window offset
i -= base::m_dataWindow.min.x;
j -= base::m_dataWindow.min.y;
k -= base::m_dataWindow.min.z;
// Access data
return &m_data[i + j * m_memSize.x + k * m_memSizeXY];
}
//----------------------------------------------------------------------------//
// Static data member instantiation
//----------------------------------------------------------------------------//
FIELD3D_CLASSTYPE_TEMPL_INSTANTIATION(DenseField);
//----------------------------------------------------------------------------//
FIELD3D_NAMESPACE_HEADER_CLOSE
//----------------------------------------------------------------------------//
#endif // Include guard
DenseField3d
DenseField< V3d > DenseField3d
Definition DenseField.h:250
DenseFieldf
DenseField< float > DenseFieldf
Definition DenseField.h:246
DenseField3h
DenseField< V3h > DenseField3h
Definition DenseField.h:248
DenseFieldh
DenseField< half > DenseFieldh
Definition DenseField.h:245
DenseField3f
DenseField< V3f > DenseField3f
Definition DenseField.h:249
DenseFieldd
DenseField< double > DenseFieldd
Definition DenseField.h:247
operator*
FIELD3D_VEC3_T< T > operator*(S s, const FIELD3D_VEC3_T< T > vec)
Scalar times Vec3 multiplication. Makes the interpolation calls cleaner.
Definition FieldInterp.h:1558
Field.h
Contains Field, WritableField and ResizableField classes.
FIELD3D_CLASSTYPE_TEMPL_INSTANTIATION
#define FIELD3D_CLASSTYPE_TEMPL_INSTANTIATION(field)
Definition Field.h:479
DEFINE_FIELD_RTTI_CONCRETE_CLASS
#define DEFINE_FIELD_RTTI_CONCRETE_CLASS
Definition RefCount.h:84
V3i
Imath::V3i V3i
Definition SpiMathLib.h:71
FIELD3D_VEC3_T
#define FIELD3D_VEC3_T
Definition SpiMathLib.h:88
Box3i
Imath::Box3i Box3i
Definition SpiMathLib.h:77
CubicGenericFieldInterp
Definition FieldInterp.h:376
DenseField::const_iterator
Definition DenseField.h:258
DenseField::const_iterator::x
int x
Current position.
Definition DenseField.h:332
DenseField::const_iterator::m_p
const Data_T * m_p
Pointer to current element.
Definition DenseField.h:339
DenseField::const_iterator::const_iterator
const_iterator(const class_type &field, const Box3i &window, const V3i &currentPos)
Definition DenseField.h:275
DenseField::const_iterator::m_field
const class_type & m_field
Reference to field being iterated over.
Definition DenseField.h:343
DenseField::const_iterator::m_window
Box3i m_window
Window to traverse.
Definition DenseField.h:341
DenseField::const_iterator::class_type
DenseField< Data_T > class_type
Definition DenseField.h:271
DenseField::const_iterator::y
int y
Definition DenseField.h:332
DenseField::const_iterator::z
int z
Definition DenseField.h:332
DenseField::iterator
Definition DenseField.h:353
DenseField::iterator::x
int x
Current position.
Definition DenseField.h:427
DenseField::iterator::m_p
Data_T * m_p
Pointer to current element.
Definition DenseField.h:434
DenseField::iterator::y
int y
Definition DenseField.h:427
DenseField::iterator::z
int z
Definition DenseField.h:427
DenseField::iterator::class_type
DenseField< Data_T > class_type
Definition DenseField.h:366
DenseField::iterator::m_field
class_type & m_field
Reference to field being iterated over.
Definition DenseField.h:438
DenseField::iterator::iterator
iterator(class_type &field, const Box3i &window, const V3i &currentPos)
Definition DenseField.h:370
DenseField::iterator::m_window
Box3i m_window
Window to traverse.
Definition DenseField.h:436
DenseField
This subclass of Field stores data in a contiguous std::vector.
Definition DenseField.h:87
DenseField::memSize
virtual long long int memSize() const
Returns the memory usage (in bytes).
Definition DenseField.h:501
DenseField::end
iterator end()
Iterator pointing one element past the last valid one.
Definition DenseField.h:623
DenseField::fastValue
const Data_T & fastValue(int i, int j, int k) const
Read access to voxel. Notice that this is non-virtual.
Definition DenseField.h:519
DenseField::begin
iterator begin(const Box3i &subset)
Iterator to first element of specific subset.
Definition DenseField.h:612
DenseField< half >::m_data
std::vector< half > m_data
Definition DenseField.h:224
DenseField::lvalue
virtual Data_T & lvalue(int i, int j, int k)
Write access to a voxel. The coordinates are global coordinates.
Definition DenseField.h:511
DenseField::fastLValue
Data_T & fastLValue(int i, int j, int k)
Write access to voxel. Notice that this is non-virtual.
Definition DenseField.h:538
DenseField::end
iterator end(const Box3i &subset)
Iterator pointing one element past the last valid one (for a subset).
Definition DenseField.h:635
DenseField< half >::m_memSizeXY
size_t m_memSizeXY
Definition DenseField.h:222
DenseField::CubicInterp
CubicGenericFieldInterp< DenseField< Data_T > > CubicInterp
Definition DenseField.h:96
DenseField::DenseField
DenseField()
Constructs an empty buffer.
Definition DenseField.h:446
DenseField::clear
virtual void clear(const Data_T &value)
Clears all the voxels in the storage.
Definition DenseField.h:456
DenseField::LinearInterp
LinearGenericFieldInterp< DenseField< Data_T > > LinearInterp
Definition DenseField.h:95
DenseField< half >::FIELD3D_CLASSNAME_CLASSTYPE_IMPLEMENTATION
FIELD3D_CLASSNAME_CLASSTYPE_IMPLEMENTATION
Definition DenseField.h:204
DenseField::cbegin
const_iterator cbegin() const
Const iterator to first element. "cbegin" matches the tr1 c++ standard.
Definition DenseField.h:558
DenseField::cend
const_iterator cend() const
Const iterator pointing one element past the last valid one.
Definition DenseField.h:580
DenseField::internalMemSize
const FIELD3D_VEC3_T< size_t > & internalMemSize() const
Returns the internal memory size in each dimension. This is used for example in LinearInterpolator,...
Definition DenseField.h:196
DenseField::clone
virtual FieldBase::Ptr clone() const
Returns a pointer to a copy of the field, pure virtual so ensure derived classes properly implement i...
Definition DenseField.h:206
DenseField::cbegin
const_iterator cbegin(const Box3i &subset) const
Const iterator to first element of specific subset.
Definition DenseField.h:569
DenseField::begin
iterator begin()
Iterator to first element.
Definition DenseField.h:602
DenseField::cend
const_iterator cend(const Box3i &subset) const
Const iterator pointing one element past the last valid one (for a subset).
Definition DenseField.h:592
DenseField::getGrainBounds
bool getGrainBounds(const size_t idx, Box3i &vsBounds) const
Bounding box of the given 'grain'.
Definition DenseField.h:475
DenseField::sizeChanged
virtual void sizeChanged()
Subclasses should re-implement this if they need to perform memory allocations, etc....
Definition DenseField.h:644
DenseField::ptr
Data_T * ptr(int i, int j, int k)
Returns a pointer to a given element. Used by the iterators mainly.
Definition DenseField.h:678
DenseField::staticClassName
static DEFINE_FIELD_RTTI_CONCRETE_CLASS const char * staticClassName()
Definition DenseField.h:135
DenseField::ms_classType
static TemplatedFieldType< DenseField< Data_T > > ms_classType
Definition DenseField.h:230
DenseField::class_type
DenseField< Data_T > class_type
Definition DenseField.h:132
DenseField::numGrains
size_t numGrains() const
Number of 'grains' to use with threaded access.
Definition DenseField.h:464
DenseField< half >::m_memSize
FIELD3D_VEC3_T< size_t > m_memSize
Definition DenseField.h:220
DenseField::staticClassType
static const char * staticClassType()
Definition DenseField.h:140
DenseField::base
ResizableField< Data_T > base
Definition DenseField.h:98
DenseField::ptr
const Data_T * ptr(int i, int j, int k) const
Returns a pointer to a given element. Used by the iterators mainly.
Definition DenseField.h:691
DenseField::Vec
std::vector< Ptr > Vec
Definition DenseField.h:93
DenseField< half >::value
virtual half value(int i, int j, int k) const
DenseField::Ptr
boost::intrusive_ptr< DenseField > Ptr
Definition DenseField.h:92
FieldBase::Ptr
boost::intrusive_ptr< FieldBase > Ptr
Definition Field.h:97
FieldRes::dataResolution
V3i const dataResolution() const
Definition Field.h:256
FieldRes::m_dataWindow
Box3i m_dataWindow
Defines the area where data is allocated. This should be treated as a closed (i.e....
Definition Field.h:310
FieldRes::memSize
virtual long long int memSize() const
Returns the memory usage (in bytes).
Definition Field.h:279
Field::value_type
Data_T value_type
Allows us to reference the template class.
Definition Field.h:398
LinearGenericFieldInterp
Definition FieldInterp.h:254
ResizableField
Definition Field.h:835
ResizableField::sizeChanged
virtual void sizeChanged()
Subclasses should re-implement this if they need to perform memory allocations, etc....
Definition Field.h:901
FIELD3D_NAMESPACE_OPEN
Definition FieldMapping.cpp:74
ns.h
FIELD3D_NAMESPACE_HEADER_CLOSE
#define FIELD3D_NAMESPACE_HEADER_CLOSE
Definition ns.h:58
TemplatedFieldType
Used to return a string for the name of a templated field.
Definition Traits.h:283