proj home

Files   Classes   Functions   Hierarchy  

regionD2linked< Indx > Class Template Reference

#include <regionD2linked.h>

Collaboration diagram for regionD2linked< Indx >:

List of all members.

Public Types

typedef pnlink< Indx > link
typedef Indx const Indxc

Public Member Functions

 regionD2linked ()
 regionD2linked (Indxc p0, Indxc p1, Indxc n0, Indxc n1)
 regionD2linked (Indx p0, Indx p1, Indx p2, Indx n0, Indx n1, Indx n2)
 regionD2linked (Indx p0, Indx p1, Indx p2, Indx p3, Indx n0, Indx n1, Indx n2, Indx n3)
 regionD2linked (Indx p0, Indx p1, Indx p2, Indx p3, Indx p4, Indx n0, Indx n1, Indx n2, Indx n3, Indx n4)
 regionD2linked (Indx p0, Indx p1, Indx p2, Indx p3, Indx p4, Indx p5, Indx n0, Indx n1, Indx n2, Indx n3, Indx n4, Indx n5)
 regionD2linked (Indx p0, Indx p1, Indx p2, Indx p3, Indx p4, Indx p5, Indx p6, Indx n0, Indx n1, Indx n2, Indx n3, Indx n4, Indx n5, Indx n6)
 regionD2linked (Indx p0, Indx p1, Indx p2, Indx p3, Indx p4, Indx p5, Indx p6, Indx p7, Indx n0, Indx n1, Indx n2, Indx n3, Indx n4, Indx n5, Indx n6, Indx n7)
void vec (vector< Indx > &pi, vector< Indx > &ni) const
 Write this region as vectors.
 operator string () const
 Write the object out.
boolc isnull () const
 Is the region constructed?
boolc add (Indx ptindex, Indx p0)
 Find the point ptindx and add new link copying its neighbor.

Public Attributes

linkstart
 A point in the circular list.

Static Public Attributes

static bool writesize = true
 When writing the string out if true write the size first.


Detailed Description

template<typename Indx>
class regionD2linked< Indx >

Definition at line 14 of file regionD2linked.h.


Member Typedef Documentation

template<typename Indx>
typedef Indx const regionD2linked< Indx >::Indxc

Definition at line 19 of file regionD2linked.h.

template<typename Indx>
typedef pnlink<Indx> regionD2linked< Indx >::link

Definition at line 18 of file regionD2linked.h.


Constructor & Destructor Documentation

template<typename Indx >
regionD2linked< Indx >::regionD2linked (  )  [inline]

Definition at line 80 of file regionD2linked.h.

00081   : start(0) {}

template<typename Indx>
regionD2linked< Indx >::regionD2linked ( Indxc  p0,
Indxc  p1,
Indxc  n0,
Indxc  n1 
) [inline]

Definition at line 27 of file regionD2linked.h.

References regionD2linked< Indx >::start.

00028     { start = new link(p0,p1,n0,n1); }

template<typename Indx>
regionD2linked< Indx >::regionD2linked ( Indx  p0,
Indx  p1,
Indx  p2,
Indx  n0,
Indx  n1,
Indx  n2 
) [inline]

Definition at line 30 of file regionD2linked.h.

References regionD2linked< Indx >::start.

00032     { start = new link(p0,p1,p2,n0,n1,n2); }

template<typename Indx>
regionD2linked< Indx >::regionD2linked ( Indx  p0,
Indx  p1,
Indx  p2,
Indx  p3,
Indx  n0,
Indx  n1,
Indx  n2,
Indx  n3 
) [inline]

Definition at line 33 of file regionD2linked.h.

References regionD2linked< Indx >::start.

00035     { start = new link(p0,p1,p2,p3,n0,n1,n2,n3); }

template<typename Indx>
regionD2linked< Indx >::regionD2linked ( Indx  p0,
Indx  p1,
Indx  p2,
Indx  p3,
Indx  p4,
Indx  n0,
Indx  n1,
Indx  n2,
Indx  n3,
Indx  n4 
) [inline]

Definition at line 36 of file regionD2linked.h.

References regionD2linked< Indx >::start.

00038     { start = new link(p0,p1,p2,p3,p4,n0,n1,n2,n3,n4); }

