Field3D
MIPField< Field_T > Class Template Reference

This subclass stores a MIP representation of a Field_T field. More...

#include <MIPField.h>

Inheritance diagram for MIPField< Field_T >:
MIPBase< Field_T::value_type > Field< Field_T::value_type > FieldRes FieldBase RefBase MetadataCallback

Public Types

typedef MIPField< Field_T > class_type
 
typedef CubicMIPFieldInterp< Data_TCubicInterp
 
typedef Field_T::value_type Data_T
 
typedef Field_T::Ptr FieldPtr
 
typedef std::vector< FieldPtrFieldVec
 
typedef MIPLinearInterp< MIPField< Field_T > > LinearInterp
 
typedef Field_T NestedType
 
typedef EmptyField< Data_TProxyField
 
typedef ProxyField::Ptr ProxyPtr
 
typedef std::vector< ProxyPtrProxyVec
 
typedef boost::intrusive_ptr< MIPFieldPtr
 
typedef Data_T value_type
 
typedef std::vector< PtrVec
 
- Public Types inherited from MIPBase< Field_T::value_type >
typedef MIPBase< Field_T::value_typeclass_type
 
typedef boost::intrusive_ptr< MIPBasePtr
 
- Public Types inherited from Field< Field_T::value_type >
typedef Field< Field_T::value_typeclass_type
 
typedef boost::intrusive_ptr< FieldPtr
 
typedef Field_T::value_type value_type
 Allows us to reference the template class. More...
 
typedef std::vector< PtrVec
 This is a convenience typedef for the list that Field3DInputFile::readScalarLayers() and Field3DInputFile::readVectorLayers() will return its data in. More...
 
- Public Types inherited from FieldRes
typedef FieldRes class_type
 
typedef boost::intrusive_ptr< FieldResPtr
 
typedef std::vector< PtrVec
 
- Public Types inherited from FieldBase
typedef FieldBase class_type
 
typedef boost::intrusive_ptr< FieldBasePtr
 
- Public Types inherited from RefBase
typedef boost::intrusive_ptr< RefBasePtr
 
typedef boost::weak_ptr< RefBaseWeakPtr
 

Public Member Functions

void clear ()
 Clears all the levels of the MIP field. More...
 
Field_T::Ptr concreteMipLevel (const size_t level) const
 Returns a concretely typed pointer to a MIP level. More...
 
Data_T fastMipValue (size_t level, int i, int j, int k) const
 Read access to voxel at a given MIP level. More...
 
virtual void getVsMIPCoord (const V3f &vsP, const size_t level, V3f &outVsP) const
 Given a voxel space coordinate in the 0-level field, computes the coordinate in another level. More...
 
virtual bool levelLoaded (const size_t level) const
 Whether a given MIP level is loaded. More...
 
virtual Field< Data_T >::Ptr mipLevel (const size_t level) const
 Returns a MIP level field. More...
 
virtual V3i mipResolution (size_t level) const
 Returns the resolution of a given MIP level. More...
 
virtual Data_T mipValue (size_t level, int i, int j, int k) const
 Read access to a voxel in a given MIP level. More...
 
const Field_T * rawMipLevel (const size_t level) const
 Returns a raw pointer to a MIP level. More...
 
void setup (const FieldVec &fields)
 Sets up the MIP field given a set of non-MIP fields This call performs sanity checking to ensure that MIP properties are satisfied for each level. In this case, all MIP levels are available in memory. More...
 
void setupLazyLoad (const ProxyVec &proxies, const typename LazyLoadAction< Field_T >::Vec &actions)
 Sets up the MIP field in lazy-load mode. More...
 
Constructors & destructor
 MIPField ()
 Constructs an empty MIP field. More...
 
 MIPField (const MIPField &other)
 Copy constructor. We need this because a) we own a mutex and b) we own shared pointers and shallow copies are not good enough. More...
 
const MIPFieldoperator= (const MIPField &rhs)
 Assignment operator. More...
 
From FieldRes

Returns -current- memory use, rather than the amount used if all levels were loaded.

virtual long long int memSize () const
 Returns the memory usage (in bytes) More...
 
virtual void mappingChanged ()
 We need to know if the mapping changed so that we may update the MIP levels' mappings. More...
 
From Field

For a MIP field, the common value() call accesses data at level 0 only.

virtual Data_T value (int i, int j, int k) const
 Read access to a voxel. The coordinates are in integer voxel space . More...
 
virtual size_t voxelCount () const
 Counts the number of voxels. For most fields, this is just the volume of the data window, but sparse data structures can override this to return a better value. More...
 
- Public Member Functions inherited from MIPBase< Field_T::value_type >
size_t lowestLevel () const
 Lowest MIP level to use. More...
 
 MIPBase ()
 
const V3imipOffset () const
 Returns the base MIP offset. More...
 
size_t numLevels () const
 Number of MIP levels. More...
 
void setLowestLevel (size_t level)
 Sets the lowest MIP level to use. Defaults to zero, but can be set higher to prevent high resolution levels from being accessed. More...
 
void setMIPOffset (const V3i &offset)
 Sets the base MIP offset. This is used to indicate where voxel space coordinate (0, 0, 0) really maps to. More...
 
- Public Member Functions inherited from Field< Field_T::value_type >
const_iterator cbegin () const
 Const iterator to first element. "cbegin" matches the tr1 c++ standard. More...
 
const_iterator cbegin (const Box3i &subset) const
 Const iterator to first element of specific subset. More...
 
const_iterator cend () const
 Const iterator pointing one element past the last valid one. More...
 
const_iterator cend (const Box3i &subset) const
 Const iterator pointing one element past the last valid one (for a subset) More...
 
virtual std::string dataTypeString () const
 
virtual ~Field ()
 Dtor. More...
 
- Public Member Functions inherited from FieldRes
V3i const dataResolution () const
 
const Box3idataWindow () const
 Returns the data window. Any coordinate inside this window is safe to pass to value() in the Field subclass. More...
 
const Box3iextents () const
 Returns the extents of the data. This signifies the relevant area that the data exists over. However, the data window (below) may be smaller than the extents, in which case it is only safe to call value() for those coordinate inside the data window. More...
 
 FieldRes ()
 This constructor ensures that we have a valid mapping at all times. More...
 
 FieldRes (const FieldRes &src)
 Base class copy constructor. More...
 
bool isInBounds (int i, int j, int k) const
 Returns true is the indicies are in bounds of the data window. More...
 
