proj home

Files   Classes   Functions   Hierarchy  

meshpatch Class Reference

Rectangular bezier patch. More...

#include <meshpatch.h>

Collaboration diagram for meshpatch:

List of all members.

Public Member Functions

 meshpatch (uintc M_, uintc N_)
 Build a mesh patch with bernstein polynomials.
 ~meshpatch ()
 Memory cleanup.
template<typename T , typename W >
void eval (T &p, double const u, double const v, W const &pij) const
 Evaluate an actual patch.

Public Attributes

uintc M
 The number of points on the u-axis.
uintc N
 The number of points of the v-axis.

Protected Attributes

bernsteinPoly *const vbu
bernsteinPoly *const vbv
double *const vbuval
double *const vbvval


Detailed Description

Rectangular bezier patch.

This is a generalization of a patch. The client evaluates patches with a functional object pij in eval.

Definition at line 17 of file meshpatch.h.


Constructor & Destructor Documentation

meshpatch::meshpatch ( uintc  M_,
uintc  N_ 
)

Build a mesh patch with bernstein polynomials.

Definition at line 4 of file meshpatch.cpp.

References M, N, vbu, and vbv.

00005   : M(M_), N(N_), vbu(new bernsteinPoly[M+1]), vbv(new bernsteinPoly[N+1]), 
00006   vbuval(new double[M+1]), vbvval(new double[N+1])
00007 {
00008   for (uint i=0; i<=M; ++i)
00009     vbu[i].construct(M,i);
00010   for (uint i=0; i<=N; ++i)
00011     vbv[i].construct(N,i);
00012 }

meshpatch::~meshpatch (  ) 

Memory cleanup.

Definition at line 15 of file meshpatch.cpp.

References vbu, vbuval, vbv, and vbvval.

00016 {
00017   delete[] vbu;
00018   delete[] vbv;
00019   delete[] vbuval;
00020   delete[] vbvval;
00021 }


Member Function Documentation

template<typename T , typename W >
void meshpatch::eval ( T p,
double const   u,
double const   v,
W const &  pij 
) const [inline]

Evaluate an actual patch.

Definition at line 44 of file meshpatch.h.

References M, N, vbu, vbuval, vbv, and vbvval.

Referenced by meshpatchtest::test01(), and pointgrid3Dbilineardraw::update().

00050   {
00051     for (uint i=0; i<=M; ++i)
00052       vbuval[i] = vbu[i].eval(u);
00053 
00054     for (uint i=0; i<=N; ++i)
00055       vbvval[i] = vbv[i].eval(v);
00056 
00057     p = T();
00058     T p2;
00059     uint k;
00060     for (uint i=0; i<=M; ++i)
00061     {
00062       T p2;
00063       for (k=0; k<=N; ++k)
00064         p2 += pij(i,k)*vbvval[k];
00065 
00066       p += p2*vbuval[i];
00067     }
00068   }


Member Data Documentation

The number of points on the u-axis.

Definition at line 22 of file meshpatch.h.

Referenced by eval(), and meshpatch().

The number of points of the v-axis.

Definition at line 24 of file meshpatch.h.

Referenced by eval(), and meshpatch().

bernsteinPoly* const meshpatch::vbu [protected]

Definition at line 27 of file meshpatch.h.

Referenced by eval(), meshpatch(), and ~meshpatch().

double* const meshpatch::vbuval [protected]

Definition at line 30 of file meshpatch.h.

Referenced by eval(), and ~meshpatch().

bernsteinPoly* const meshpatch::vbv [protected]

Definition at line 28 of file meshpatch.h.

Referenced by eval(), meshpatch(), and ~meshpatch().

double* const meshpatch::vbvval [protected]

Definition at line 31 of file meshpatch.h.

Referenced by eval(), and ~meshpatch().


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

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