Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

Container3D< Im3DValue > Class Template Reference

Baseclass for 3D images. More...

#include <Container3D.hpp>

Inheritance diagram for Container3D< Im3DValue >:

Inheritance graph
[legend]
Collaboration diagram for Container3D< Im3DValue >:

Collaboration graph
[legend]
List of all members.

Constructors and destructors

virtual ~Container3D ()
 Destructor.
 Container3D (int _width, int _height, int _depth)
 Container3D (const string &fname)
 Container3D (const char *fname)
 Container3D (char *fname)
 Container3D (const Size3D &size)
 Container3D (const Container3D &other)
template<class OtherImageType>
 Container3D (const OtherImageType &other)
void Allocate ()
void DeAllocate ()

Public Types

typedef Im3DValue value_type
 So that other templates know what Im3DValue is.
typedef CTR3D_iteratorFast<
Container3D, Im3DValue &,
Im3DValue * > 
iteratorFast
typedef CTR3D_iteratorXYZ<
Container3D, Im3DValue &,
Im3DValue * > 
iteratorXYZ
typedef CTR3D_iteratorZone<
Container3D, Im3DValue &,
Im3DValue * > 
iteratorZone
typedef CTR3D_iteratorFastMasked<
Container3D, Im3DValue &,
Im3DValue * > 
iteratorFastMasked
typedef CTR3D_iteratorXYZMasked<
Container3D, Im3DValue &,
Im3DValue * > 
iteratorXYZMasked
typedef CTR3D_iteratorBoxConcentric<
Container3D, Im3DValue &,
Im3DValue * > 
iteratorBoxConcentric
typedef CTR3D_iteratorFast<
const Container3D, const
Im3DValue &, const Im3DValue * > 
const_iterator
typedef CTR3D_iteratorFast<
const Container3D, const
Im3DValue &, const Im3DValue * > 
const_iteratorFast
typedef CTR3D_iteratorXYZ<
const Container3D, const
Im3DValue &, const Im3DValue * > 
const_iteratorXYZ
typedef CTR3D_iteratorZone<
const Container3D, const
Im3DValue &, const Im3DValue * > 
const_iteratorZone
typedef CTR3D_iteratorFastMasked<
const Container3D, const
Im3DValue &, const Im3DValue * > 
const_iteratorFastMasked
typedef CTR3D_iteratorXYZMasked<
const Container3D, const
Im3DValue &, const Im3DValue * > 
const_iteratorXYZMasked
typedef CTR3D_iteratorBoxConcentric<
const Container3D, const
Im3DValue &, const Im3DValue * > 
const_iteratorBoxConcentric
typedef reverse_iterator<
const_iterator
const_reverse_iterator
typedef reverse_iterator<
iterator > 
reverse_iterator

Public Member Functions

virtual string GetTypeName () const
 Type information.
name Begin and end iterating
through an image iteratorFast 
begin ()
 (stl-like) get an iterator positioned at the begining of this container
const_iteratorFast begin () const
iteratorFast end ()
 (stl-like) get an iterator positioned at the end of this container
