Files Classes Functions Hierarchy
#include <simplexD2linked.h>
Public Member Functions | |
| uintc | nifrom (uintc gpt) const |
| Use global points as references to get the opposite neighbor. | |
| uintc | piInverse (uintc gpt) const |
| Get the local point index. | |
| boolc | piInverseHas (uintc gpt) const |
| Given the point does it belong to this simplex? | |
| uintc | piInverse (bool &res, uintc gpt) const |
| Both find the point inverse and query if it exists. | |
| uintc | niInverse (uintc neib) const |
| Get the local neighbour index. | |
| boolc | niInverseHas (uintc neib) const |
| Has the simplex got a pointer to neib? | |
| uintc | niInverse (bool &res, uintc neib) const |
| Both find the inverse and query if it exists. | |
| simplexD2linked () | |
| Default Constructor: all fields set to 0. | |
| simplexD2linked (uintc a, uintc b, uintc c, uintc na=0, uintc nb=0, uintc nc=0) | |
| Construct a triangle. | |
| void | construct (uintc a, uintc b, uintc c, uintc na, uintc nb, uintc nc) |
| Construct this triangle. | |
| void | getanticlockwiseface (uint &a, uint &b, uintc face) const |
| Returns anticlockwise point indexes a,b are indexes from <0,1,2> eg face 1 identifies the face opposite the point 1 which is line form 2 to 0. | |
| void | getclockwiseface (uint &a, uint &b, uintc face) const |
| Returns clockwise point indexes a,b are indexes from <0,1,2>. | |
| boolc | isonboundary () const |
| Is the triangle part of the surface? | |
| void | setnull () |
| Set all fields to 0. | |
| boolc | isnull () const |
| Is this a triangle? Are all the fields set to zero? | |
| void | changelink (uintc from, uintc to) |
| Change the link to point to another simplex. | |
| boolc | operator== (simplexD2linked const &w) const |
| Do two triangles have the same points? Assumes simplex has unique points, so (1,1,2) is not compared with (2,2,1). | |
| operator string () const | |
| Write the object out. | |
| void | serializeInverse (stringc &s) |
| Read the object in. | |
| ostream & | print (ostream &os) const |
| Write the object out. | |
| istream & | serializeInverse (istream &is) |
| Read the object in. | |
Public Attributes | |
| uint | pi [3] |
| Indexes to points or verticies. | |
| uint | ni [3] |
| Indexes to neighboring simplexes. | |
Definition at line 29 of file simplexD2linked.h.
| simplexD2linked::simplexD2linked | ( | ) |
| simplexD2linked::simplexD2linked | ( | uintc | a, | |
| uintc | b, | |||
| uintc | c, | |||
| uintc | na = 0, |
|||
| uintc | nb = 0, |
|||
| uintc | nc = 0 | |||
| ) |
Construct a triangle.
Definition at line 44 of file simplexD2linked.cpp.
00052 { 00053 construct(a,b,c,na,nb,nc); 00054 }
Change the link to point to another simplex.
Definition at line 153 of file simplexD2linked.h.
References ni, and niInverse().
Referenced by d3tess::simplexswap().
Returns anticlockwise point indexes a,b are indexes from <0,1,2> eg face 1 identifies the face opposite the point 1 which is line form 2 to 0.
Definition at line 177 of file simplexD2linked.cpp.
00182 { 00183 switch (face) 00184 { 00185 case 0: 00186 a=1; b=2; 00187 break; 00188 00189 case 1: 00190 a=2; b=0; 00191 break; 00192 00193 case 2: 00194 a=0; b=1; 00195 break; 00196 00197 default: 00198 assert(false); 00199 } 00200 }
Returns clockwise point indexes a,b are indexes from <0,1,2>.
Definition at line 203 of file simplexD2linked.cpp.
00208 { 00209 switch (face) 00210 { 00211 case 0: 00212 a=2; b=1; 00213 break; 00214 00215 case 1: 00216 a=0; b=2; 00217 break; 00218 00219 case 2: 00220 a=1; b=0; 00221 break; 00222 00223 default: 00224 assert(false); 00225 } 00226 }
| boolc simplexD2linked::isnull | ( | ) | const |
Is this a triangle? Are all the fields set to zero?
Definition at line 228 of file simplexD2linked.cpp.
Referenced by writemulticolorobj::draw(), writegridobj::draw(), writewindingobj::draw(), writesurfaceobj::draw(), d3meshiterrecursive< B >::eval(), and d3tess::simplexdelete().
00229 { 00230 for (uint i=0; i<3; ++i) 00231 { 00232 if (pi[i]!=0) 00233 return false; 00234 00235 if (ni[i]!=0) 00236 return false; 00237 } 00238 00239 return true; 00240 }
| boolc simplexD2linked::isonboundary | ( | ) | const |
Use global points as references to get the opposite neighbor.
Definition at line 41 of file simplexD2linked.h.
References ni, and piInverse().
Get the local neighbour index.
Definition at line 79 of file simplexD2linked.h.
References ni.
Referenced by changelink(), d3mincircle::eval(), d3mincentroid2::eval(), d3mincentroid::eval(), d3minboundary::eval(), d3tess::flip(), d3tess::isconvex(), d3tess::movedown(), d3tess::simplexswap(), and d3tess::split1D().
00080 { 00081 if (ni[0]==neib) return 0; 00082 if (ni[1]==neib) return 1; 00083 if (ni[2]==neib) return 2; 00084 00085 assert(false); 00086 return 3; // Return crap. 00087 }
Has the simplex got a pointer to neib?
Definition at line 89 of file simplexD2linked.h.
References ni.
Referenced by d3tess::simplexswap().
00090 { 00091 if (ni[0]==neib) return true; 00092 if (ni[1]==neib) return true; 00093 if (ni[2]==neib) return true; 00094 00095 return false; 00096 }
| simplexD2linked::operator string | ( | ) | const |
Write the object out.
Definition at line 14 of file simplexD2linked.cpp.
00015 { 00016 string s; 00017 for (uint i=0; i<3; ++i) 00018 { 00019 { stringstream ss; ss << pi[i]; s+=ss.str(); } 00020 s += " "; 00021 } 00022 00023 s += " "; 00024 00025 for (uint i=0; i<3; ++i) 00026 { 00027 { stringstream ss; ss << ni[i]; s+=ss.str(); } 00028 s += " "; 00029 } 00030 00031 return s; 00032 }
| boolc simplexD2linked::operator== | ( | simplexD2linked const & | w | ) | const |
Do two triangles have the same points? Assumes simplex has unique points, so (1,1,2) is not compared with (2,2,1).
Definition at line 251 of file simplexD2linked.cpp.
References pi.
00252 { 00253 if (pi[0]+pi[1]+pi[2] != w.pi[0]+w.pi[1]+w.pi[2]) 00254 return false; 00255 00256 for (uint i=0; i<3; ++i) 00257 { 00258 bool res(false); 00259 for (uint k=0; k<3; ++k) 00260 { 00261 if (w.pi[k]==pi[i]) 00262 { 00263 res=true; 00264 k=3; 00265 } 00266 } 00267 if (res==false) 00268 return false; 00269 } 00270 00271 return true; 00272 }
Get the local point index.
Definition at line 45 of file simplexD2linked.h.
References pi.
Referenced by d3tess::flip(), and nifrom().
00046 { 00047 assert(gpt!=0); 00048 00049 if (pi[0]==gpt) return 0; 00050 if (pi[1]==gpt) return 1; 00051 if (pi[2]==gpt) return 2; 00052 00053 assert(false); 00054 return 3; // Return crap. 00055 }
Given the point does it belong to this simplex?
Definition at line 57 of file simplexD2linked.h.
References pi.
Referenced by d3tess::splitwithline().
00058 { 00059 if (pi[0]==gpt) return true; 00060 if (pi[1]==gpt) return true; 00061 if (pi[2]==gpt) return true; 00062 00063 return false; 00064 }
Write the object out.
Definition at line 143 of file simplexD2linked.cpp.
Referenced by operator<<().
00144 { 00145 for (uint i=0; i<3; ++i) 00146 os << pi[i] << " "; 00147 00148 os << " "; 00149 00150 for (uint i=0; i<3; ++i) 00151 os << ni[i] << " "; 00152 00153 return os; 00154 }
| istream & simplexD2linked::serializeInverse | ( | istream & | is | ) |
| void simplexD2linked::serializeInverse | ( | stringc & | s | ) |
Read the object in.
Definition at line 120 of file simplexD2linked.cpp.
Referenced by operator>>().
00121 { 00122 stringstream ss(s); 00123 for (uint i=0; i<3; ++i) 00124 ss >> pi[i]; 00125 00126 for (uint i=0; i<3; ++i) 00127 ss >> ni[i]; 00128 }
| void simplexD2linked::setnull | ( | ) |
Set all fields to 0.
Definition at line 242 of file simplexD2linked.cpp.
Referenced by d3tess::simplexdelete().
Indexes to neighboring simplexes.
If ni[k] is 0 this is a boundary/surface edge.
Definition at line 37 of file simplexD2linked.h.
Referenced by d3tess::boundaryorient(), changelink(), d3meshiterrecursive< B >::eval(), d3tess::flip(), isnull(), isonboundary(), d3tess::move_terminated(), d3tess::movedown(), nifrom(), niInverse(), niInverseHas(), operator string(), print(), serializeInverse(), setnull(), simplexD2linked(), d3tess::simplexdelete(), d3tess::simplexswap(), d3tess::split1D(), and d3tess::split2D().
Indexes to points or verticies.
Definition at line 34 of file simplexD2linked.h.
Referenced by d3tess::cpbasemeasure(), writemulticolorobj::draw(), writecpobj::draw(), writesimplicesobj::draw(), writegridobj::draw(), writewindingobj::draw(), writesurfaceobj::draw(), maxEdgeLength::eval(), d3mincircle::eval(), d3mincentroid2::eval(), d3mincentroid::eval(), d3minboundary::eval(), d3tess::flip(), d3tess::isconvex(), isnull(), d3tess::move_terminated(), operator string(), operator==(), piInverse(), piInverseHas(), print(), serializeInverse(), setnull(), simplexD2linked(), d3tess::simplexswap(), d3tess::split1D(), d3tess::split2D(), and d3tess::surfaceviewable().
1.5.8