FieldMapping::Ptr mapping ()
 Returns a pointer to the mapping. More...
 
const FieldMapping::Ptr mapping () const
 Returns a pointer to the mapping. More...
 
void setMapping (FieldMapping::Ptr mapping)
 Sets the field's mapping. More...
 
- Public Member Functions inherited from FieldBase
 FieldBase ()
 Constructor. More...
 
 FieldBase (const FieldBase &)
 Copy Constructor. More...
 
virtual ~FieldBase ()
 Destructor. More...
 
virtual std::string className () const =0
 Returns the class name of the object. Used by the class pool and when writing the data to disk. More...
 
virtual std::string classType () const =0
 Returns the full class type string. More...
 
FieldMetadatametadata ()
 accessor to the m_metadata class More...
 
const FieldMetadatametadata () const
 Read only access to the m_metadata class. More...
 
void copyMetadata (const FieldBase &field)
 Copies the metadata from a second field. More...
 
- Public Member Functions inherited from RefBase
void ref () const
 Used by boost::intrusive_pointer. More...
 
size_t refcnt ()
 Used by boost::intrusive_pointer. More...
 
void unref () const
 Used by boost::intrusive_pointer. More...
 
WeakPtr weakPtr () const
 
 RefBase ()
 
 RefBase (const RefBase &)
 Copy constructor. More...
 
RefBaseoperator= (const RefBase &)
 Assignment operator. More...
 
virtual ~RefBase ()
 Destructor. More...
 
virtual bool checkRTTI (const char *typenameStr)=0
 This function is only implemented by concrete classes and triggers the actual RTTI check through matchRTTI();. More...
 
bool matchRTTI (const char *typenameStr)
 Performs a check to see if the given typename string matches this class' This needs to be implemented in -all- subclasses, even abstract ones. More...
 
- Public Member Functions inherited from MetadataCallback
virtual void metadataHasChanged (const std::string &)
 Alerts the callback holder that the metadata has changed. More...
 

Static Public Member Functions

static DEFINE_FIELD_RTTI_CONCRETE_CLASS const char * staticClassName ()
 
static const char * staticClassType ()
 
- Static Public Member Functions inherited from MIPBase< Field_T::value_type >
static const char * staticClassName ()
 
static const char * staticClassType ()
 
- Static Public Member Functions inherited from Field< Field_T::value_type >
static const char * staticClassName ()
 
static const char * staticClassType ()
 
- Static Public Member Functions inherited from FieldRes
static const char * staticClassName ()
 
static const char * staticClassType ()
 
- Static Public Member Functions inherited from FieldBase
static const char * staticClassName ()
 
static const char * staticClassType ()
 
- Static Public Member Functions inherited from RefBase
static const char * staticClassType ()
 

Protected Types

typedef MIPBase< Data_Tbase
 
- Protected Types inherited from MIPBase< Field_T::value_type >
typedef Field< Field_T::value_typebase
 
- Protected Types inherited from FieldRes
typedef MatrixFieldMapping default_mapping
 

Protected Member Functions

const MIPFieldinit (const MIPField &rhs)
 Copies from a second MIPField. More...
 
void loadLevelFromDisk (size_t level) const
 Loads the given level from disk. More...
 
template<typename T >
void sanityChecks (const T &fields)
 Sanity checks to ensure that the provided Fields are a MIP representation. More...
 
void syncLevelInfo (const size_t level) const
 Updates the name, attribute and metadata for a given level. More...
 
void updateAuxMembers () const
 Updates the dependent data members based on m_field. More...
 
void updateMapping (FieldRes::Ptr field)
 Updates the mapping, extents and data window to match the given field. Used so that the MIPField will appear to have the same mapping in space as the level-0 field. More...
 

Protected Attributes

std::vector< FieldPtrm_fields
 Storage of all MIP levels. Some or all of the pointers may be NULL. This is mutable because it needs updating during lazy loading of data. More...
 
boost::shared_ptr< boost::mutex > m_ioMutex
 Mutex lock around IO. Used to make sure only one thread reads MIP level data at a time. When a field is cloned, the two new fields will share the mutex, since they point to the same file. More...
 
LazyLoadAction< Field_T >::Vec m_loadActions
 Lazy load actions. Only used if setupLazyLoad() has been called. More...
 
std::vector< V3im_mipRes
 Resolution of each MIP level. More...
 
std::vector< Field_T * > m_rawFields
 Raw pointers to MIP levels. More...
 
std::vector< V3fm_relativeResolution
 Relative resolution of each MIP level. Pre-computed to avoid int-to-float conversions. More...
 
- Protected Attributes inherited from MIPBase< Field_T::value_type >
size_t m_lowestLevel
 The lowest MIP level to use. Defaults to 0, but can be set higher to prevent high resolution levels from being accessed. More...
 
V3i m_mipOffset
 Base coordinate offset. This is used to indicate where voxel space coordinate (0, 0, 0) really maps to. More...
 
size_t m_numLevels
 Number of MIP levels. The default is 1. More...
 
- Protected Attributes inherited from FieldRes
Box3i m_dataWindow
 Defines the area where data is allocated. This should be treated as a closed (i.e. inclusive) interval. More...
 
Box3i m_extents
 Defines the extents of the the storage. This may be larger or smaller than the data window, and in the case where it is larger, care must be taken not to access voxels outside the data window. This should be treated as a closed (i.e. inclusive) interval. More...
 
FieldMapping::Ptr m_mapping
 Pointer to the field's mapping. More...
 

Static Protected Attributes

static NestedFieldType< MIPField< Field_T > > ms_classType
 
- Static Protected Attributes inherited from MIPBase< Field_T::value_type >
static TemplatedFieldType< MIPBase< Field_T::value_type > > ms_classType
 

From FieldBase

 FIELD3D_CLASSNAME_CLASSTYPE_IMPLEMENTATION
 
virtual FieldBase::Ptr clone () const
 Returns a pointer to a copy of the field, pure virtual so ensure derived classes properly implement it. More...
 

Additional Inherited Members

- Public Attributes inherited from MIPBase< Field_T::value_type >
 DEFINE_FIELD_RTTI_ABSTRACT_CLASS
 
- Public Attributes inherited from Field< Field_T::value_type >
 DEFINE_FIELD_RTTI_ABSTRACT_CLASS
 
- Public Attributes inherited from FieldRes
 DEFINE_FIELD_RTTI_ABSTRACT_CLASS
 
