Field3D
WritableField< Data_T > Class Template Reference

#include <Field.h>

Inheritance diagram for WritableField< Data_T >:
Field< Data_T > Field< Data_T > FieldRes FieldRes FieldRes FieldRes FieldBase FieldBase FieldBase FieldBase FieldBase FieldBase FieldBase FieldBase ResizableField< Data_T > ResizableField< Data_T > DenseField< Data_T > DenseField< Data_T > EmptyField< Data_T > EmptyField< Data_T > MACField< Data_T > MACField< Data_T > SparseField< Data_T > SparseField< Data_T > DenseField< Data_T > DenseField< Data_T > EmptyField< Data_T > EmptyField< Data_T > MACField< Data_T > MACField< Data_T > SparseField< Data_T > SparseField< Data_T >

List of all members.

Classes

class  iterator

Public Types

typedef WritableField< Data_T > class_type
typedef WritableField< Data_T > class_type
typedef boost::intrusive_ptr
< WritableField
Ptr
typedef boost::intrusive_ptr
< WritableField
Ptr

Public Member Functions

iterator begin ()
 Iterator to first element.
iterator begin (const Box3i &subset)
 Iterator to first element of specific subset.
iterator begin (const Box3i &subset)
 Iterator to first element of specific subset.
iterator begin ()
 Iterator to first element.
virtual void clear (const Data_T &value)
 Clears all the voxels in the storage. Should be re-implemented by subclasses that can provide a more efficient version.
virtual void clear (const Data_T &value)
 Clears all the voxels in the storage. Should be re-implemented by subclasses that can provide a more efficient version.
iterator end ()
 Iterator pointing one element past the last valid one.
iterator end (const Box3i &subset)
 Iterator pointing one element past the last valid one (for a subset)
iterator end (const Box3i &subset)
 Iterator pointing one element past the last valid one (for a subset)
iterator end ()
 Iterator pointing one element past the last valid one.
virtual Data_T & lvalue (int i, int j, int k)=0
 Write access to a voxel. The coordinates are global coordinates.
virtual Data_T & lvalue (int i, int j, int k)=0
 Write access to a voxel. The coordinates are global coordinates.

Public Attributes

 DEFINE_FIELD_RTTI_ABSTRACT_CLASS

Private Types

typedef Field< Data_T > base
 Convenience typedef for referring to base class.
typedef Field< Data_T > base
 Convenience typedef for referring to base class.

Detailed Description

template<class Data_T>
class WritableField< Data_T >

This class brings together both read- and write-access to voxels. The buffer can not be resized. Resizing is added by ResizableField.

Definition at line 630 of file Field.h.


Member Typedef Documentation

template<class Data_T>
typedef Field<Data_T> WritableField< Data_T >::base [private]
template<class Data_T>
typedef Field<Data_T> WritableField< Data_T >::base [private]

Member Function Documentation

template<class Data_T >
WritableField< Data_T >::iterator WritableField< Data_T >::begin ( ) [inline]

Iterator to first element.

Reimplemented in DenseField< Data_T >, SparseField< Data_T >, DenseField< Data_T >, and SparseField< Data_T >.

Definition at line 691 of file Field.h.

References FieldRes::dataResolution().

Referenced by WritableField< Data_T >::clear().

{
  if (FieldRes::dataResolution() == V3i(0))
    return end();
  return iterator(*this, Field<Data_T>::m_dataWindow, 
                  Field<Data_T>::m_dataWindow.min);
}
template<class Data_T >
WritableField< Data_T >::iterator WritableField< Data_T >::begin ( const Box3i subset) [inline]

Iterator to first element of specific subset.

Reimplemented in DenseField< Data_T >, SparseField< Data_T >, DenseField< Data_T >, and SparseField< Data_T >.

Definition at line 703 of file Field.h.

{
  if (subset.isEmpty())
    return end(subset);
  return iterator(*this, subset, subset.min);
}
template<class Data_T >
WritableField< Data_T >::iterator WritableField< Data_T >::end ( ) [inline]

Iterator pointing one element past the last valid one.

Reimplemented in DenseField< Data_T >, SparseField< Data_T >, DenseField< Data_T >, and SparseField< Data_T >.

Definition at line 714 of file Field.h.

Referenced by WritableField< Data_T >::clear().

template<class Data_T >
WritableField< Data_T >::iterator WritableField< Data_T >::end ( const Box3i subset) [inline]

Iterator pointing one element past the last valid one (for a subset)

