Files Classes Functions Hierarchy
#include <polytopeD2tess.h>
Public Member Functions | |
| polytopeD2tess (VPOLY &vi_, VPTS &pts_) | |
| Initialize the polytope vector and global points. | |
| boolc | verify (uintc k) const |
| Test the k'th polytope. | |
| boolc | verify () const |
| Test all the polytopes. | |
| void | addpoint (uintc k, uintc ptindex, uintc ptglobal) |
| Add to the k'th polytope a new point. | |
| void | printvi () const |
| Print the tessellation. | |
Public Attributes | |
| VPOLY & | vi |
| Vector of polytopes indexes to the points. | |
| VPTS & | pts |
| Vector of points. | |
Definition at line 7 of file polytopeD2tess.h.
| polytopeD2tess< VPOLY, VPTS >::polytopeD2tess | ( | VPOLY & | vi_, | |
| VPTS & | pts_ | |||
| ) | [inline] |
| void polytopeD2tess< VPOLY, VPTS >::addpoint | ( | uintc | k, | |
| uintc | ptindex, | |||
| uintc | ptglobal | |||
| ) | [inline] |
Add to the k'th polytope a new point.
The neighbors link is also updated.
Definition at line 95 of file polytopeD2tess.h.
References polytopeD2linked::addpoint(), and pts.
Referenced by polytopesD2linkedtest::test02().
00100 { 00101 assert(k<vi.size()); 00102 assert(ptindex<pts.size()); 00103 assert(ptglobal<pts.size()); 00104 00105 polytopeD2linked & A(vi[k]); 00106 00107 //cout << SHOW(k) << endl; 00108 //cout << SHOW(ptindex) << endl; 00109 uintc j = A.piInverse(ptindex); 00110 uintc neib = A.ni[j]; 00111 uint i = (j+1) % A.pi.size(); 00112 //cout << SHOW(i) << endl; 00113 //cout << SHOW(neib) << endl; 00114 // Has the polygon got a neighbor? 00115 if (neib!=0) 00116 { 00117 uintc ptindex2 = A.pi[i]; 00118 //cout << SHOW(ptindex2) << endl; 00119 polytopeD2linked & B(vi[neib]); 00120 B.addpoint(ptindex2,ptglobal); 00121 } 00122 00123 A.addpoint(ptindex,ptglobal); 00124 }
| void polytopeD2tess< VPOLY, VPTS >::printvi | ( | ) | const [inline] |
Print the tessellation.
Definition at line 42 of file polytopeD2tess.h.
References polytopeD2tess< VPOLY, VPTS >::vi.
Referenced by polytopesD2linkedtest::test02().
| boolc polytopeD2tess< VPOLY, VPTS >::verify | ( | ) | const [inline] |
Test all the polytopes.
Definition at line 49 of file polytopeD2tess.h.
References polytopeD2tess< VPOLY, VPTS >::vi.
00050 { 00051 uintc imax = vi.size(); 00052 for (uint i=0; i<imax; ++i) 00053 { 00054 if (verify(i)==false) 00055 return false; 00056 } 00057 00058 return true; 00059 }
| boolc polytopeD2tess< VPOLY, VPTS >::verify | ( | uintc | k | ) | const [inline] |
Test the k'th polytope.
Definition at line 62 of file polytopeD2tess.h.
References polytopeD2linked::isnull(), polytopeD2linked::ni, polytopeD2linked::pi, and polytopeD2tess< VPOLY, VPTS >::vi.
Referenced by polytopesD2linkedtest::test01(), and polytopesD2linkedtest::test02().
00063 { 00064 polytopeD2linked const & x(vi[k]); 00065 if (x.isnull()) 00066 return true; 00067 00068 uintc sz = x.ni.size(); 00069 assert(x.pi.size()==sz); 00070 if (x.pi.size()!=sz) 00071 return false; 00072 00073 uint nicurrent; 00074 for (uint i=0; i<sz; ++i) 00075 { 00076 nicurrent=x.ni[i]; 00077 if (nicurrent==0) 00078 continue; 00079 00080 assert(nicurrent<vi.size()); 00081 if ((nicurrent<vi.size())==false) 00082 return false; 00083 00084 assert(vi[nicurrent].niInverseHas(k)==true); 00085 if (vi[nicurrent].niInverseHas(k)==false) 00086 return false; 00087 } 00088 00089 return true; 00090 }
| VPTS& polytopeD2tess< VPOLY, VPTS >::pts |
| VPOLY& polytopeD2tess< VPOLY, VPTS >::vi |
Vector of polytopes indexes to the points.
Definition at line 12 of file polytopeD2tess.h.
Referenced by polytopeD2tess< VPOLY, VPTS >::printvi(), and polytopeD2tess< VPOLY, VPTS >::verify().
1.5.8