- Public Attributes inherited from FieldBase
std::string attribute
 Optional name of the attribute the field represents. More...
 
std::string name
 Optional name of the field. More...
 

Detailed Description

template<class Field_T>
class MIPField< Field_T >

This subclass stores a MIP representation of a Field_T field.

Each level in the MIPField is stored as a SparseField, and each level shares the same FieldMapping definition, even though their resolution is different.

The class is lazy loading, such that no MIP levels are read from disk until they are needed. On top of this, standard SparseField caching (memory limiting) is available, and operates the same as normal SparseFields.

The class is thread safe, and ensures that data is read from disk from in one single thread, using the double-checked locking mechanism.

Interpolation into a MIP field may be done either directly to a single level, or by blending between two MIP levels. When blending, each field is assumed to match the other levels only in local-space.

Definition at line 109 of file MIPField.h.

Member Typedef Documentation

template<class Field_T>
typedef Field_T::value_type MIPField< Field_T >::Data_T

Definition at line 115 of file MIPField.h.

template<class Field_T>
typedef Field_T MIPField< Field_T >::NestedType

Definition at line 116 of file MIPField.h.

template<class Field_T>
typedef boost::intrusive_ptr<MIPField> MIPField< Field_T >::Ptr

Definition at line 118 of file MIPField.h.

template<class Field_T>
typedef std::vector<Ptr> MIPField< Field_T >::Vec

Definition at line 119 of file MIPField.h.

template<class Field_T>
typedef MIPLinearInterp<MIPField<Field_T> > MIPField< Field_T >::LinearInterp

Definition at line 121 of file MIPField.h.

template<class Field_T>
typedef CubicMIPFieldInterp<Data_T> MIPField< Field_T >::CubicInterp

Definition at line 122 of file MIPField.h.

template<class Field_T>
typedef Data_T MIPField< Field_T >::value_type

Definition at line 124 of file MIPField.h.

template<class Field_T>
typedef EmptyField<Data_T> MIPField< Field_T >::ProxyField

Definition at line 126 of file MIPField.h.

template<class Field_T>
typedef ProxyField::Ptr MIPField< Field_T >::ProxyPtr

Definition at line 127 of file MIPField.h.

template<class Field_T>
typedef std::vector<ProxyPtr> MIPField< Field_T >::ProxyVec

Definition at line 128 of file MIPField.h.

template<class Field_T>
typedef Field_T::Ptr MIPField< Field_T >::FieldPtr

Definition at line 130 of file MIPField.h.

template<class Field_T>
typedef std::vector<FieldPtr> MIPField< Field_T >::FieldVec

Definition at line 131 of file MIPField.h.

template<class Field_T>
typedef MIPField<Field_T> MIPField< Field_T >::class_type

Definition at line 173 of file MIPField.h.

template<class Field_T>
typedef MIPBase<Data_T> MIPField< Field_T >::base
protected

Definition at line 242 of file MIPField.h.

Constructor & Destructor Documentation

template<class Field_T >
MIPField< Field_T >::MIPField ( )

Constructs an empty MIP field.

Definition at line 324 of file MIPField.h.

References MIPField< Field_T >::m_fields, and MIPBase< Data_T >::m_numLevels.

325  : base(),
326  m_ioMutex(new boost::mutex)
327 {
328  m_fields.resize(base::m_numLevels);
329 }
boost::shared_ptr< boost::mutex > m_ioMutex
Mutex lock around IO. Used to make sure only one thread reads MIP level data at a time...
Definition: MIPField.h:271
size_t m_numLevels
Number of MIP levels. The default is 1.
Definition: MIPBase.h:196
MIPBase< Data_T > base
Definition: MIPField.h:242
std::vector< FieldPtr > m_fields
Storage of all MIP levels. Some or all of the pointers may be NULL. This is mutable because it needs ...
Definition: MIPField.h:256
template<class Field_T >
MIPField< Field_T >::MIPField ( const MIPField< Field_T > &  other)

Copy constructor. We need this because a) we own a mutex and b) we own shared pointers and shallow copies are not good enough.

Definition at line 334 of file MIPField.h.

References MIPField< Field_T >::init().

335  : base(other)
336 {
337  init(other);
338 }
const MIPField & init(const MIPField &rhs)
Copies from a second MIPField.
Definition: MIPField.h:354
MIPBase< Data_T > base
Definition: MIPField.h:242

Member Function Documentation

template<class Field_T >
const MIPField< Field_T > & MIPField< Field_T >::operator= ( const MIPField< Field_T > &  rhs)

Assignment operator.

Definition at line 344 of file MIPField.h.

References MIPField< Field_T >::init(), and RefBase::operator=().

345 {
346  base::operator=(rhs);
347  return init(rhs);
348 }
RefBase & operator=(const RefBase &)
Assignment operator.
Definition: RefCount.h:134
const MIPField & init(const MIPField &rhs)
Copies from a second MIPField.
Definition: MIPField.h:354
template<class Field_T >
long long int MIPField< Field_T >::memSize ( ) const
virtual

Returns the memory usage (in bytes)

Note
This needs to be re-implemented for any subclass that adds data members. Those classes should also call their superclass and add the combined memory use.

Reimplemented from FieldRes.

Definition at line 534 of file MIPField.h.

References MIPField< Field_T >::m_fields.

535 {
536  long long int mem = 0;
537  for (size_t i = 0; i < m_fields.size(); i++) {
538  if (m_fields[i]) {
539  mem += m_fields[i]->memSize();
540  }
541  }
542  return mem + sizeof(*this);
543 }
std::vector< FieldPtr > m_fields
Storage of all MIP levels. Some or all of the pointers may be NULL. This is mutable because it needs ...
Definition: MIPField.h:256
template<class Field_T >
void MIPField< Field_T >::mappingChanged ( )
virtual

We need to know if the mapping changed so that we may update the MIP levels' mappings.

Reimplemented from FieldRes.

Definition at line 548 of file MIPField.h.

References detail::adjustedMIPFieldMapping(), FieldRes::dataWindow(), FieldRes::extents(), detail::k_mipOffsetStr, MIPField< Field_T >::m_fields, FieldRes::mapping(), FieldBase::metadata(), MIPBase< Data_T >::setMIPOffset(), and FieldMetadata::vecIntMetadata().

