proj home

Files   Classes   Functions   Hierarchy  

meshpatchptr< T > Class Template Reference

Functional object to return control points, but can point to different mesh patches. More...

#include <meshpatchptr.h>

Collaboration diagram for meshpatchptr< T >:

List of all members.

Public Member Functions

void indexSet (uint *pi)
 Point to a patch.
T const operator() (uintc i, uintc j) const
 Read the value of the point.
Toperator() (uintc i, uintc j)
 Write to the point.
 meshpatchptr (T *pt_, uintc columns_)
 Pass in the global points pointer and the number of columns.
 ~meshpatchptr ()
 Memory cleanup.

Public Attributes

Tpt
 Global points.
uintindex
 By changing the index different patches are represented.
uintc columns
 The number of columns - N+1 in the patch.


Detailed Description

template<typename T>
class meshpatchptr< T >

Functional object to return control points, but can point to different mesh patches.

The index interprets the line of control points as a 2D matrix.

Initialize in construction phase. Use indexSet(...) to point to different mesh patches.

There is no error checking, for example on index bounds.

Definition at line 19 of file meshpatchptr.h.


Constructor & Destructor Documentation

template<typename T >
meshpatchptr< T >::meshpatchptr ( T pt_,
uintc  columns_ 
) [inline]

Pass in the global points pointer and the number of columns.

Definition at line 46 of file meshpatchptr.h.

00047     : pt(pt_), index(new uint[columns_]), columns(columns_) {}

template<typename T >
meshpatchptr< T >::~meshpatchptr (  )  [inline]

Memory cleanup.

Definition at line 50 of file meshpatchptr.h.

References meshpatchptr< T >::index.

00051     { delete[] index; }


Member Function Documentation

template<typename T >
void meshpatchptr< T >::indexSet ( uint pi  )  [inline]

Point to a patch.

Definition at line 34 of file meshpatchptr.h.

References meshpatchptr< T >::columns, and meshpatchptr< T >::index.

00035     { for (uint k=0; k<columns; ++k) index[k] = pi[k]; }

template<typename T >
T& meshpatchptr< T >::operator() ( uintc  i,
uintc  j 
) [inline]

Write to the point.

Definition at line 41 of file meshpatchptr.h.

References meshpatchptr< T >::columns, meshpatchptr< T >::index, and meshpatchptr< T >::pt.

00042     { return pt[ index[i+columns*j] ]; }

template<typename T >
T const meshpatchptr< T >::operator() ( uintc  i,
uintc  j 
) const [inline]

Read the value of the point.

Definition at line 38 of file meshpatchptr.h.

References meshpatchptr< T >::columns, meshpatchptr< T >::index, and meshpatchptr< T >::pt.

00039     { return pt[ index[i+columns*j] ]; }


Member Data Documentation

template<typename T >
uintc meshpatchptr< T >::columns

The number of columns - N+1 in the patch.

Definition at line 31 of file meshpatchptr.h.

Referenced by meshpatchptr< T >::indexSet(), and meshpatchptr< T >::operator()().

template<typename T >
uint* meshpatchptr< T >::index

By changing the index different patches are represented.

Definition at line 28 of file meshpatchptr.h.

Referenced by meshpatchptr< T >::indexSet(), meshpatchptr< T >::operator()(), and meshpatchptr< T >::~meshpatchptr().

template<typename T >
T* meshpatchptr< T >::pt

Global points.

Definition at line 24 of file meshpatchptr.h.

Referenced by meshpatchptr< T >::operator()().


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

Generated on Fri Mar 4 00:50:06 2011 for Chelton Evans Source by  doxygen 1.5.8