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

vuDVector< T > Class Template Reference

vuDVector is a templatized dynamic vector class for the volume tree. More...

#include <vuDVector.h>

Inheritance diagram for vuDVector< T >:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 vuDVector ()
 Default constructor.
 vuDVector (const vuDVector< T > &v)
 Copy constructor that does a deep copy.
 ~vuDVector ()
 Destructor.
void setStepSize (dword s)
 Sets the stepsize of the vector.
dword getStepSize (void) const
 Returns the step size of the vector.
void setSize (dword s)
 Sets the size of the vector.
dword getSize (void) const
 Returns the size of the vector.
dword getLength (void) const
 Returns the length of the vector.
bool isMember (const T &elem) const
 Returns true if the element is stored in the vector.
dword findIndex (const T &elem) const
 Returns the position of the element within the vector.
void remove (dword index)
 Removes the indexed element from the vector.
void removeAll ()
 Removes all elements from the vector.
void removeRange (dword start, dword end)
 Removes all the elements in the vector from start to end, inclusive.
void sizeToLength (void)
 Resize the vector to be the same size as the number of data elements stored in it.
void stepToLength (void)
 Resize the vector to be the multiple of the stepsize that is nearest to the length.
vuDVector< T > & operator= (const vuDVector< T > &rhs)
 Assignment operator which does a deep copy.
T & operator[] (dword index)
 Access operator allowing access and modification of elements.
const T & operator[] (dword index) const
 Const Access operator allowing const access.
void add (const T &elem)
 Adds the element to the end of the vector.
void insert (dword index, const T &elem)
 Inserts an element at the given position in the vector.

Private Member Functions

void createData (void)
 Helper function for the creation of the dynamic data in the list.
void destroyData (void)
 Helper function for the destruction of the dynamic data in the list.
void copyData (const vuDVector &v)
 Copies the elements from the vector v to the instance.
void resizeData (dword size)
 Resizes the vector to the new size.

Private Attributes

dword m_Size
 the current size of the vector (including preallocated but not necessarily used elements)
dword m_Length
 the current length of the vector (last used element)
dword m_StepSize
 the current stepsize that is being used to expand the vector when the vector is expanded (note, this will change without warning).
T * m_Data
 the data buffer of the vector

Detailed Description

template<class T>
class vuDVector< T >

vuDVector is a templatized dynamic vector class for the volume tree.

That is lightweight and doesn't conflict with wxWindows or the standard library.

Definition at line 12 of file vuDVector.h.


Constructor & Destructor Documentation

template<class T>
vuDVector< T >::vuDVector  )  [inline]
 

Default constructor.

Definition at line 17 of file vuDVector.h.

template<class T>
vuDVector< T >::vuDVector const vuDVector< T > &  v  )  [inline]
 

Copy constructor that does a deep copy.

Definition at line 26 of file vuDVector.h.

template<class T>
vuDVector< T >::~vuDVector  )  [inline]
 

Destructor.

Definition at line 36 of file vuDVector.h.


Member Function Documentation

template<class T>
void vuDVector< T >::add const T &  elem  )  [inline]
 

Adds the element to the end of the vector.

Definition at line 191 of file vuDVector.h.

Referenced by vuTFDesignSpec::addLight(), vuConvexHull::addPoint(), vuTFDesign::clearAllNodes(), vuConvexHull::getCHull(), vuCamera::load(), vuCamera::load_cameras(), load_WithTime(), main(), vuConvexHull::mergeULHulls(), vuKeyFramerDialog::OnTakeShot(), vuKeyFramerDialog::OpenGIFile(), vuGuiParser::ParseButton(), vuGuiParser::ParseCheckBox(), vuGuiParser::ParseList(), vuGuiParser::ParseListBox(), vuGuiParser::ParseRadioBox(), vuGuiParser::ParseSlider(), vuConvexHull::setPoints(), vuConvexHull::sweepLine(), and vuTFDesign::vuTFDesign().

template<class T>
void vuDVector< T >::copyData const vuDVector< T > &  v  )  [inline, private]
 

Copies the elements from the vector v to the instance.

Definition at line 246 of file vuDVector.h.

template<class T>
void vuDVector< T >::createData void   )  [inline, private]
 

Helper function for the creation of the dynamic data in the list.

Definition at line 225 of file vuDVector.h.

