CompuCell3D::Field3DImpl< T > Class Template Reference

#include <Field3DImpl.h>

Inheritance diagram for CompuCell3D::Field3DImpl< T >:

Inheritance graph
[legend]
Collaboration diagram for CompuCell3D::Field3DImpl< T >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Field3DImpl (const Dim3D dim, const T &initialValue)
virtual ~Field3DImpl ()
virtual void set (const Point3D &pt, const T value)
virtual void setDim (const Dim3D theDim)
getQuick (const Point3D &pt) const
void setQuick (const Point3D &pt, const T _value)
virtual T get (const Point3D &pt) const
virtual T getByIndex (long _offset) const
virtual void setByIndex (long _offset, const T _value)
virtual Dim3D getDim () const
virtual bool isValid (const Point3D &pt) const

Private Attributes

Dim3D dim
T * field
initialValue
long len


Detailed Description

template<class T>
class CompuCell3D::Field3DImpl< T >

Default implementation of the Field3D interface.

Definition at line 46 of file Field3DImpl.h.


Constructor & Destructor Documentation

template<class T>
CompuCell3D::Field3DImpl< T >::Field3DImpl ( const Dim3D  dim,
const T &  initialValue 
) [inline]

Parameters:
dim The field dimensions
initialValue The initial value of all data elements in the field.

Definition at line 57 of file Field3DImpl.h.

template<class T>
virtual CompuCell3D::Field3DImpl< T >::~Field3DImpl (  )  [inline, virtual]

Definition at line 75 of file Field3DImpl.h.


Member Function Documentation

template<class T>
virtual void CompuCell3D::Field3DImpl< T >::set ( const Point3D pt,
const T  value 
) [inline, virtual]

Set a field element. If the value was already set it will be overwritten. If pt is out of range then a BasicException will be thrown.

Parameters:
pt The coordinate of the element.
value The new value.

Implements CompuCell3D::Field3D< T >.

Reimplemented in CompuCell3D::Array3DField3DAdapter< T >, CompuCell3D::Array3DBordersField3DAdapter< T >, CompuCell3D::Array2DBordersField3DAdapter< T >, and CompuCell3D::WatchableField3D< T >.

Definition at line 83 of file Field3DImpl.h.

template<class T>
virtual void CompuCell3D::Field3DImpl< T >::setDim ( const Dim3D  theDim  )  [inline, virtual]

Change the dimensions of the field dynamically

Parameters:
theDim New dimensions.

Reimplemented from CompuCell3D::Field3D< T >.

Reimplemented in CompuCell3D::Array3DField3DAdapter< T >, CompuCell3D::Array3DBordersField3DAdapter< T >, and CompuCell3D::Array2DBordersField3DAdapter< T >.

Definition at line 88 of file Field3DImpl.h.

template<class T>
T CompuCell3D::Field3DImpl< T >::getQuick ( const Point3D pt  )  const [inline]

Definition at line 107 of file Field3DImpl.h.

template<class T>
void CompuCell3D::Field3DImpl< T >::setQuick ( const Point3D pt,
const T  _value 
) [inline]

Definition at line 113 of file Field3DImpl.h.

template<class T>
virtual T CompuCell3D::Field3DImpl< T >::get ( const Point3D pt  )  const [inline, virtual]

template<class T>
virtual T CompuCell3D::Field3DImpl< T >::getByIndex ( long  _offset  )  const [inline, virtual]

If _offset is out of range either a BasicException will be thrown or a function will return default value for the field element

Parameters:
_offset offset of the field element in the internal field array.
Returns:
The value of the element at _offset.

Reimplemented from CompuCell3D::Field3D< T >.

Reimplemented in CompuCell3D::Array3DField3DAdapter< T >, CompuCell3D::Array3DBordersField3DAdapter< T >, and CompuCell3D::Array2DBordersField3DAdapter< T >.

Definition at line 124 of file Field3DImpl.h.

template<class T>
virtual void CompuCell3D::Field3DImpl< T >::setByIndex ( long  _offset,
const T  value 
) [inline, virtual]

If _offset is out of range either nothing is done

Parameters:
_offset offset of the field element in the internal field array.
Returns:
The value of the element at _offset.

Reimplemented from CompuCell3D::Field3D< T >.

Reimplemented in CompuCell3D::Array3DField3DAdapter< T >, CompuCell3D::Array3DBordersField3DAdapter< T >, and CompuCell3D::Array2DBordersField3DAdapter< T >.

Definition at line 129 of file Field3DImpl.h.

template<class T>
virtual Dim3D CompuCell3D::Field3DImpl< T >::getDim (  )  const [inline, virtual]

template<class T>
virtual bool CompuCell3D::Field3DImpl< T >::isValid ( const Point3D pt  )  const [inline, virtual]

Parameters:
pt A coordinate in 3D space.
Returns:
True if the coordinate is in this field false otherwise.

Implements CompuCell3D::Field3D< T >.

Reimplemented in CompuCell3D::Array3DField3DAdapter< T >, CompuCell3D::Array3DBordersField3DAdapter< T >, and CompuCell3D::Array2DBordersField3DAdapter< T >.

Definition at line 138 of file Field3DImpl.h.

Referenced by CompuCell3D::Field3DImpl< precision >::get(), and CompuCell3D::Field3DImpl< precision >::set().


Member Data Documentation

template<class T>
Dim3D CompuCell3D::Field3DImpl< T >::dim [private]

template<class T>
T* CompuCell3D::Field3DImpl< T >::field [private]

template<class T>
T CompuCell3D::Field3DImpl< T >::initialValue [private]

template<class T>
long CompuCell3D::Field3DImpl< T >::len [private]


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

Generated on Thu Dec 4 11:41:57 2008 for CompuCell3D by  doxygen 1.5.6