Files Classes Functions Hierarchy
#include <pnlink.h>
Public Types | |
| typedef Indx const | Indxc |
Public Member Functions | |
| pnlink (Indxc plink_, Indxc nlink_) | |
| Possibly partially constructed. | |
| pnlink (Indxc plink_, Indxc nlink_, pnlink< Indx > *next_) | |
| Fully constructed. | |
| pnlink (Indxc p0, Indxc p1, Indxc n0, Indxc n1) | |
| Construct two consecutive links. | |
| pnlink (Indxc p0, Indxc p1, Indxc p2, Indxc n0, Indxc n1, Indxc n2) | |
| Construct three consecutive links. | |
| pnlink (Indxc p0, Indxc p1, Indxc p2, Indxc p3, Indxc n0, Indxc n1, Indxc n2, Indxc n3) | |
| Construct four consecutive links. | |
| pnlink (Indxc p0, Indxc p1, Indxc p2, Indxc p3, Indxc p4, Indxc n0, Indxc n1, Indxc n2, Indxc n3, Indxc n4) | |
| Construct five consecutive links. | |
| pnlink (Indxc p0, Indxc p1, Indxc p2, Indxc p3, Indxc p4, Indxc p5, Indxc n0, Indxc n1, Indxc n2, Indxc n3, Indxc n4, Indxc n5) | |
| Construct six consecutive links. | |
| pnlink (Indxc p0, Indxc p1, Indxc p2, Indxc p3, Indxc p4, Indxc p5, Indxc p6, Indxc n0, Indxc n1, Indxc n2, Indxc n3, Indxc n4, Indxc n5, Indxc n6) | |
| Construct seven consecutive links. | |
| pnlink (Indxc p0, Indxc p1, Indxc p2, Indxc p3, Indxc p4, Indxc p5, Indxc p6, Indxc p7, Indxc n0, Indxc n1, Indxc n2, Indxc n3, Indxc n4, Indxc n5, Indxc n6, Indxc n7) | |
| Construct eight consecutive links. | |
| pnlink () | |
| Unconstructed state. | |
| pnlink< Indx > * | piInverse (Indx gpt) const |
| Iterate around the ring to find the link with the point. | |
| pnlink< Indx > * | niInverse (Indx neib) |
| Iterate around the ring to find the link with the neighbor. | |
| void | insert (pnlink< Indx > &next_) |
| Insert after this link. | |
| void | addafterself (Indxc p0, Indxc n0) |
| Insert a new link after this link. | |
| boolc | add (Indxc ptindx, Indxc p0) |
| Find the point ptindx and add new link copying its neighbor. | |
| boolc | isnull () const |
| Is the link null? | |
Public Attributes | |
| Indx | plink |
| Point link. | |
| Indx | nlink |
| Neighbor link. | |
| pnlink< Indx > * | next |
| Next element in circular list. | |
This can be used to represent a polygon as a circular list with each point having a link to the on the face of this and the next point.
By definition a null link has a point plink with 0 value meaning that the link is not pointing to any point.
<TODO> Provide memory management by overloading new and delete for this class.
Definition at line 22 of file pnlink.h.
| pnlink< Indx >::pnlink | ( | Indxc | p0, | |
| Indxc | p1, | |||
| Indxc | p2, | |||
| Indxc | n0, | |||
| Indxc | n1, | |||
| Indxc | n2 | |||
| ) | [inline] |
Construct three consecutive links.
Definition at line 238 of file pnlink.h.
00241 { 00242 plink = p0; 00243 nlink = n0; 00244 next = this; 00245 addafterself(p2,n2); 00246 addafterself(p1,n1); 00247 }
| pnlink< Indx >::pnlink | ( | Indxc | p0, | |
| Indxc | p1, | |||
| Indxc | p2, | |||
| Indxc | p3, | |||
| Indxc | n0, | |||
| Indxc | n1, | |||
| Indxc | n2, | |||
| Indxc | n3 | |||
| ) | [inline] |
Construct four consecutive links.
Definition at line 251 of file pnlink.h.
00255 { 00256 plink = p0; 00257 nlink = n0; 00258 next = this; 00259 addafterself(p3,n3); 00260 addafterself(p2,n2); 00261 addafterself(p1,n1); 00262 }
| pnlink< Indx >::pnlink | ( | Indxc | p0, | |
| Indxc | p1, | |||
| Indxc | p2, | |||
| Indxc | p3, | |||
| Indxc | p4, | |||
| Indxc | n0, | |||
| Indxc | n1, | |||
| Indxc | n2, | |||
| Indxc | n3, | |||
| Indxc | n4 | |||
| ) | [inline] |
Construct five consecutive links.
Definition at line 266 of file pnlink.h.
00270 { 00271 plink = p0; 00272 nlink = n0; 00273 next = this; 00274 addafterself(p4,n4); 00275 addafterself(p3,n3); 00276 addafterself(p2,n2); 00277 addafterself(p1,n1); 00278 }
| pnlink< Indx >::pnlink | ( | Indxc | p0, | |
| Indxc | p1, | |||
| Indxc | p2, | |||
| Indxc | p3, | |||
| Indxc | p4, | |||
| Indxc | p5, | |||
| Indxc | n0, | |||
| Indxc | n1, | |||
| Indxc | n2, | |||
| Indxc | n3, | |||
| Indxc | n4, | |||
| Indxc | n5 | |||
| ) | [inline] |
Construct six consecutive links.
Definition at line 282 of file pnlink.h.
00286 { 00287 plink = p0; 00288 nlink = n0; 00289 next = this; 00290 addafterself(p5,n5); 00291 addafterself(p4,n4); 00292 addafterself(p3,n3); 00293 addafterself(p2,n2); 00294 addafterself(p1,n1); 00295 }
| pnlink< Indx >::pnlink | ( | Indxc | p0, | |
| Indxc | p1, | |||
| Indxc | p2, | |||
| Indxc | p3, | |||
| Indxc | p4, | |||
| Indxc | p5, | |||
| Indxc | p6, | |||
| Indxc | n0, | |||
| Indxc | n1, | |||
| Indxc | n2, | |||
| Indxc | n3, | |||
| Indxc | n4, | |||
| Indxc | n5, | |||
| Indxc | n6 | |||
| ) | [inline] |
Construct seven consecutive links.
Definition at line 299 of file pnlink.h.
00303 { 00304 plink = p0; 00305 nlink = n0; 00306 next = this; 00307 addafterself(p6,n6); 00308 addafterself(p5,n5); 00309 addafterself(p4,n4); 00310 addafterself(p3,n3); 00311 addafterself(p2,n2); 00312 addafterself(p1,n1); 00313 }
| pnlink< Indx >::pnlink | ( | Indxc | p0, | |
| Indxc | p1, | |||
| Indxc | p2, | |||
| Indxc | p3, | |||
| Indxc | p4, | |||
| Indxc | p5, | |||
| Indxc | p6, | |||
| Indxc | p7, | |||
| Indxc | n0, | |||
| Indxc | n1, | |||
| Indxc | n2, | |||
| Indxc | n3, | |||
| Indxc | n4, | |||
| Indxc | n5, | |||
| Indxc | n6, | |||
| Indxc | n7 | |||
| ) | [inline] |
Construct eight consecutive links.
Definition at line 317 of file pnlink.h.
00321 { 00322 plink = p0; 00323 nlink = n0; 00324 next = this; 00325 addafterself(p7,n7); 00326 addafterself(p6,n6); 00327 addafterself(p5,n5); 00328 addafterself(p4,n4); 00329 addafterself(p3,n3); 00330 addafterself(p2,n2); 00331 addafterself(p1,n1); 00332 }
Find the point ptindx and add new link copying its neighbor.
Definition at line 186 of file pnlink.h.
References pnlink< Indx >::addafterself(), pnlink< Indx >::nlink, and pnlink< Indx >::piInverse().
Referenced by regionD2linked< Indx >::add().
00187 { 00188 pnlink<Indx> * pl = piInverse(ptindx); 00189 if (pl==0) 00190 return false; 00191 00192 Indx n0 = pl->nlink; 00193 pl->addafterself(p0,n0); 00194 00195 return true; 00196 }
Insert a new link after this link.
Definition at line 77 of file pnlink.h.
References pnlink< Indx >::next, and pnlink< Indx >::pnlink().
Referenced by pnlink< Indx >::add().
Is the link null?
Definition at line 84 of file pnlink.h.
References pnlink< Indx >::plink.
00085 { return plink==0; }
Iterate around the ring to find the link with the neighbor.
Definition at line 212 of file pnlink.h.
References pnlinkiter< Indx >::reset().
00213 { 00214 pnlinkiter<Indx> iter(this); 00215 for ( iter.reset(); !iter; ++iter ) 00216 { 00217 if (iter->nlink==neib) 00218 return iter(); 00219 } 00220 00221 return 0; 00222 }
Iterate around the ring to find the link with the point.
Definition at line 199 of file pnlink.h.
References pnlinkiter< Indx >::reset().
Referenced by pnlink< Indx >::add().
00200 { 00201 pnlinkiter<Indx> iter(this); 00202 for ( iter.reset(); !iter; ++iter ) 00203 { 00204 if (iter->plink==gpt) 00205 return iter(); 00206 } 00207 00208 return 0; 00209 }
Next element in circular list.
Definition at line 35 of file pnlink.h.
Referenced by pnlink< Indx >::addafterself(), pnlink< Indx >::insert(), pnlinkiterconst< Indx >::operator++(), pnlinkiter< Indx >::operator++(), and regionD2linked< Indx >::vec().
Neighbor link.
Definition at line 32 of file pnlink.h.
Referenced by pnlink< Indx >::add(), and regionD2linked< Indx >::vec().
Point link.
Definition at line 29 of file pnlink.h.
Referenced by pnlink< Indx >::isnull(), and regionD2linked< Indx >::vec().
1.5.8