549 {
550  // Update MIP offset
551  const V3i offset =
553  base::setMIPOffset(offset);
554 
555  V3i baseRes = base::dataWindow().size() + V3i(1);
556  if (m_fields[0]) {
557  m_fields[0]->setMapping(base::mapping());
558  }
559  for (size_t i = 1; i < m_fields.size(); i++) {
560  if (m_fields[i]) {
562  detail::adjustedMIPFieldMapping(this, baseRes,
563  m_fields[i]->extents(), i);
564  m_fields[i]->setMapping(mapping);
565  }
566  }
567 }
const Box3i & extents() const
Returns the extents of the data. This signifies the relevant area that the data exists over...
Definition: Field.h:249
V3i vecIntMetadata(const std::string &name, const V3i &defaultVal) const
Tries to retrieve a V3i metadata value. Returns the specified default value if no metadata was found...
Imath::V3i V3i
Definition: SpiMathLib.h:71
boost::intrusive_ptr< FieldMapping > Ptr
Definition: FieldMapping.h:92
FIELD3D_API FieldMapping::Ptr adjustedMIPFieldMapping(const FieldRes *base, const V3i &baseRes, const Box3i &extents, const size_t level)
Definition: MIPUtil.cpp:82
FieldMetadata & metadata()
accessor to the m_metadata class
Definition: Field.h:155
std::vector< FieldPtr > m_fields
Storage of all MIP levels. Some or all of the pointers may be NULL. This is mutable because it needs ...
Definition: MIPField.h:256
const std::string k_mipOffsetStr
Definition: MIPUtil.cpp:66
const Box3i & dataWindow() const
Returns the data window. Any coordinate inside this window is safe to pass to value() in the Field su...
Definition: Field.h:253
void setMIPOffset(const V3i &offset)
Sets the base MIP offset. This is used to indicate where voxel space coordinate (0, 0, 0) really maps to.
Definition: MIPBase.h:230
FieldMapping::Ptr mapping()
Returns a pointer to the mapping.
Definition: Field.h:263
template<class Field_T >
MIPField< Field_T >::Data_T MIPField< Field_T >::value ( int  i,
int  j,
int  k 
) const
virtual

Read access to a voxel. The coordinates are in integer voxel space .

Note
Before the internal storage is accessed, the subclass must compute the data window coordinates by looking at Field::m_dataWindow.
Virtual functions are known not to play nice with threading. Therefor, concrete classes can implement (by convention) fastValue() as a non-virtual function.

Implements Field< Field_T::value_type >.

Definition at line 511 of file MIPField.h.

References MIPField< Field_T >::fastMipValue().

512 {
513  return fastMipValue(0, i, j, k);
514 }
Data_T fastMipValue(size_t level, int i, int j, int k) const
Read access to voxel at a given MIP level.
Definition: MIPField.h:636
template<class Field_T >
size_t MIPField< Field_T >::voxelCount ( ) const
virtual

Counts the number of voxels. For most fields, this is just the volume of the data window, but sparse data structures can override this to return a better value.

Reimplemented from FieldRes.

Definition at line 520 of file MIPField.h.

References MIPField< Field_T >::m_fields.

521 {
522  size_t count = 0;
523  for (size_t i = 0; i < m_fields.size(); i++) {
524  if (m_fields[i]) {
525  count += m_fields[i]->voxelCount();
526  }
527  }
528  return count;
529 }
std::vector< FieldPtr > m_fields
Storage of all MIP levels. Some or all of the pointers may be NULL. This is mutable because it needs ...
Definition: MIPField.h:256
template<class Field_T>
static DEFINE_FIELD_RTTI_CONCRETE_CLASS const char* MIPField< Field_T >::staticClassName ( )
inlinestatic

Definition at line 176 of file MIPField.h.

177  {
178  return "MIPField";
179  }
template<class Field_T>
static const char* MIPField< Field_T >::staticClassType ( )
inlinestatic

Definition at line 181 of file MIPField.h.

182  {
184  }
This subclass stores a MIP representation of a Field_T field.
Definition: MIPField.h:109
std::string name
Optional name of the field.
Definition: Field.h:171
template<class Field_T >
MIPField< Field_T >::Data_T MIPField< Field_T >::mipValue ( size_t  level,
int  i,
int  j,
int  k 
) const
virtual

Read access to a voxel in a given MIP level.

Parameters
levelThe MIP level to read from

Implements MIPBase< Field_T::value_type >.

Definition at line 573 of file MIPField.h.

References MIPField< Field_T >::fastMipValue().

574 {
575  return fastMipValue(level, i, j, k);
576 }
Data_T fastMipValue(size_t level, int i, int j, int k) const
Read access to voxel at a given MIP level.
Definition: MIPField.h:636
template<class Field_T >
V3i MIPField< Field_T >::mipResolution ( size_t  level) const
virtual

Returns the resolution of a given MIP level.

Implements MIPBase< Field_T::value_type >.

Definition at line 581 of file MIPField.h.

References MIPField< Field_T >::m_mipRes, and MIPBase< Data_T >::m_numLevels.

582 {
583  assert(level < base::m_numLevels);
584  return m_mipRes[level];
585 }
std::vector< V3i > m_mipRes
Resolution of each MIP level.
Definition: MIPField.h:264
size_t m_numLevels
Number of MIP levels. The default is 1.
Definition: MIPBase.h:196
template<class Field_T >
bool MIPField< Field_T >::levelLoaded ( const size_t  level) const
virtual

Whether a given MIP level is loaded.

Implements MIPBase< Field_T::value_type >.

Definition at line 590 of file MIPField.h.

References MIPBase< Data_T >::m_numLevels, and MIPField< Field_T >::m_rawFields.

591 {
592  assert(level < base::m_numLevels);
593  return m_rawFields[level] != NULL;
594 }
std::vector< Field_T * > m_rawFields
Raw pointers to MIP levels.
Definition: MIPField.h:262
size_t m_numLevels
Number of MIP levels. The default is 1.
Definition: MIPBase.h:196
template<typename Field_T >
void MIPField< Field_T >::getVsMIPCoord ( const V3f vsP,
const size_t  level,
V3f outVsP 
) const
virtual

Given a voxel space coordinate in the 0-level field, computes the coordinate in another level.

Implements MIPBase< Field_T::value_type >.

Definition at line 599 of file MIPField.h.

References MIPBase< Data_T >::mipOffset().