template<typename Indx>
regionD2linked< Indx >::regionD2linked ( Indx  p0,
Indx  p1,
Indx  p2,
Indx  p3,
Indx  p4,
Indx  p5,
Indx  n0,
Indx  n1,
Indx  n2,
Indx  n3,
Indx  n4,
Indx  n5 
) [inline]

Definition at line 39 of file regionD2linked.h.

References regionD2linked< Indx >::start.

00041     { start = new link(p0,p1,p2,p3,p4,p5,n0,n1,n2,n3,n4,n5); }

template<typename Indx>
regionD2linked< Indx >::regionD2linked ( Indx  p0,
Indx  p1,
Indx  p2,
Indx  p3,
Indx  p4,
Indx  p5,
Indx  p6,
Indx  n0,
Indx  n1,
Indx  n2,
Indx  n3,
Indx  n4,
Indx  n5,
Indx  n6 
) [inline]

Definition at line 42 of file regionD2linked.h.

References regionD2linked< Indx >::start.

00044     { start = new link(p0,p1,p2,p3,p4,p5,p6,n0,n1,n2,n3,n4,n5,n6); }

template<typename Indx>
regionD2linked< Indx >::regionD2linked ( Indx  p0,
Indx  p1,
Indx  p2,
Indx  p3,
Indx  p4,
Indx  p5,
Indx  p6,
Indx  p7,
Indx  n0,
Indx  n1,
Indx  n2,
Indx  n3,
Indx  n4,
Indx  n5,
Indx  n6,
Indx  n7 
) [inline]

Definition at line 45 of file regionD2linked.h.

References regionD2linked< Indx >::start.

00047     { start = new link(p0,p1,p2,p3,p4,p5,p6,p7,n0,n1,n2,n3,n4,n5,n6,n7); }


Member Function Documentation

template<typename Indx>
boolc regionD2linked< Indx >::add ( Indx  ptindex,
Indx  p0 
) [inline]

Find the point ptindx and add new link copying its neighbor.

Definition at line 64 of file regionD2linked.h.

References pnlink< Indx >::add(), and regionD2linked< Indx >::start.

00065     { assert(start!=0); return start->add(ptindex,p0); }

template<typename Indx>
boolc regionD2linked< Indx >::isnull (  )  const [inline]

template<typename Indx >
regionD2linked< Indx >::operator string (  )  const [inline]

Write the object out.

Definition at line 85 of file regionD2linked.h.

References regionD2linked< Indx >::vec(), and regionD2linked< Indx >::writesize.

00086 {
00087   vector<Indx> pi;
00088   vector<Indx> ni;
00089   vec(pi,ni);
00090 
00091   string s;
00092   uint sz = pi.size();
00093   if (writesize)
00094   { 
00095     stringstream ss; 
00096     ss << sz; 
00097     s+=ss.str(); 
00098     s += "  "; 
00099   }
00100   for (uint i=0; i<sz; ++i)
00101   {
00102     { stringstream ss; ss << pi[i]; s+=ss.str(); }
00103     s += " ";
00104   }
00105 
00106   s += "  ";
00107 
00108   for (uint i=0; i<sz; ++i)
00109   {
00110     { stringstream ss; ss << ni[i]; s+=ss.str(); }
00111     s += " ";
00112   }
00113 
00114   return s;
00115 }

template<typename Indx >
void regionD2linked< Indx >::vec ( vector< Indx > &  pi,
vector< Indx > &  ni 
) const [inline]

Write this region as vectors.

Definition at line 121 of file regionD2linked.h.

References pnlink< Indx >::next, pnlink< Indx >::nlink, and pnlink< Indx >::plink.

Referenced by regionD2linked< Indx >::operator string().

00125 {
00126   pi.clear();
00127   ni.clear();
00128 
00129   if (start==0)
00130     return;
00131 
00132   pi.push_back(start->plink);
00133   ni.push_back(start->nlink);
00134   
00135   link const * current = start->next;
00136   for ( ; current!=start; current=current->next )
00137   {
00138     pi.push_back(current->plink);
00139     ni.push_back(current->nlink);
00140   }
00141 }


Member Data Documentation

template<typename Indx>
link* regionD2linked< Indx >::start

template<typename Indx>
bool regionD2linked< Indx >::writesize = true [inline, static]

When writing the string out if true write the size first.

Definition at line 54 of file regionD2linked.h.

Referenced by regionD2linked< Indx >::operator string().


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