#include <Field3D.h>

Public Member Functions | |
| virtual void | set (const Point3D &pt, const T value)=0 |
| virtual T | get (const Point3D &pt) const =0 |
| virtual T | getByIndex (long _offset) const |
| virtual void | setByIndex (long _offset, const T value) |
| virtual T | operator[] (const Point3D &pt) const |
| virtual Dim3D | getDim () const =0 |
| virtual bool | isValid (const Point3D &pt) const =0 |
| virtual void | setDim (const Dim3D theDim) |
| virtual Point3D | getNeighbor (const Point3D &pt, unsigned int &token, double &distance, bool checkBounds=true) const |
| bool | isLittleEndian () |
| template<typename U> | |
| void | swapBytes (U &t) |
Static Public Member Functions | |
| static Field3D< T > * | createInstance (const Dim3D dim, const T &initialValue) |
Static Public Attributes | |
| static const char | typeStr [3] |
| Used by Field3DIO functions to match data types. | |
Friends | |
| std::ofstream & | operator<< (std::ofstream &, const Field3D< T > &) |
| std::ifstream & | operator>> (std::ifstream &, Field3D< T > &) |
You should only use dynamically allocated instances of this interface. This will make sure the underlying implementation is not lost in copying.
Definition at line 65 of file Field3D.h.
| static Field3D<T>* CompuCell3D::Field3D< T >::createInstance | ( | const Dim3D | dim, | |
| const T & | initialValue | |||
| ) | [inline, static] |
Create an instance of the default Field3D implementation. In this case Field3DImpl.
| dim | The dimensions of the field. | |
| initialValue | The initial value of all data elements in the field. |
| virtual void CompuCell3D::Field3D< T >::set | ( | const Point3D & | pt, | |
| const T | value | |||
| ) | [pure 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.
| pt | The coordinate of the element. | |
| value | The new value. |
Implemented in CompuCell3D::Array3DField3DAdapter< T >, CompuCell3D::Array3DBordersField3DAdapter< T >, CompuCell3D::Array2DBordersField3DAdapter< T >, CompuCell3D::Field3DImpl< T >, CompuCell3D::WatchableField3D< T >, CompuCell3D::Field3DImpl< float >, CompuCell3D::Field3DImpl< CompuCell3D::CellG * >, and CompuCell3D::Field3DImpl< precision >.
Referenced by CompuCell3D::ChemotaxisDictyPlugin::field3DChange(), and CompuCell3D::operator>>().
| virtual T CompuCell3D::Field3D< T >::get | ( | const Point3D & | pt | ) | const [pure virtual] |
If pt is out of range a BasicException will be thrown.
| pt | The coordinates of the field element. |
Implemented in CompuCell3D::Array3DField3DAdapter< T >, CompuCell3D::Array3DBordersField3DAdapter< T >, CompuCell3D::Array2DBordersField3DAdapter< T >, CompuCell3D::Field3DImpl< T >, CompuCell3D::Field3DImpl< float >, CompuCell3D::Field3DImpl< CompuCell3D::CellG * >, and CompuCell3D::Field3DImpl< precision >.
Referenced by CompuCell3D::ViscosityEnergy::changeEnergy(), CC3DTransaction::fillField3D(), CC3DTransaction::fillPressureVolumeFlexPy(), CC3DTransaction::fillVelocity(), and CC3DTransaction::markBorder().
| virtual T CompuCell3D::Field3D< 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
| _offset | offset of the field element in the internal field array. |
Reimplemented in CompuCell3D::Array3DField3DAdapter< T >, CompuCell3D::Array3DBordersField3DAdapter< T >, CompuCell3D::Array2DBordersField3DAdapter< T >, CompuCell3D::Field3DImpl< T >, CompuCell3D::Field3DImpl< float >, CompuCell3D::Field3DImpl< CompuCell3D::CellG * >, and CompuCell3D::Field3DImpl< precision >.
| virtual void CompuCell3D::Field3D< T >::setByIndex | ( | long | _offset, | |
| const T | value | |||
| ) | [inline, virtual] |
If _offset is out of range either nothing is done
| _offset | offset of the field element in the internal field array. |
Reimplemented in CompuCell3D::Array3DField3DAdapter< T >, CompuCell3D::Array3DBordersField3DAdapter< T >, CompuCell3D::Array2DBordersField3DAdapter< T >, CompuCell3D::Field3DImpl< T >, CompuCell3D::Field3DImpl< float >, CompuCell3D::Field3DImpl< CompuCell3D::CellG * >, and CompuCell3D::Field3DImpl< precision >.
| virtual T CompuCell3D::Field3D< T >::operator[] | ( | const Point3D & | pt | ) | const [inline, virtual] |
If pt is out of range a BasicException will be thrown.
| pt | The coordinates of the field element. |
| pt | The coordinates of the field element. |
| virtual Dim3D CompuCell3D::Field3D< T >::getDim | ( | ) | const [pure virtual] |
Implemented in CompuCell3D::Array3DField3DAdapter< T >, CompuCell3D::Array3DBordersField3DAdapter< T >, CompuCell3D::Array2DBordersField3DAdapter< T >, CompuCell3D::Field3DImpl< T >, CompuCell3D::Field3DImpl< float >, CompuCell3D::Field3DImpl< CompuCell3D::CellG * >, and CompuCell3D::Field3DImpl< precision >.
Referenced by CompuCell3D::operator>>().
| virtual bool CompuCell3D::Field3D< T >::isValid | ( | const Point3D & | pt | ) | const [pure virtual] |
| pt | A coordinate in 3D space. |
Implemented in CompuCell3D::Array3DField3DAdapter< T >, CompuCell3D::Array3DBordersField3DAdapter< T >, CompuCell3D::Array2DBordersField3DAdapter< T >, CompuCell3D::Field3DImpl< T >, CompuCell3D::Field3DImpl< float >, CompuCell3D::Field3DImpl< CompuCell3D::CellG * >, and CompuCell3D::Field3DImpl< precision >.
| virtual void CompuCell3D::Field3D< T >::setDim | ( | const Dim3D | theDim | ) | [inline, virtual] |
Change the dimensions of the field dynamically
| theDim | New dimensions. |
Reimplemented in CompuCell3D::Array3DField3DAdapter< T >, CompuCell3D::Array3DBordersField3DAdapter< T >, CompuCell3D::Array2DBordersField3DAdapter< T >, CompuCell3D::Field3DImpl< T >, CompuCell3D::Field3DImpl< float >, CompuCell3D::Field3DImpl< CompuCell3D::CellG * >, and CompuCell3D::Field3DImpl< precision >.
| virtual Point3D CompuCell3D::Field3D< T >::getNeighbor | ( | const Point3D & | pt, | |
| unsigned int & | token, | |||
| double & | distance, | |||
| bool | checkBounds = true | |||
| ) | const [inline, virtual] |
Get the next Neighbor points in the sequence. To start a new sequence of Neighbor points set token to zero. Neighbor points which are outside of the field are automatically filtered out. If you call this function too many times it will cause an infinite loop when the neighbor depth is beyond all points in the field.
| pt | The current source point. | |
| token | Keeps track of which Neighbor is next. | |
| distance | Is set on return to the distance of the neighbor. |
Definition at line 179 of file Field3D.h.
Referenced by CompuCell3D::ViscosityEnergy::changeEnergy().
| bool CompuCell3D::Field3D< T >::isLittleEndian | ( | ) | [inline] |
| std::ofstream& operator<< | ( | std::ofstream & | stream, | |
| const Field3D< T > & | field | |||
| ) | [friend] |
Generic operator for writing Field3D data in a platform independent way.
The format is as follows:
| Bytes | Type | Description |
| 2 | char | Data type string. |
| 1 | char | Number of dimensions. Always 3. |
| 4 | uint32_t | X dimension. |
| 4 | uint32_t | Y dimension. |
| 4 | uint32_t | Z dimension. |
| X*Y*Z*sizeof(data type) | data type according to the type string | The field data |
The predefined data type strings are as follows:
" i" 4 byte signed integer
"ui" 4 byte unsigned integer
" d" 8 byte double
" f" 4 byte float
" c" 1 byte signed character
"uc" 1 byte unsigned character
" l" 4 byte signed integer
"ul" 4 byte unsigned integer
If you what to write a field of a data type not listed in this table you must define const char Field3D<T>::typeStr[3] for that type somewhere in your code or you will get link errors.
All data is written in network byte order. (ie. Most significant byte first)
Long data types and pointers are different on 64 bit machines. Such data fields will be incompatable between 64 bit and 32 bit machines.
stream The output stream. field The field to write.
| std::ifstream& operator>> | ( | std::ifstream & | stream, | |
| Field3D< T > & | field | |||
| ) | [friend] |
Generic operator for reading Field3D data in a platform independent way.
See std::ofstream &operator<<(std::ofstream &, Field3D<T> &)
const char CompuCell3D::Field3D< T >::typeStr[3] [static] |
Used by Field3DIO functions to match data types.
Definition at line 68 of file Field3D.h.
Referenced by CompuCell3D::operator>>().
1.5.6