601 {
602  const V3i &mipOff = base::mipOffset();
603 
604  // Compute offset of current level
605  const V3i offset((mipOff.x >> level) << level,
606  (mipOff.y >> level) << level,
607  (mipOff.z >> level) << level);
608 
609  // Difference between current offset and base offset is num voxels
610  // to offset current level by
611  const V3f diff = offset - mipOff;
612 
613  // Incorporate shift due to mip offset
614  outVsP = (vsP - diff) * pow(2.0, -static_cast<float>(level));
615 }
Imath::V3i V3i
Definition: SpiMathLib.h:71
const V3i & mipOffset() const
Returns the base MIP offset.
Definition: MIPBase.h:180
Imath::V3f V3f
Definition: SpiMathLib.h:73
template<typename Field_T >
Field< typename MIPField< Field_T >::Data_T >::Ptr MIPField< Field_T >::mipLevel ( const size_t  level) const
virtual

Returns a MIP level field.

Implements MIPBase< Field_T::value_type >.

Definition at line 621 of file MIPField.h.

References MIPField< Field_T >::loadLevelFromDisk(), MIPField< Field_T >::m_fields, MIPBase< Data_T >::m_numLevels, and MIPField< Field_T >::m_rawFields.

Referenced by MIPField< Field_T >::setupLazyLoad().

622 {
623  assert(level < base::m_numLevels);
624  // Ensure level is loaded.
625  if (!m_rawFields[level]) {
626  loadLevelFromDisk(level);
627  }
628  // Return
629  return m_fields[level];
630 }
std::vector< Field_T * > m_rawFields
Raw pointers to MIP levels.
Definition: MIPField.h:262
size_t m_numLevels
Number of MIP levels. The default is 1.
Definition: MIPBase.h:196
void loadLevelFromDisk(size_t level) const
Loads the given level from disk.
Definition: MIPField.h:685
std::vector< FieldPtr > m_fields
Storage of all MIP levels. Some or all of the pointers may be NULL. This is mutable because it needs ...
Definition: MIPField.h:256
template<class Field_T >
MIPField< Field_T >::Data_T MIPField< Field_T >::fastMipValue ( size_t  level,
int  i,
int  j,
int  k 
) const

Read access to voxel at a given MIP level.

Definition at line 636 of file MIPField.h.

References MIPField< Field_T >::loadLevelFromDisk(), MIPBase< Data_T >::m_numLevels, and MIPField< Field_T >::m_rawFields.

Referenced by MIPField< Field_T >::mipValue(), and MIPField< Field_T >::value().

637 {
638  assert(level < base::m_numLevels);
639  // Ensure level is loaded.
640  if (!m_rawFields[level]) {
641  loadLevelFromDisk(level);
642  }
643  // Read from given level
644  return m_rawFields[level]->fastValue(i, j, k);
645 }
std::vector< Field_T * > m_rawFields
Raw pointers to MIP levels.
Definition: MIPField.h:262
size_t m_numLevels
Number of MIP levels. The default is 1.
Definition: MIPBase.h:196
void loadLevelFromDisk(size_t level) const
Loads the given level from disk.
Definition: MIPField.h:685
template<class Field_T>
virtual FieldBase::Ptr MIPField< Field_T >::clone ( ) const
inlinevirtual

Returns a pointer to a copy of the field, pure virtual so ensure derived classes properly implement it.

Implements FieldBase.

Reimplemented in MIPDenseField< Data_T >, and MIPSparseField< Data_T >.

Definition at line 207 of file MIPField.h.

Referenced by MIPField< Field_T >::init().

208  {
209  return Ptr(new MIPField(*this));
210  }
boost::intrusive_ptr< MIPField > Ptr
Definition: MIPField.h:118
MIPField()
Constructs an empty MIP field.
Definition: MIPField.h:324
template<class Field_T >
void MIPField< Field_T >::clear ( )

Clears all the levels of the MIP field.

Definition at line 389 of file MIPField.h.

References MIPField< Field_T >::m_fields, MIPBase< Data_T >::m_lowestLevel, MIPBase< Data_T >::m_numLevels, and MIPField< Field_T >::m_rawFields.

Referenced by MIPField< Field_T >::setup(), and MIPField< Field_T >::setupLazyLoad().

390 {
391  m_fields.clear();
392  m_rawFields.clear();
393  base::m_numLevels = 0;
395 }
std::vector< Field_T * > m_rawFields
Raw pointers to MIP levels.
Definition: MIPField.h:262
size_t m_lowestLevel
The lowest MIP level to use. Defaults to 0, but can be set higher to prevent high resolution levels f...
Definition: MIPBase.h:199
size_t m_numLevels
Number of MIP levels. The default is 1.
Definition: MIPBase.h:196
std::vector< FieldPtr > m_fields
Storage of all MIP levels. Some or all of the pointers may be NULL. This is mutable because it needs ...
Definition: MIPField.h:256
template<class Field_T >
void MIPField< Field_T >::setup ( const FieldVec fields)

Sets up the MIP field given a set of non-MIP fields This call performs sanity checking to ensure that MIP properties are satisfied for each level. In this case, all MIP levels are available in memory.

Note
The MIP level order is implied to be zero-first.

Definition at line 400 of file MIPField.h.

References MIPField< Field_T >::clear(), MIPField< Field_T >::m_fields, MIPBase< Data_T >::m_lowestLevel, MIPField< Field_T >::m_mipRes, MIPBase< Data_T >::m_numLevels, MIPField< Field_T >::m_relativeResolution, MIPField< Field_T >::sanityChecks(), MIPField< Field_T >::setupLazyLoad(), MIPField< Field_T >::updateAuxMembers(), and MIPField< Field_T >::updateMapping().

401 {
402  // Clear existing data
403  clear();
404  // Run sanity checks. This will throw an exception if the fields are invalid.
405  sanityChecks(fields);
406  // Update state of object
407  m_fields = fields;
408  base::m_numLevels = fields.size();
410  updateMapping(fields[0]);
412  // Resize vectors
413  m_mipRes.resize(base::m_numLevels);
415  // For each MIP level
416  for (size_t i = 0; i < fields.size(); i++) {
417  // Update MIP res from real fields
418  m_mipRes[i] = m_fields[i]->extents().size() + V3i(1);
419  // Update relative resolutions
421  }
422 }
void clear()
Clears all the levels of the MIP field.
Definition: MIPField.h:389
Imath::V3i V3i
Definition: SpiMathLib.h:71
size_t m_lowestLevel
The lowest MIP level to use. Defaults to 0, but can be set higher to prevent high resolution levels f...
Definition: MIPBase.h:199
void updateAuxMembers() const
Updates the dependent data members based on m_field.
Definition: MIPField.h:650
std::vector< V3i > m_mipRes
Resolution of each MIP level.
Definition: MIPField.h:264
Imath::V3f V3f
Definition: SpiMathLib.h:73
void sanityChecks(const T &fields)
Sanity checks to ensure that the provided Fields are a MIP representation.
Definition: MIPField.h:719
void updateMapping(FieldRes::Ptr field)
Updates the mapping, extents and data window to match the given field. Used so that the MIPField will...
Definition: MIPField.h:675
size_t m_numLevels
Number of MIP levels. The default is 1.
Definition: MIPBase.h:196
std::vector< V3f > m_relativeResolution
Relative resolution of each MIP level. Pre-computed to avoid int-to-float conversions.
Definition: MIPField.h:267
std::vector< FieldPtr > m_fields
Storage of all MIP levels. Some or all of the pointers may be NULL. This is mutable because it needs ...
Definition: MIPField.h:256
template<class Field_T>
void MIPField< Field_T >::setupLazyLoad ( const ProxyVec proxies,
const typename LazyLoadAction< Field_T >::Vec actions 
)