template<class T>
void vuDVector< T >::destroyData void   )  [inline, private]
 

Helper function for the destruction of the dynamic data in the list.

Definition at line 232 of file vuDVector.h.

template<class T>
dword vuDVector< T >::findIndex const T &  elem  )  const [inline]
 

Returns the position of the element within the vector.

Definition at line 90 of file vuDVector.h.

template<class T>
dword vuDVector< T >::getLength void   )  const [inline]
 

Returns the length of the vector.

Vector length is the total number of data elements, which will be <= vector size.

Definition at line 75 of file vuDVector.h.

Referenced by vuTFDesign::addColour(), vuTFDesignSpec::addLight(), vuTFDesign::addOpacity(), vuConvexHull::addPoint(), vuConvexHull::angleThreshold(), vuKeyFramerDialog::BurstPlay(), vuKeyFramerDialog::BurstPlayGI(), vuCamera::clear_lines(), vuKeyFramerDialog::clear_vectors(), vuTFDesignSpec::clearAllNodes(), vuTFDesign::clearAllNodes(), vuConvexHull::clearPoints(), vuTFDesign::generateFunction(), vuTFDesignSpec::generateOpacities(), vuTFDesign::generateOpacities(), vuKeyFramerDialog::get_frame_number(), vuConvexHull::getCHull(), vuTFDesign::getNumColours(), vuTFDesignSpec::getNumLights(), vuTFDesign::getNumOpacities(), vuCamera::IsNextAvailable(), vuCamera::IsPreviousAvailable(), vuCamera::load_cameras(), load_WithTime(), vuKeyFramerDialog::LoadFunc(), vuConvexHull::mergeULHulls(), vuKeyFramerDialog::OnClose(), vuKeyFramerDialog::OnVideoClose(), operator<<(), vuGuiParser::ParseAPIs(), vuGuiParser::ParseButton(), vuGuiParser::ParseCheckBox(), vuGuiParser::ParseListBox(), vuGuiParser::ParseRadioBox(), vuGuiParser::ParseSlider(), vuKeyFramerDialog::PlayFromImages(), vuKeyFramerDialog::PlayFunc(), vuKeyFramerDialog::PlayInTime(), vuKeyFramerDialog::PlayNextFrame(), vuKeyFramerDialog::PlayNextImage(), vuKeyFramerDialog::RecordFunc(), vuHistogram::recordIntensity(), vuTFDesign::removeColour(), vuTFDesign::removeOpacity(), vuHistogram::reset(), vuKeyFramerDialog::SaveFunc(), vuTFDesignSpec::setAlphaByLight(), vuConvexHull::setPoints(), vuHistogram::setSize(), vuTFDesignSpec::setupMtlTriAlphaNodes(), vuConvexHull::sweepLine(), writeComment(), writeCreate(), vuGuiParser::WriteData(), writeIncludes(), writeIsAvailable(), writeListAvailable(), and vuKeyFramerDialog::~vuKeyFramerDialog().

template<class T>
dword vuDVector< T >::getSize void   )  const [inline]
 

Returns the size of the vector.

Definition at line 66 of file vuDVector.h.

template<class T>
dword vuDVector< T >::getStepSize void   )  const [inline]
 

Returns the step size of the vector.

Definition at line 52 of file vuDVector.h.

template<class T>
void vuDVector< T >::insert dword  index,
const T &  elem
[inline]
 

Inserts an element at the given position in the vector.

If inserting past the end of the list, the element is just added to the end.

Definition at line 200 of file vuDVector.h.

Referenced by vuTFDesign::addColour(), vuTFDesign::addOpacity(), and vuTFDesignSpec::setupMtlTriAlphaNodes().

template<class T>
bool vuDVector< T >::isMember const T &  elem  )  const [inline]
 

Returns true if the element is stored in the vector.

Definition at line 81 of file vuDVector.h.

Referenced by vuGuiParser::ParseButton(), vuGuiParser::ParseCheckBox(), vuGuiParser::ParseListBox(), vuGuiParser::ParseRadioBox(), vuGuiParser::ParseSlider(), and vuGuiParser::ParseStatement().

template<class T>
vuDVector<T>& vuDVector< T >::operator= const vuDVector< T > &  rhs  )  [inline]
 

Assignment operator which does a deep copy.

Definition at line 160 of file vuDVector.h.

