proj home

Files   Classes   Functions   Hierarchy  

simplexD1tessindexed< PT, PD, INDX > Class Template Reference

A 1D tessellation of indexed lines. More...

#include <simplexD1tessindexed.h>

Collaboration diagram for simplexD1tessindexed< PT, PD, INDX >:

List of all members.

Public Member Functions

 simplexD1tessindexed ()
 pts and vi have their first element as nulls.
void construct (PD const *points, INDX const pointsize, INDX const *lines, INDX const linessize)
 From arrays build the vectors.
 operator stringc () const
 Serialize this object.
void serializeInverse (stringc &s)
 Read in/construct an object.
boolc operator== (simplexD1tessindexed< PT, PD, INDX > const &s2) const
 simplexD2tessindexed ()
 pts and vi have their first element as nulls.
void construct (PTS points, INDX const pointsize, INDX const *lines, INDX const linessize)
 From arrays build the vectors.
 operator stringc () const
 Serialize this object.
void serializeInverse (stringc &s)
 Read in/construct an object.

Public Attributes

vector< PT > pts
 List of points.
vector< simplexD1indexed< INDX > > vi
 List of triangles.
PTS pts
 List of points.
VI vi
 List of triangles.


Detailed Description

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

A 1D tessellation of indexed lines.

Serialization
number of points+1
0.0 0.0
x y 
...
number of lines+1 
0 0
a b 
...

Definition at line 31 of file simplexD1tessindexed.h.


Constructor & Destructor Documentation

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

pts and vi have their first element as nulls.

Definition at line 97 of file simplexD1tessindexed.h.

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

00098 {
00099   pts.push_back(PT());
00100   vi.push_back( simplexD1indexed<INDX>() );
00101 }


Member Function Documentation

template<typename PT, typename PD, typename INDX>
void simplexD1tessindexed< PT, PD, INDX >::construct ( PTS  points,
INDX const   pointsize,
INDX const *  lines,
INDX const   linessize 
)

From arrays build the vectors.

template<typename PT , typename PD , typename INDX >
void simplexD1tessindexed< PT, PD, INDX >::construct ( PD const *  points,
INDX const   pointsize,
INDX const *  lines,
INDX const   linessize 
) [inline]

From arrays build the vectors.

Definition at line 169 of file simplexD1tessindexed.h.

References pts, and vectorreadingD2().

Referenced by simplexD1tessindexedtest::test01().

00175 {
00176   vectorreadingD2(pts,points,pointsize);
00177   vectorreadingD2(vi,lines,linessize);
00178 }

template<typename PT, typename PD, typename INDX>
simplexD1tessindexed< PT, PD, INDX >::operator stringc (  )  const

Serialize this object.

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

Serialize this object.

Definition at line 150 of file simplexD1tessindexed.h.

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

00151 {
00152   stringstream ss;
00153   
00154   uint imax = pts.size();
00155   ss << imax << "\n";
00156   for (uint i=0; i<imax; ++i)
00157     ss << pts[i] << "\n";
00158   imax = vi.size();
00159   ss << imax << "\n";
00160   for (uint i=0; i<imax; ++i)
00161     ss << vi[i] << "\n";
00162 
00163   return ss.str();
00164 }

template<typename PT, typename PD, typename INDX>
boolc simplexD1tessindexed< PT, PD, INDX >::operator== ( simplexD1tessindexed< PT, PD, INDX > const &  s2  )  const [inline]

Definition at line 58 of file simplexD1tessindexed.h.

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

00059   {
00060 //cout << "Tesing sizes" << endl;
00061 //cout << SHOW(pts.size()) << endl;
00062 //cout << SHOW(s2.pts.size()) << endl;
00063     if (pts.size()!=s2.pts.size())
00064       return false;
00065 
00066     if (vi.size()!=s2.vi.size())
00067       return false;
00068 
00069 //cout << "Checking points" << endl;
00070     for (uint i=0; i<pts.size(); ++i)
00071     {
00072       if (pts[i]!=s2.pts[i])
00073         return false;
00074     }
00075 //cout << "Checking indexes" << endl;
00076     for (uint i=0; i<vi.size(); ++i)
00077     {
00078       if (!(vi[i]==s2.vi[i]))
00079         return false;
00080     }
00081  
00082     return true;
00083   }

template<typename PT, typename PD, typename INDX>
void simplexD1tessindexed< PT, PD, INDX >::serializeInverse ( stringc s  ) 

Read in/construct an object.

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

Read in/construct an object.

Definition at line 105 of file simplexD1tessindexed.h.

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

Referenced by simplexD1tessapp01::simplexD1tessapp01(), simplexD1tessindexedtest::test02(), and simplexD1tessindexedtest::unittest01().

00106 {
00107   pts.clear();
00108   vi.clear();
00109 
00110   tokenizer tokenstream;
00111   tokenstream.readaslinesgeneral(s);
00112 
00113   tokenstream.reset();
00114   uint ptssize;
00115   stringstream(tokenstream()) >> ptssize;
00116   ++tokenstream;
00117 //cout << "ptssize=" << ptssize << endl;
00118 
00119   PD x,y;
00120   for (uint i=0; i<ptssize; ++i)
00121   {
00122     stringstream(tokenstream()) >> x;
00123     ++tokenstream;
00124     stringstream(tokenstream()) >> y;
00125     ++tokenstream;
00126 //cout << "x=" << x << " y=" << y << endl;
00127     pts.push_back( PT(x,y) );
00128   }
00129 
00130   uint visize;
00131   stringstream(tokenstream()) >> visize;
00132   ++tokenstream;
00133 //cout << "visize=" << visize << endl;
00134   INDX a,b;
00135   for (uint i=0; i<visize; ++i)
00136   {
00137     stringstream(tokenstream()) >> a;
00138     ++tokenstream;
00139     stringstream(tokenstream()) >> b;
00140     ++tokenstream;
00141 //cout << "a=" << a << " b=" << b << " c=" << c << endl;
00142 
00143     vi.push_back( simplexD1indexed<INDX>(a,b) );
00144   }
00145 
00146 }

template<typename PT, typename PD, typename INDX>
simplexD1tessindexed< PT, PD, INDX >::simplexD2tessindexed (  ) 

pts and vi have their first element as nulls.


Member Data Documentation

template<typename PT, typename PD, typename INDX>
PTS simplexD1tessindexed< PT, PD, INDX >::pts

List of points.

Definition at line 18 of file simplexD1tesslinked.h.

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

template<typename PT, typename PD, typename INDX>
VI simplexD1tessindexed< PT, PD, INDX >::vi

List of triangles.

Definition at line 20 of file simplexD1tesslinked.h.

template<typename PT, typename PD, typename INDX>
vector< simplexD1indexed<INDX> > simplexD1tessindexed< PT, PD, INDX >::vi


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

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