proj home

Files   Classes   Functions   Hierarchy  

simplexD2tessindexed< PT, PD, INDX > Class Template Reference

#include <simplexD2tessindexed.h>

Inheritance diagram for simplexD2tessindexed< PT, PD, INDX >:
Collaboration diagram for simplexD2tessindexed< PT, PD, INDX >:

List of all members.

Public Member Functions

 simplexD2tessindexed ()
 pts and vi have their first element as nulls.
void construct (PD const *points, INDX const pointsize, INDX const *triangles, INDX const trianglessize)
 From arrays build the vectors.
void windinganticlockwise ()
 Have an anti clockwise triangle winding.
 operator stringc () const
 Serialize this object.
void serializeInverse (stringc &s)
 Read in/construct an object.

Public Attributes

vector< PT > pts
 List of points.
vector< simplexD2indexed< INDX > > vi
 List of triangles.


Detailed Description

template<typename PT, typename PD, typename INDX>
class simplexD2tessindexed< PT, PD, INDX >

Definition at line 31 of file simplexD2tessindexed.h.


Constructor & Destructor Documentation

template<typename PT , typename PD , typename INDX >
simplexD2tessindexed< PT, PD, INDX >::simplexD2tessindexed (  )  [inline]

pts and vi have their first element as nulls.

Definition at line 138 of file simplexD2tessindexed.h.

References simplexD2tessindexed< PT, PD, INDX >::pts, and simplexD2tessindexed< PT, PD, INDX >::vi.

00139 {
00140   pts.push_back(PT());
00141   vi.push_back( simplexD2indexed<INDX>() );
00142 }


Member Function Documentation

template<typename PT , typename PD, typename INDX>
void simplexD2tessindexed< PT, PD, INDX >::construct ( PD const *  points,
INDX const   pointsize,
INDX const *  triangles,
INDX const   trianglessize 
) [inline]

From arrays build the vectors.

Definition at line 163 of file simplexD2tessindexed.h.

References pts, vectorreadingD2(), and vectorreadingD3().

Referenced by simplexD2tessindexedtest::test01().

00169 {
00170   vectorreadingD2(pts,points,pointsize);
00171   vectorreadingD3(vi,triangles,trianglessize);
00172 }

template<typename PT , typename PD , typename INDX >
simplexD2tessindexed< PT, PD, INDX >::operator stringc (  )  const [inline]

Serialize this object.

Definition at line 145 of file simplexD2tessindexed.h.

References simplexD2tessindexed< PT, PD, INDX >::pts, and simplexD2tessindexed< PT, PD, INDX >::vi.

00146 {
00147   stringstream ss;
00148   
00149   uint imax = pts.size();
00150   ss << imax << "\n";
00151   for (uint i=0; i<imax; ++i)
00152     ss << pts[i] << "\n";
00153   imax = vi.size();
00154   ss << imax << "\n";
00155   for (uint i=0; i<imax; ++i)
00156     ss << vi[i] << "\n";
00157 
00158   return ss.str();
00159 }

template<typename PT , typename PD , typename INDX >
void simplexD2tessindexed< PT, PD, INDX >::serializeInverse ( stringc s  )  [inline]

Read in/construct an object.

Definition at line 69 of file simplexD2tessindexed.h.

References simplexD2tessindexed< PT, PD, INDX >::pts, tokenizer::readaslinesgeneral(), tokenizer::reset(), and simplexD2tessindexed< PT, PD, INDX >::vi.

Referenced by simplexD2tessindexedtest::test02(), simplexD2tessapp01::test02(), and simplexD2tessindexedtest::test03().

00070 {
00071   pts.clear();
00072   vi.clear();
00073 
00074   tokenizer tokenstream;
00075   tokenstream.readaslinesgeneral(s);
00076 
00077 /*
00078   tokenstream.readaslines(s);
00079   tokenstream.subtract(",");
00080   tokenstream.subtract(" ");
00081 
00082 //  tokenstream.printdelimiter="*";
00083 //  cout << tokenstream << endl;
00084 
00085 //  cout << endl << endl;
00086 
00087   // Remove leading and trailing space.
00088   tokenstream.trim();
00089   // Delete empty tokens.
00090   tokenstream.remove_if();
00091 
00092 //cout << tokenstream << endl;
00093 */
00094 
00095 
00096 
00097   tokenstream.reset();
00098   uint ptssize;
00099   stringstream(tokenstream()) >> ptssize;
00100   ++tokenstream;
00101 //cout << "ptssize=" << ptssize << endl;
00102 
00103   PD x,y;
00104   for (uint i=0; i<ptssize; ++i)
00105   {
00106     
00107     stringstream(tokenstream()) >> x;
00108     ++tokenstream;
00109     stringstream(tokenstream()) >> y;
00110     ++tokenstream;
00111 //cout << "x=" << x << " y=" << y << endl;
00112     pts.push_back( PT(x,y) );
00113   }
00114 
00115   uint visize;
00116   stringstream(tokenstream()) >> visize;
00117   ++tokenstream;
00118 //cout << "visize=" << visize << endl;
00119   INDX a,b,c;
00120   for (uint i=0; i<visize; ++i)
00121   {
00122     stringstream(tokenstream()) >> a;
00123     ++tokenstream;
00124     stringstream(tokenstream()) >> b;
00125     ++tokenstream;
00126     stringstream(tokenstream()) >> c;
00127     ++tokenstream;
00128 //cout << "a=" << a << " b=" << b << " c=" << c << endl;
00129 
00130     vi.push_back( simplexD2indexed<INDX>(a,b,c) );
00131   }
00132 
00133 }

template<typename PT , typename PD , typename INDX >
void simplexD2tessindexed< PT, PD, INDX >::windinganticlockwise (  )  [inline]

Have an anti clockwise triangle winding.

Definition at line 176 of file simplexD2tessindexed.h.

Referenced by simplexD2tessapp01::test02(), and simplexD2tessindexedtest::test03().

00177 {
00178   tessD2misc
00179   <
00180     simplexD2tessindexed<PT,PD,INDX>,
00181     PT,
00182     INDX 
00183   > tm(*this);
00184   tm.windinganticlockwise();
00185 }


Member Data Documentation

template<typename PT, typename PD, typename INDX>
vector< PT > simplexD2tessindexed< PT, PD, INDX >::pts

template<typename PT, typename PD, typename INDX>
vector< simplexD2indexed<INDX> > simplexD2tessindexed< PT, PD, INDX >::vi


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

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