template<class T>
const T& vuDVector< T >::operator[] dword  index  )  const [inline]
 

Const Access operator allowing const access.

Definition at line 185 of file vuDVector.h.

template<class T>
T& vuDVector< T >::operator[] dword  index  )  [inline]
 

Access operator allowing access and modification of elements.

Definition at line 175 of file vuDVector.h.

template<class T>
void vuDVector< T >::remove dword  index  )  [inline]
 

Removes the indexed element from the vector.

Definition at line 100 of file vuDVector.h.

Referenced by vuConvexHull::angleThreshold(), vuTFDesign::removeColour(), vuTFDesign::removeOpacity(), and vuConvexHull::sweepLine().

template<class T>
void vuDVector< T >::removeAll  )  [inline]
 

Removes all elements from the vector.

Definition at line 106 of file vuDVector.h.

Referenced by vuConvexHull::getCHull(), vuConvexHull::mergeULHulls(), and vuConvexHull::sweepLine().

template<class T>
void vuDVector< T >::removeRange dword  start,
dword  end
[inline]
 

Removes all the elements in the vector from start to end, inclusive.

The indices of all elements with indices j, such that (j>end) become (j-(end-start+1)). Length is decreased by (j-(end-start+1)), but the size of the vector is not altered.

Definition at line 117 of file vuDVector.h.

Referenced by vuCamera::clear_lines(), vuKeyFramerDialog::clear_vectors(), vuTFDesignSpec::clearAllNodes(), vuTFDesign::clearAllNodes(), vuConvexHull::clearPoints(), vuCamera::load_cameras(), load_WithTime(), vuKeyFramerDialog::LoadFunc(), vuKeyFramerDialog::OnClose(), vuKeyFramerDialog::OnVideoClose(), vuKeyFramerDialog::RecordFunc(), vuKeyFramerDialog::SaveFunc(), vuTFDesignSpec::setupMtlTriAlphaNodes(), and vuKeyFramerDialog::~vuKeyFramerDialog().

template<class T>
void vuDVector< T >::resizeData dword  size  )  [inline, private]
 

Resizes the vector to the new size.

Definition at line 258 of file vuDVector.h.

template<class T>
void vuDVector< T >::setSize dword  s  )  [inline]
 

Sets the size of the vector.

Vector size is the total allocated length of the vector.

Definition at line 60 of file vuDVector.h.

Referenced by vuHistogram::setSize().

template<class T>
void vuDVector< T >::setStepSize dword  s  )  [inline]
 

Sets the stepsize of the vector.

The vector is always clamped to a multiple of stepsize when it is increased.

Definition at line 46 of file vuDVector.h.

template<class T>
void vuDVector< T >::sizeToLength void   )  [inline]
 

Resize the vector to be the same size as the number of data elements stored in it.

Definition at line 148 of file vuDVector.h.

template<class T>
void vuDVector< T >::stepToLength void   )  [inline]
 

Resize the vector to be the multiple of the stepsize that is nearest to the length.

Definition at line 154 of file vuDVector.h.


Member Data Documentation

template<class T>
T* vuDVector< T >::m_Data [private]
 

the data buffer of the vector

Definition at line 307 of file vuDVector.h.

Referenced by vuDVector< LightNode >::copyData().

template<class T>
dword vuDVector< T >::m_Length [private]
 

the current length of the vector (last used element)

Definition at line 304 of file vuDVector.h.

Referenced by vuDVector< LightNode >::operator=(), and vuDVector< LightNode >::vuDVector().

template<class T>
dword vuDVector< T >::m_Size [private]
 

the current size of the vector (including preallocated but not necessarily used elements)

Definition at line 302 of file vuDVector.h.

Referenced by vuDVector< LightNode >::copyData(), vuDVector< LightNode >::operator=(), and vuDVector< LightNode >::vuDVector().

template<class T>
dword vuDVector< T >::m_StepSize [private]
 

the current stepsize that is being used to expand the vector when the vector is expanded (note, this will change without warning).

Definition at line 305 of file vuDVector.h.

Referenced by vuDVector< LightNode >::operator=(), and vuDVector< LightNode >::vuDVector().


The documentation for this class was generated from the following file:
Generated on Wed Dec 15 21:21:14 2004 for vuVolume by  doxygen 1.3.9.1