Sets up the MIP field in lazy-load mode.

Parameters
mipGroupPathPath in F3D file to read data from.

Definition at line 428 of file MIPField.h.

References MIPField< Field_T >::clear(), MIPField< Field_T >::loadLevelFromDisk(), MIPField< Field_T >::m_fields, MIPField< Field_T >::m_loadActions, MIPBase< Data_T >::m_lowestLevel, MIPField< Field_T >::m_mipRes, MIPBase< Data_T >::m_numLevels, MIPField< Field_T >::m_rawFields, MIPField< Field_T >::m_relativeResolution, MIPField< Field_T >::mipLevel(), MIPField< Field_T >::sanityChecks(), MIPField< Field_T >::updateAuxMembers(), and MIPField< Field_T >::updateMapping().

Referenced by MIPField< Field_T >::setup().

430 {
431  using namespace Exc;
432 
433  // Clear existing data
434  clear();
435  // Check same number of proxies and actions
436  if (proxies.size() != actions.size()) {
437  throw MIPFieldException("Incorrect number of lazy load actions");
438  }
439  // Run sanity checks. This will throw an exception if the fields are invalid.
440  sanityChecks(proxies);
441  // Store the lazy load actions
442  m_loadActions = actions;
443  // Update state of object
444  base::m_numLevels = proxies.size();
446  m_fields.resize(base::m_numLevels);
447  updateMapping(proxies[0]);
449  // Resize vectors
450  m_mipRes.resize(base::m_numLevels);
452  for (size_t i = 0; i < proxies.size(); i++) {
453  // Update mip res from proxy fields
454  m_mipRes[i] = proxies[i]->extents().size() + V3i(1);
455  // Update relative resolutions
457  }
458 }
Namespace for Exception objects.
Definition: Exception.h:57
LazyLoadAction< Field_T >::Vec m_loadActions
Lazy load actions. Only used if setupLazyLoad() has been called.
Definition: MIPField.h:258
void clear()
Clears all the levels of the MIP field.
Definition: MIPField.h:389
Imath::V3i V3i
Definition: SpiMathLib.h:71
size_t m_lowestLevel
The lowest MIP level to use. Defaults to 0, but can be set higher to prevent high resolution levels f...
Definition: MIPBase.h:199
void updateAuxMembers() const
Updates the dependent data members based on m_field.
Definition: MIPField.h:650
std::vector< V3i > m_mipRes
Resolution of each MIP level.
Definition: MIPField.h:264
Imath::V3f V3f
Definition: SpiMathLib.h:73
void sanityChecks(const T &fields)
Sanity checks to ensure that the provided Fields are a MIP representation.
Definition: MIPField.h:719
void updateMapping(FieldRes::Ptr field)
Updates the mapping, extents and data window to match the given field. Used so that the MIPField will...
Definition: MIPField.h:675
size_t m_numLevels
Number of MIP levels. The default is 1.
Definition: MIPBase.h:196
std::vector< V3f > m_relativeResolution
Relative resolution of each MIP level. Pre-computed to avoid int-to-float conversions.
Definition: MIPField.h:267
std::vector< FieldPtr > m_fields
Storage of all MIP levels. Some or all of the pointers may be NULL. This is mutable because it needs ...
Definition: MIPField.h:256
template<class Field_T >
const Field_T * MIPField< Field_T >::rawMipLevel ( const size_t  level) const

Returns a raw pointer to a MIP level.

Definition at line 481 of file MIPField.h.

References MIPField< Field_T >::loadLevelFromDisk(), MIPBase< Data_T >::m_numLevels, and MIPField< Field_T >::m_rawFields.

482 {
483  assert(level < base::m_numLevels);
484  // Ensure level is loaded.
485  if (!m_rawFields[level]) {
486  loadLevelFromDisk(level);
487  }
488  // Return
489  return m_rawFields[level];
490 }
std::vector< Field_T * > m_rawFields
Raw pointers to MIP levels.
Definition: MIPField.h:262
size_t m_numLevels
Number of MIP levels. The default is 1.
Definition: MIPBase.h:196
void loadLevelFromDisk(size_t level) const
Loads the given level from disk.
Definition: MIPField.h:685
template<class Field_T >
Field_T::Ptr MIPField< Field_T >::concreteMipLevel ( const size_t  level) const

Returns a concretely typed pointer to a MIP level.

Definition at line 496 of file MIPField.h.

References MIPField< Field_T >::loadLevelFromDisk(), MIPField< Field_T >::m_fields, MIPBase< Data_T >::m_numLevels, and MIPField< Field_T >::m_rawFields.

497 {
498  assert(level < base::m_numLevels);
499  // Ensure level is loaded.
500  if (!m_rawFields[level]) {
501  loadLevelFromDisk(level);
502  }
503  // Return
504  return m_fields[level];
505 }
std::vector< Field_T * > m_rawFields
Raw pointers to MIP levels.
Definition: MIPField.h:262
size_t m_numLevels
Number of MIP levels. The default is 1.
Definition: MIPBase.h:196
void loadLevelFromDisk(size_t level) const
Loads the given level from disk.
Definition: MIPField.h:685
std::vector< FieldPtr > m_fields
Storage of all MIP levels. Some or all of the pointers may be NULL. This is mutable because it needs ...
Definition: MIPField.h:256
template<class Field_T >
const MIPField< Field_T > & MIPField< Field_T >::init ( const MIPField< Field_T > &  rhs)
protected