const_iteratorFast end () const
reverse_iterator rbegin ()
const_reverse_iterator rbegin () const
reverse_iterator rend ()
const_reverse_iterator rend () const
name Accesors to Properties
bool 
HasSupport () const
RectZone3DfAddSupport (const Vect3Df &p0, const Vect3Df &p1)
RectZone3DfAddSupport (const RectZone3Df &otherSupport)
RectZone3DfSupport ()
RectZone3Df const & Support () const
name Container3D Accesors
Im3DValue * 
GetData ()
 avoid using this directly :-(
const Im3DValue * GetData () const
Im3DValue * GetDataEnd ()
const Im3DValue * GetDataEnd () const
name Accesors to specific
image positions Im3DValue & 
operator() (int pos)
const Im3DValue & operator() (int pos) const
Im3DValue & operator() (int x, int y, int z)
const Im3DValue & operator() (int x, int y, int z) const
Im3DValue & operator() (const Vect3Di &v)
const Im3DValue & operator() (const Vect3Di &v) const
virtual float FloatValue (int x, int y, int z) const
 This is a way to retreive values when only the base class is known.
void deprecated SetAll (const Im3DValue &value)
 Sets all elements of the container to this value (deprecated name!!, use Fill()).
void Fill (const Im3DValue &value)
 Sets all elements of the container to this value.
virtual void Read (ImLib3DFile *file, xmlpp::Element *parentNode=NULL, xmlpp::Element *node=NULL)
 This is where all the information is written.
virtual void Write (ImLib3DFile *file, xmlpp::Element *parentNode=NULL, xmlpp::Element *node=NULL) const
 Write this object, either to a current node, a parent node, or the root node of the file.
virtual void WriteToFile (const string &fname) const
 Write the image to file fname: This is the fct the end user should call.
void Resize (const Size3D &newSize)
template<class OtherImageType>
name Copy and compare operators
_Self
operator= (const OtherImageType &other)
_Selfoperator= (const _Self &other)
bool operator== (const _Self &other) const
bool operator!= (const _Self &other) const
template<class Im3DValue>
Container3D< Im3DValue > & operator= (const Container3D< Im3DValue > &other)

Public Attributes

name Iterator Typedefs typedef
CTR3D_iteratorFast< Container3D,
Im3DValue &, Im3DValue * > 
iterator

Protected Member Functions

bool WarnOnUnkownType () const

Private Types

typedef Container3D< Im3DValue > _Self
 shortcut for self type reference

Private Member Functions

virtual void WriteBinary (ImLib3DFile *file) const
 Write the binary block of this image (override if your image type needs special handling).
virtual void ReadBinary (ImLib3DFile *file)
 Read the binary block of this image (override if your image type needs special handling).
virtual int GetBinarySize () const
 Returns the size of the binary block of this image.

Private Attributes

Im3DValue * imageData
 The actual contained data.
Im3DValue * imageDataEnd
 one past the last data element (used for iterator end check)
int widthXheight
 Speedup.

Detailed Description

template<class Im3DValue>
class Container3D< Im3DValue >

Baseclass for 3D images.

This is a 3D container, it can contain any type and has iterators for effeciently walking through it. It's the base class for standard 3d images.

Definition at line 57 of file Container3D.hpp.


Constructor & Destructor Documentation

template<class Im3DValue>
Container3D< Im3DValue >::Container3D const Size3D size  )  [explicit]
 

Copy constructor

Definition at line 243 of file Container3D.hxx.


Member Function Documentation

template<class Im3DValue>
virtual float Container3D< Im3DValue >::FloatValue int  x,
int  y,
int  z
const [inline, virtual]
 

This is a way to retreive values when only the base class is known.

WARNING: this is NOT the normal way of retreiving values of an image. Use () operators of subclasses, or better, iterators. This is a virtual function, so it is slow. Furthermore it casts results into float, which is not good in many situations. Many containers contain types that are not castable to float.

Reimplemented from Image3D.

Definition at line 149 of file Container3D.hpp.

template<class Im3DValue>
void Container3D< Im3DValue >::Read ImLib3DFile file,
xmlpp::Element *  parentNode = NULL,
xmlpp::Element *  node = NULL
[virtual]
 

This is where all the information is written.

This virtual function writes xml/bin of any unset/unwritten information (type,image size,image data,,...) If you override it in a child class, you should still call it (using _Base::Write...), you can even call it several times...

Reimplemented from Image3D.

Definition at line 64 of file Container3D.hxx.

References Image3D::CreateReadNode(), XMLBinaryFile::debug, XMLBinaryFile::GetAttribute(), XMLBinaryFile::GetChild(), Container3D< Im3DValue >::GetTypeName(), Image3D::Read(), Container3D< Im3DValue >::ReadBinary(), XMLBinaryFile::ReadBinaryNode(), and XMLBinaryFile::ShowXML().

Referenced by Properties::Read(), and BitImage3D< FieldType, bitsPerValue, ValueType >::Read().


The documentation for this class was generated from the following files:
Generated on Fri Jun 17 13:36:18 2005 for ImLib3D by  doxygen 1.4.2