proj home

Files   Classes   Functions   Hierarchy  

func2Dovervec3D< T > Class Template Reference

Apply a 2D function to each element in a primitive vector of 3D points. More...

#include <func2dovervec3d.h>

Collaboration diagram for func2Dovervec3D< T >:

List of all members.

Public Member Functions

 func2Dovervec3D (T *pt_, uintc size_)
 Initialize the vector.
template<typename F >
void evalX (F &fn)
 The y and z axes are the surface.
template<typename F >
void evalY (F &fn)
 The x and z axes are the surface.
template<typename F >
void evalZ (F &fn)
 The x and y axes are the surface.

Public Attributes

T *const pt
 The primitive vector.
uintc size
 The size of pt.


Detailed Description

template<typename T>
class func2Dovervec3D< T >

Apply a 2D function to each element in a primitive vector of 3D points.

The class is first instantiated, then apply the function to the choosen dimension.

The function is passed as a functional object which writes to the first argument and reads the values of the next to as the surface.

Definition at line 18 of file func2dovervec3d.h.


Constructor & Destructor Documentation

template<typename T >
func2Dovervec3D< T >::func2Dovervec3D ( T pt_,
uintc  size_ 
) [inline]

Initialize the vector.

Definition at line 28 of file func2dovervec3d.h.

00029     : pt(pt_), size(size_) {}


Member Function Documentation

template<typename T >
template<typename F >
void func2Dovervec3D< T >::evalX ( F &  fn  )  [inline]

The y and z axes are the surface.

Definition at line 33 of file func2dovervec3d.h.

References func2Dovervec3D< T >::pt, and func2Dovervec3D< T >::size.

00034   {
00035     for (uint i=0; i<size; ++i)
00036       fn(pt[i].x,pt[i].y,pt[i].z);
00037   }

template<typename T >
template<typename F >
void func2Dovervec3D< T >::evalY ( F &  fn  )  [inline]

The x and z axes are the surface.

Definition at line 41 of file func2dovervec3d.h.

References func2Dovervec3D< T >::pt, and func2Dovervec3D< T >::size.

00042   {
00043     for (uint i=0; i<size; ++i)
00044       fn(pt[i].y,pt[i].x,pt[i].z);
00045   }

template<typename T >
template<typename F >
void func2Dovervec3D< T >::evalZ ( F &  fn  )  [inline]

The x and y axes are the surface.

Definition at line 49 of file func2dovervec3d.h.

References func2Dovervec3D< T >::pt, and func2Dovervec3D< T >::size.

00050   {
00051     for (uint i=0; i<size; ++i)
00052       fn(pt[i].z,pt[i].x,pt[i].y);
00053   }


Member Data Documentation

template<typename T >
T* const func2Dovervec3D< T >::pt

The primitive vector.

Definition at line 23 of file func2dovervec3d.h.

Referenced by func2Dovervec3D< T >::evalX(), func2Dovervec3D< T >::evalY(), and func2Dovervec3D< T >::evalZ().

template<typename T >
uintc func2Dovervec3D< T >::size

The size of pt.

Definition at line 25 of file func2dovervec3d.h.

Referenced by func2Dovervec3D< T >::evalX(), func2Dovervec3D< T >::evalY(), and func2Dovervec3D< T >::evalZ().


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

Generated on Fri Mar 4 00:49:57 2011 for Chelton Evans Source by  doxygen 1.5.8