Field3D
Field< Data_T > Class Template Reference

#include <Field.h>

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

List of all members.

Classes

class  const_iterator

Public Types

typedef Field< Data_T > class_type
typedef boost::intrusive_ptr
< Field
Ptr
typedef Data_T value_type
 Allows us to reference the template class.
typedef std::vector< PtrVec
 This is a convenience typedef for the list that Field3DInputFile::readScalarLayers() and Field3DInputFile::readVectorLayers() will return its data in.

Public Member Functions

const_iterator cbegin () const
 Const iterator to first element. "cbegin" matches the tr1 c++ standard.
const_iterator cbegin (const Box3i &subset) const
 Const iterator to first element of specific subset.
const_iterator cend () const
 Const iterator pointing one element past the last valid one.
const_iterator cend (const Box3i &subset) const
 Const iterator pointing one element past the last valid one (for a subset)
virtual std::string dataTypeString () const
virtual Data_T value (int i, int j, int k) const =0
 Read access to a voxel. The coordinates are in integer voxel space .
virtual ~Field ()
 Dtor.

Static Public Member Functions

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

Public Attributes

 DEFINE_FIELD_RTTI_ABSTRACT_CLASS

Private Types

typedef FieldRes base
 Convenience typedef for referring to base class.

Static Private Attributes

static TemplatedFieldType
< Field< Data_T > > 
ms_classType

Detailed Description

template<class Data_T>
class Field< Data_T >

This class provides read-only access to voxels. A read-only buffer can not be resized. Resizing is added by ResizableField. The object still has a size of course, but it can only be set by subclass-specific methods.

Note:
Regarding the template type Data_T. This does not necessarily have to be the internal data storage format, it only defines the -return type- that the particular Field instance provides.

Definition at line 376 of file Field.h.


Member Typedef Documentation

template<class Data_T>
typedef boost::intrusive_ptr<Field> Field< Data_T >::Ptr
template<class Data_T>
typedef Data_T Field< Data_T >::value_type

Allows us to reference the template class.

Definition at line 385 of file Field.h.

template<class Data_T>
typedef std::vector<Ptr> Field< Data_T >::Vec

This is a convenience typedef for the list that Field3DInputFile::readScalarLayers() and Field3DInputFile::readVectorLayers() will return its data in.

Reimplemented from FieldRes.

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

Definition at line 390 of file Field.h.

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

Convenience typedef for referring to base class.

Reimplemented from FieldRes.

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

Definition at line 454 of file Field.h.


Constructor & Destructor Documentation

template<class Data_T>
virtual Field< Data_T >::~Field ( ) [inline, virtual]

Dtor.

Definition at line 410 of file Field.h.

  { /* Empty */ }

Member Function Documentation

template<class Data_T>
static const char* Field< Data_T >::staticClassName ( ) [inline, static]

Reimplemented from FieldRes.

Reimplemented in DenseField< Data_T >, WritableField< Data_T >, ResizableField< Data_T >, MACField< Data_T >, ProceduralField< Data_T >, and SparseField< Data_T >.

Definition at line 397 of file Field.h.

  {
    return "Field";
  }
template<class Data_T>
static const char* Field< Data_T >::classType ( ) [inline, static]
template<class Data_T >
Field< Data_T >::const_iterator Field< Data_T >::cbegin ( ) const

Const iterator to first element. "cbegin" matches the tr1 c++ standard.

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

Definition at line 471 of file Field.h.

References FieldRes::dataResolution().

Referenced by ResizableField< Data_T >::copyFrom(), and isIdentical().

{
  if (FieldRes::dataResolution() == V3i(0))
    return cend();
  return const_iterator(*this, m_dataWindow, m_dataWindow.min);
}
template<class Data_T >
Field< Data_T >::const_iterator Field< Data_T >::cbegin ( const Box3i subset) const

Const iterator to first element of specific subset.

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

Definition at line 482 of file Field.h.

{
  if (subset.isEmpty())
    return cend(subset);
  return const_iterator(*this, subset, subset.min);
}
template<class Data_T >
Field< Data_T >::const_iterator Field< Data_T >::cend ( ) const

Const iterator pointing one element past the last valid one.

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

Definition at line 493 of file Field.h.

Referenced by isIdentical().

{ 
  return const_iterator(*this, m_dataWindow, 
                        V3i(m_dataWindow.min.x, 
                            m_dataWindow.min.y,
                            m_dataWindow.max.z + 1));
}
template<class Data_T >
Field< Data_T >::const_iterator Field< Data_T >::cend ( const Box3i subset) const

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

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

Definition at line 505 of file Field.h.

{ 
  return const_iterator(*this, subset, V3i(subset.min.x, 
                                           subset.min.y,
                                           subset.max.z + 1));
}
template<class Data_T>
virtual Data_T Field< Data_T >::value ( int  i,
int  j,
int  k 
) const [pure 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.

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

Referenced by CubicFieldInterp< Data_T >::sample(), and LinearFieldInterp< Data_T >::sample().

template<class Data_T>
virtual std::string Field< Data_T >::dataTypeString ( ) const [inline, virtual]

Reimplemented from FieldRes.

Definition at line 441 of file Field.h.

References FieldBase::name.


Member Data Documentation

template<class Data_T>
Field< Data_T >::DEFINE_FIELD_RTTI_ABSTRACT_CLASS

Reimplemented from FieldRes.

Reimplemented in WritableField< Data_T >, and ResizableField< Data_T >.

Definition at line 395 of file Field.h.

template<class Data_T>
TemplatedFieldType<Field<Data_T> > Field< Data_T >::ms_classType [static, private]

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