Reimplemented in DenseField< Data_T >, SparseField< Data_T >, DenseField< Data_T >, and SparseField< Data_T >.

Definition at line 725 of file Field.h.

{ return iterator(*this, subset, 
                  V3i(subset.min.x, subset.min.y, subset.max.z + 1));
}
template<class Data_T>
virtual Data_T& WritableField< Data_T >::lvalue ( int  i,
int  j,
int  k 
) [pure virtual]

Write access to a voxel. The coordinates are global coordinates.

Note:
Before the internal storage is accessed, the subclass must compute the crop window coordinates by looking at Field::m_dataWindow.
This is named differently from the const value so that non-const objects still have a clear way of accessing data in a const way.
Virtual functions are known not to play nice with threading. Therefor, concrete classes can implement (by convention) fastLValue() as a non-virtual function.

Implemented in DenseField< Data_T >, EmptyField< Data_T >, MACField< Data_T >, SparseField< Data_T >, DenseField< Data_T >, EmptyField< Data_T >, MACField< Data_T >, and SparseField< Data_T >.

template<class Data_T>
virtual void WritableField< Data_T >::clear ( const Data_T &  value) [inline, virtual]

Clears all the voxels in the storage. Should be re-implemented by subclasses that can provide a more efficient version.

Reimplemented in DenseField< Data_T >, EmptyField< Data_T >, MACField< Data_T >, SparseField< Data_T >, DenseField< Data_T >, EmptyField< Data_T >, MACField< Data_T >, and SparseField< Data_T >.

Definition at line 676 of file Field.h.

References WritableField< Data_T >::begin(), and WritableField< Data_T >::end().

  { std::fill(begin(), end(), value); }
template<class Data_T>
iterator WritableField< Data_T >::begin ( ) [inline]

Iterator to first element.

Reimplemented in DenseField< Data_T >, SparseField< Data_T >, DenseField< Data_T >, and SparseField< Data_T >.

template<class Data_T>
iterator WritableField< Data_T >::begin ( const Box3i subset) [inline]

Iterator to first element of specific subset.

Reimplemented in DenseField< Data_T >, SparseField< Data_T >, DenseField< Data_T >, and SparseField< Data_T >.

template<class Data_T>
iterator WritableField< Data_T >::end ( ) [inline]

Iterator pointing one element past the last valid one.

Reimplemented in DenseField< Data_T >, SparseField< Data_T >, DenseField< Data_T >, and SparseField< Data_T >.

template<class Data_T>
iterator WritableField< Data_T >::end ( const Box3i subset) [inline]

Iterator pointing one element past the last valid one (for a subset)

Reimplemented in DenseField< Data_T >, SparseField< Data_T >, DenseField< Data_T >, and SparseField< Data_T >.

template<class Data_T>
virtual Data_T& WritableField< Data_T >::lvalue ( int  i,
int  j,
int  k 
) [pure virtual]

Write access to a voxel. The coordinates are global coordinates.

Note:
Before the internal storage is accessed, the subclass must compute the crop window coordinates by looking at Field::m_dataWindow.
This is named differently from the const value so that non-const objects still have a clear way of accessing data in a const way.
Virtual functions are known not to play nice with threading. Therefor, concrete classes can implement (by convention) fastLValue() as a non-virtual function.

Implemented in DenseField< Data_T >, EmptyField< Data_T >, MACField< Data_T >, SparseField< Data_T >, DenseField< Data_T >, EmptyField< Data_T >, MACField< Data_T >, and SparseField< Data_T >.

template<class Data_T>
virtual void WritableField< Data_T >::clear ( const Data_T &  value) [inline, virtual]

Clears all the voxels in the storage. Should be re-implemented by subclasses that can provide a more efficient version.

Reimplemented in DenseField< Data_T >, EmptyField< Data_T >, MACField< Data_T >, SparseField< Data_T >, DenseField< Data_T >, EmptyField< Data_T >, MACField< Data_T >, and SparseField< Data_T >.

Definition at line 676 of file Field.h.

References WritableField< Data_T >::begin(), and WritableField< Data_T >::end().

  { std::fill(begin(), end(), value); }

Member Data Documentation

template<class Data_T>
WritableField< Data_T >::DEFINE_FIELD_RTTI_ABSTRACT_CLASS

Reimplemented from Field< Data_T >.

Reimplemented in ResizableField< Data_T >.

Definition at line 642 of file Field.h.


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