proj home

Files   Classes   Functions   Hierarchy  

regionD2tess< Vreg, Vpts, Indx > Class Template Reference

Tessellation of linked regions. More...

#include <regionD2tess.h>

Collaboration diagram for regionD2tess< Vreg, Vpts, Indx >:

List of all members.

Public Member Functions

 regionD2tess (Vreg _vi, Vpts _pts)
 A tessellation is composed of regions and points.
boolc verify () const
 Verify the regions are connected.
void print () const
 Print out the tessellation to cout.
void printnumbered () const
 Print out the tessellation with numbering on left side to cout.

Public Attributes

Vreg vi
 Vector of region indexes to the points.
Vpts pts
 Vector of points.


Detailed Description

template<typename Vreg, typename Vpts, typename Indx = unsigned int>
class regionD2tess< Vreg, Vpts, Indx >

Tessellation of linked regions.

vi and pts are vectors.

Through the template parameters the client can control memory of the vectors, for example Vreg could be a vector holding the regions and Vpts a reference to the points.

Definition at line 22 of file regionD2tess.h.


Constructor & Destructor Documentation

template<typename Vreg, typename Vpts, typename Indx = unsigned int>
regionD2tess< Vreg, Vpts, Indx >::regionD2tess ( Vreg  _vi,
Vpts  _pts 
) [inline]

A tessellation is composed of regions and points.

Definition at line 33 of file regionD2tess.h.

00034     : vi(_vi), pts(_pts) {}


Member Function Documentation

template<typename Vreg , typename Vpts , typename Indx >
void regionD2tess< Vreg, Vpts, Indx >::print (  )  const [inline]

Print out the tessellation to cout.

Definition at line 76 of file regionD2tess.h.

References regionD2linked< Indx >::isnull(), and regionD2tess< Vreg, Vpts, Indx >::vi.

Referenced by regionD2linkedtest::test01().

00077 {
00078   Indx const imax = vi.size();
00079   for (Indx i=0; i<imax; ++i)
00080   {
00081     regionD2linked<Indx> & reg(vi[i]);
00082     if (reg.isnull())
00083       continue;
00084 
00085     cout << (string)reg << endl;
00086   }
00087 }

template<typename Vreg , typename Vpts , typename Indx >
void regionD2tess< Vreg, Vpts, Indx >::printnumbered (  )  const [inline]

Print out the tessellation with numbering on left side to cout.

Definition at line 52 of file regionD2tess.h.

References regionD2linked< Indx >::isnull(), and regionD2tess< Vreg, Vpts, Indx >::vi.

00053 {
00054   // Preserve and later restore the setting.
00055   bool writesize = regionD2linked<Indx>::writesize;
00056   regionD2linked<Indx>::writesize = false;
00057 
00058   Indx const imax = vi.size();
00059   for (Indx i=0; i<imax; ++i)
00060   {
00061     cout << i << "  ";
00062     regionD2linked<Indx> & reg(vi[i]);
00063     if (reg.isnull())
00064     {
00065       cout << endl;
00066       continue;
00067     }
00068 
00069     cout << (string)reg << endl;
00070   }
00071 
00072   regionD2linked<Indx>::writesize = writesize;
00073 }

template<typename Vreg , typename Vpts , typename Indx >
boolc regionD2tess< Vreg, Vpts, Indx >::verify (  )  const [inline]

Verify the regions are connected.

Definition at line 90 of file regionD2tess.h.

References regionD2linked< Indx >::isnull(), pnlinkiter< Indx >::reset(), regionD2linked< Indx >::start, and regionD2tess< Vreg, Vpts, Indx >::vi.

Referenced by regionD2linkedtest::test01().

00091 {
00092   Indx const imax = vi.size();
00093   for (Indx i=0; i<imax; ++i)
00094   {
00095     regionD2linked<Indx> & reg(vi[i]);
00096     if (reg.isnull())
00097       continue;
00098 
00099     pnlinkiter<Indx> k(reg.start);
00100     for ( k.reset(); !k; ++k )
00101     {
00102       if (k->nlink>imax)
00103         return false;
00104       if (vi[k->nlink].start->niInverse(i) == 0)
00105         return false;
00106     }
00107   }
00108 
00109   return true;
00110 }


Member Data Documentation

template<typename Vreg, typename Vpts, typename Indx = unsigned int>
Vpts regionD2tess< Vreg, Vpts, Indx >::pts

Vector of points.

Definition at line 30 of file regionD2tess.h.

template<typename Vreg, typename Vpts, typename Indx = unsigned int>
Vreg regionD2tess< Vreg, Vpts, Indx >::vi


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

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