Copies from a second MIPField.

Definition at line 354 of file MIPField.h.

References MIPField< Field_T >::clone(), field_dynamic_cast(), MIPField< Field_T >::m_fields, MIPField< Field_T >::m_ioMutex, MIPField< Field_T >::m_loadActions, MIPField< Field_T >::m_mipRes, MIPField< Field_T >::m_rawFields, and MIPField< Field_T >::m_relativeResolution.

Referenced by MIPField< Field_T >::MIPField(), and MIPField< Field_T >::operator=().

355 {
356  // If any of the fields aren't yet loaded, we can rely on the same load
357  // actions as the other one
359  // Copy all the regular data members
360  m_mipRes = rhs.m_mipRes;
362  // The contained fields must be individually cloned if they have already
363  // been loaded
364  m_fields.resize(rhs.m_fields.size());
365  m_rawFields.resize(rhs.m_rawFields.size());
366  for (size_t i = 0, end = m_fields.size(); i < end; ++i) {
367  // Update the field pointer
368  if (rhs.m_fields[i]) {
369  FieldBase::Ptr baseClone = rhs.m_fields[i]->clone();
370  FieldPtr clone = field_dynamic_cast<Field_T>(baseClone);
371  if (clone) {
372  m_fields[i] = clone;
373  } else {
374  std::cerr << "MIPField::op=(): Failed to clone." << std::endl;
375  }
376  }
377  // Update the raw pointer
378  m_rawFields[i] = m_fields[i].get();
379  }
380  // New mutex
381  m_ioMutex.reset(new boost::mutex);
382  // Done
383  return *this;
384 }
Field_T::Ptr field_dynamic_cast(RefBase::Ptr field)
Dynamic cast that uses string-comparison in order to be safe even after an object crosses a shared li...
Definition: RefCount.h:256
boost::intrusive_ptr< FieldBase > Ptr
Definition: Field.h:97
LazyLoadAction< Field_T >::Vec m_loadActions
Lazy load actions. Only used if setupLazyLoad() has been called.
Definition: MIPField.h:258
std::vector< Field_T * > m_rawFields
Raw pointers to MIP levels.
Definition: MIPField.h:262
Field_T::Ptr FieldPtr
Definition: MIPField.h:130
std::vector< V3i > m_mipRes
Resolution of each MIP level.
Definition: MIPField.h:264
boost::shared_ptr< boost::mutex > m_ioMutex
Mutex lock around IO. Used to make sure only one thread reads MIP level data at a time...
Definition: MIPField.h:271
std::vector< V3f > m_relativeResolution
Relative resolution of each MIP level. Pre-computed to avoid int-to-float conversions.
Definition: MIPField.h:267
std::vector< FieldPtr > m_fields
Storage of all MIP levels. Some or all of the pointers may be NULL. This is mutable because it needs ...
Definition: MIPField.h:256
virtual FieldBase::Ptr clone() const
Returns a pointer to a copy of the field, pure virtual so ensure derived classes properly implement i...
Definition: MIPField.h:207
template<class Field_T >
void MIPField< Field_T >::updateMapping ( FieldRes::Ptr  field)
protected

Updates the mapping, extents and data window to match the given field. Used so that the MIPField will appear to have the same mapping in space as the level-0 field.

Definition at line 675 of file MIPField.h.

References FieldRes::m_dataWindow, FieldRes::m_extents, and FieldRes::setMapping().

Referenced by MIPField< Field_T >::setup(), and MIPField< Field_T >::setupLazyLoad().

676 {
677  base::m_extents = field->extents();
678  base::m_dataWindow = field->dataWindow();
679  base::setMapping(field->mapping());
680 }
Box3i m_dataWindow
Defines the area where data is allocated. This should be treated as a closed (i.e. inclusive) interval.
Definition: Field.h:310
void setMapping(FieldMapping::Ptr mapping)
Sets the field&#39;s mapping.
Definition: Field.h:347
Box3i m_extents
Defines the extents of the the storage. This may be larger or smaller than the data window...
Definition: Field.h:307
template<class Field_T >
void MIPField< Field_T >::updateAuxMembers ( ) const
protected

Updates the dependent data members based on m_field.

Definition at line 650 of file MIPField.h.

References MIPField< Field_T >::m_fields, and MIPField< Field_T >::m_rawFields.

Referenced by MIPField< Field_T >::loadLevelFromDisk(), MIPField< Field_T >::setup(), and MIPField< Field_T >::setupLazyLoad().

651 {
652  m_rawFields.resize(m_fields.size());
653  for (size_t i = 0; i < m_fields.size(); i++) {
654  m_rawFields[i] = m_fields[i].get();
655  }
656 }
std::vector< Field_T * > m_rawFields
Raw pointers to MIP levels.
Definition: MIPField.h:262
std::vector< FieldPtr > m_fields
Storage of all MIP levels. Some or all of the pointers may be NULL. This is mutable because it needs ...
Definition: MIPField.h:256
template<class Field_T >
void MIPField< Field_T >::syncLevelInfo ( const size_t  level) const
protected

Updates the name, attribute and metadata for a given level.

Definition at line 661 of file MIPField.h.

References FieldBase::attribute, MIPField< Field_T >::m_fields, and FieldBase::name.

Referenced by MIPField< Field_T >::loadLevelFromDisk().

662 {
663  // At this point, m_fields[level] is guaranteed in memory
664 
665  // First sync name, attribute
666  m_fields[level]->name = base::name;
667  m_fields[level]->attribute = base::attribute;
668  // Copy metadata
669  m_fields[level]->copyMetadata(*this);
670 }
std::string attribute
Optional name of the attribute the field represents.
Definition: Field.h:173
std::vector< FieldPtr > m_fields
Storage of all MIP levels. Some or all of the pointers may be NULL. This is mutable because it needs ...
Definition: MIPField.h:256
std::string name
Optional name of the field.
Definition: Field.h:171
template<class Field_T >
void MIPField< Field_T >::loadLevelFromDisk ( size_t  level) const
protected

Loads the given level from disk.

Definition at line 685 of file MIPField.h.

References detail::adjustedMIPFieldMapping(), FieldRes::dataWindow(), FieldRes::extents(), MIPField< Field_T >::m_fields, MIPField< Field_T >::m_ioMutex, MIPField< Field_T >::m_loadActions, MIPField< Field_T >::m_rawFields, FieldRes::mapping(), MIPField< Field_T >::syncLevelInfo(), and MIPField< Field_T >::updateAuxMembers().

