Field3D
WritableField Class Reference

#include <Field.h>

Inheritance diagram for WritableField:
Field< Data_T >

List of all members.

Classes

class  iterator

Public Types

typedef WritableField< Data_T > class_type
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.
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)
virtual Data_T & lvalue (int i, int j, int k)=0
 Write access to a voxel. The coordinates are global coordinates.

Static Public Member Functions

static const char * classType ()
static const char * staticClassName ()

Public Attributes

 DEFINE_FIELD_RTTI_ABSTRACT_CLASS

Private Types

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

Static Private Attributes

static TemplatedFieldType
< WritableField< Data_T > > 
ms_classType

Detailed Description

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


Member Typedef Documentation

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

Reimplemented from Field< Data_T >.

Reimplemented in ResizableField.

Definition at line 603 of file Field.h.

Reimplemented from Field< Data_T >.

Reimplemented in ResizableField.

Definition at line 607 of file Field.h.

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

Convenience typedef for referring to base class.

Reimplemented from Field< Data_T >.

Reimplemented in ResizableField.

Definition at line 663 of file Field.h.


Member Function Documentation

static const char* WritableField::staticClassName ( ) [inline, static]

Reimplemented from Field< Data_T >.

Reimplemented in ResizableField.

Definition at line 610 of file Field.h.

  {
    return "WritableField";
  }
static const char* WritableField::classType ( ) [inline, static]

Reimplemented from Field< Data_T >.

Reimplemented in ResizableField.

Definition at line 615 of file Field.h.

iterator WritableField::begin ( ) [inline]

Iterator to first element.

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

iterator WritableField::begin ( const Box3i subset) [inline]

Iterator to first element of specific subset.

iterator WritableField::end ( ) [inline]

Iterator pointing one element past the last valid one.

Referenced by WritableField< Data_T >::clear(), and WritableField< Data_T >::begin().

iterator WritableField::end ( const Box3i subset) [inline]

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

virtual Data_T& WritableField::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.
virtual void WritableField::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.

Definition at line 652 of file Field.h.

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

Member Data Documentation

Reimplemented from Field< Data_T >.

Reimplemented in ResizableField.

Definition at line 608 of file Field.h.

Reimplemented from Field< Data_T >.

Reimplemented in ResizableField.

Definition at line 659 of file Field.h.


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