Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

MCMesh::MCData< T, Size > Class Template Reference

This class holds the actual. More...

Inheritance diagram for MCMesh::MCData< T, Size >:

Inheritance graph
[legend]
Collaboration diagram for MCMesh::MCData< T, Size >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MCData (int es=MCM_DATA_EXTEND_DEFAULT)
 Default constructor.
virtual ~MCData ()
 Destructor.
void extendSize (int sz)
 Extend Size setter. See _extendSize for more information.
int extendSize ()
 Extend Size getter. See _extendSize for more information.
MCElement< T, Size > Add (void)
void Clear ()
 Brings back the object to it's initial state.
int GetSize (void)
 Actual size of the array.
T * operator[] (int idx)
 This function returns a pointer to the data in any case.
void CopyFrom (int idx, T *data)
 Copies the data from data to the internal array and starts at position idx.

Private Attributes

T * _data
 Array data.
int _extendSize
 Fill level of the array.
int _size
int _bufSize
 Actual size of the buffer.

Detailed Description

template<class T, int Size>
class MCMesh::MCData< T, Size >

This class holds the actual.

As all other classes this class provides a one way access to the data. Adding data to the "array" is easy but there is now way to remove a value from the array. Initially the class creates an empty array of size _extendSize*Size. This will be filled until no more elements fit into the array. At this point a new array of the size OldSize*_extendSize*Size will be created, the data copied to the new array and the old array will be destroyed. The value of _extendSize can be changed dynamically. Its default value is MCM_DATA_EXTEND_DEFAULT.

Definition at line 304 of file MarchingCubesData.h.


Constructor & Destructor Documentation

template<class T, int Size>
MCMesh::MCData< T, Size >::MCData int  es = MCM_DATA_EXTEND_DEFAULT  )  [inline]
 

Default constructor.

Definition at line 327 of file MarchingCubesData.h.

template<class T, int Size>
virtual MCMesh::MCData< T, Size >::~MCData  )  [inline, virtual]
 

Destructor.

Definition at line 330 of file MarchingCubesData.h.


Member Function Documentation

template<class T, int Size>
MCElement<T, Size> MCMesh::MCData< T, Size >::Add void   )  [inline]
 

Todo:
This is a very sensible piece of the data structures. Think about _bufSize and _size in combination with Size.
Definition at line 345 of file MarchingCubesData.h.

Referenced by MCMesh::_addToIndex(), MCMesh::_compileNormalsArray(), MCMesh::AddVertex(), and MCMesh::setObjectColor().

template<class T, int Size>
void MCMesh::MCData< T, Size >::Clear  )  [inline]
 

Brings back the object to it's initial state.

Definition at line 383 of file MarchingCubesData.h.

Referenced by MCMesh::_compileNormalsArray(), and MCMesh::setObjectColor().

template<class T, int Size>
void MCMesh::MCData< T, Size >::CopyFrom int  idx,
T *  data
[inline]
 

Copies the data from data to the internal array and starts at position idx.

This function expects the number of Size elements in data.

Attention:
This function may cause segmentation faults if there are not enough elements in data.
Definition at line 409 of file MarchingCubesData.h.

template<class T, int Size>
int MCMesh::MCData< T, Size >::extendSize  )  [inline]
 

Extend Size getter. See _extendSize for more information.

Definition at line 337 of file MarchingCubesData.h.

template<class T, int Size>
void MCMesh::MCData< T, Size >::extendSize int  sz  )  [inline]
 

Extend Size setter. See _extendSize for more information.

Definition at line 335 of file MarchingCubesData.h.

template<class T, int Size>
int MCMesh::MCData< T, Size >::GetSize void   )  [inline]
 

Actual size of the array.

Definition at line 391 of file MarchingCubesData.h.

Referenced by MCMesh::_compileNormalsArray(), MCMesh::AddVertex(), MCMesh::DebugPrint(), and MCMesh::render().

template<class T, int Size>
T* MCMesh::MCData< T, Size >::operator[] int  idx  )  [inline]
 

This function returns a pointer to the data in any case.

Definition at line 396 of file MarchingCubesData.h.


Member Data Documentation

template<class T, int Size>
int MCMesh::MCData< T, Size >::_bufSize [private]
 

Actual size of the buffer.

If _size equals _bufSize, and a new element should be added, the array has to be resized.Definition at line 322 of file MarchingCubesData.h.

template<class T, int Size>
T* MCMesh::MCData< T, Size >::_data [private]
 

Array data.

Definition at line 310 of file MarchingCubesData.h.

template<class T, int Size>
int MCMesh::MCData< T, Size >::_extendSize [private]
 

Fill level of the array.

Definition at line 316 of file MarchingCubesData.h.

template<class T, int Size>
int MCMesh::MCData< T, Size >::_size [private]
 

Definition at line 317 of file MarchingCubesData.h.


The documentation for this class was generated from the following file:
Generated on Tue Nov 9 19:41:50 2004 for vuVolume by doxygen 1.3.8