Referenced by MIPField< Field_T >::concreteMipLevel(), MIPField< Field_T >::fastMipValue(), MIPField< Field_T >::mipLevel(), MIPField< Field_T >::rawMipLevel(), and MIPField< Field_T >::setupLazyLoad().

686 {
687  // Double-check locking
688  if (!m_rawFields[level]) {
689  boost::mutex::scoped_lock lock(*m_ioMutex);
690  if (!m_rawFields[level]) {
691  // Execute the lazy load action
692  m_fields[level] = m_loadActions[level]->load();
693  // Check that field was loaded
694  if (!m_fields[level]) {
695  throw Exc::MIPFieldException("Couldn't load MIP level: " +
696  boost::lexical_cast<std::string>(level));
697  }
698  // Remove lazy load action
699  m_loadActions[level].reset();
700  // Update aux data
702  // Ensure metadata is up to date
703  syncLevelInfo(level);
704  // Update the mapping of the loaded field
705  V3i baseRes = base::dataWindow().size() + V3i(1);
707  detail::adjustedMIPFieldMapping(this, baseRes,
708  m_fields[level]->extents(), level);
709  m_fields[level]->setMapping(mapping);
710  }
711  }
712 }
const Box3i & extents() const
Returns the extents of the data. This signifies the relevant area that the data exists over...
Definition: Field.h:249
LazyLoadAction< Field_T >::Vec m_loadActions
Lazy load actions. Only used if setupLazyLoad() has been called.
Definition: MIPField.h:258
std::vector< Field_T * > m_rawFields
Raw pointers to MIP levels.
Definition: MIPField.h:262
Imath::V3i V3i
Definition: SpiMathLib.h:71
boost::intrusive_ptr< FieldMapping > Ptr
Definition: FieldMapping.h:92
FIELD3D_API FieldMapping::Ptr adjustedMIPFieldMapping(const FieldRes *base, const V3i &baseRes, const Box3i &extents, const size_t level)
Definition: MIPUtil.cpp:82
void syncLevelInfo(const size_t level) const
Updates the name, attribute and metadata for a given level.
Definition: MIPField.h:661
void updateAuxMembers() const
Updates the dependent data members based on m_field.
Definition: MIPField.h:650
boost::shared_ptr< boost::mutex > m_ioMutex
Mutex lock around IO. Used to make sure only one thread reads MIP level data at a time...
Definition: MIPField.h:271
std::vector< FieldPtr > m_fields
Storage of all MIP levels. Some or all of the pointers may be NULL. This is mutable because it needs ...
Definition: MIPField.h:256
const Box3i & dataWindow() const
Returns the data window. Any coordinate inside this window is safe to pass to value() in the Field su...
Definition: Field.h:253
FieldMapping::Ptr mapping()
Returns a pointer to the mapping.
Definition: Field.h:263
template<class Field_T >
template<class T >
void MIPField< Field_T >::sanityChecks ( const T &  fields)
protected

Sanity checks to ensure that the provided Fields are a MIP representation.

Definition at line 719 of file MIPField.h.

References FIELD3D_NAMESPACE_HEADER_CLOSE.

Referenced by MIPField< Field_T >::setup(), and MIPField< Field_T >::setupLazyLoad().

720 {
721  using boost::lexical_cast;
722  using std::string;
723  using Exc::MIPFieldException;
724 
725  // Check zero length
726  if (fields.size() == 0) {
727  throw MIPFieldException("Zero fields in input");
728  }
729  // Check all non-null
730  for (size_t i = 0; i < fields.size(); i++) {
731  if (!fields[i]) {
732  throw MIPFieldException("Found null pointer in input");
733  }
734  }
735  // Check decreasing resolution at higher levels
736  V3i prevSize = fields[0]->extents().size();
737  for (size_t i = 1; i < fields.size(); i++) {
738  V3i size = fields[i]->extents().size();
739  if (size.x > prevSize.x ||
740  size.y > prevSize.y ||
741  size.z > prevSize.z) {
742  throw MIPFieldException("Field " + lexical_cast<string>(i) +
743  " had greater resolution than previous"
744  " level");
745  }
746  if (size.x >= prevSize.x &&
747  size.y >= prevSize.y &&
748  size.z >= prevSize.z) {
749  throw MIPFieldException("Field " + lexical_cast<string>(i) +
750  " did not decrease in resolution from "
751  " previous level: " +
752  lexical_cast<string>(size) + " > " +
753  lexical_cast<string>(prevSize));
754  }
755  prevSize = size;
756  }
757  // All good.
758 }
Imath::V3i V3i
Definition: SpiMathLib.h:71

Member Data Documentation

template<class Field_T>
MIPField< Field_T >::FIELD3D_CLASSNAME_CLASSTYPE_IMPLEMENTATION

Definition at line 205 of file MIPField.h.

template<class Field_T>
NestedFieldType< MIPField< Field_T > > MIPField< Field_T >::ms_classType
staticprotected
Initial value:

Definition at line 246 of file MIPField.h.

template<class Field_T>
LazyLoadAction<Field_T>::Vec MIPField< Field_T >::m_loadActions
mutableprotected

Lazy load actions. Only used if setupLazyLoad() has been called.

Definition at line 258 of file MIPField.h.

Referenced by MIPField< Field_T >::init(), MIPField< Field_T >::loadLevelFromDisk(), and MIPField< Field_T >::setupLazyLoad().

template<class Field_T>
std::vector<Field_T*> MIPField< Field_T >::m_rawFields
mutableprotected
template<class Field_T>
std::vector<V3i> MIPField< Field_T >::m_mipRes
mutableprotected
template<class Field_T>
std::vector<V3f> MIPField< Field_T >::m_relativeResolution
mutableprotected

Relative resolution of each MIP level. Pre-computed to avoid int-to-float conversions.

Definition at line 267 of file MIPField.h.

Referenced by MIPField< Field_T >::init(), MIPField< Field_T >::setup(), and MIPField< Field_T >::setupLazyLoad().

template<class Field_T>
boost::shared_ptr<boost::mutex> MIPField< Field_T >::m_ioMutex
protected

Mutex lock around IO. Used to make sure only one thread reads MIP level data at a time. When a field is cloned, the two new fields will share the mutex, since they point to the same file.

Definition at line 271 of file MIPField.h.

Referenced by MIPField< Field_T >::init(), and MIPField< Field_T >::loadLevelFromDisk().


The documentation for this class was generated from the following file: