Files Classes Functions Hierarchy
#include <d4fan.h>
Public Member Functions | |
| d4fan (d4tess &_tess) | |
| void | eval (uintc _w) |
| ostream & | print (ostream &os) const |
Public Attributes | |
| map< simplexface, uint > | stot |
| set< simplexface > | dead |
Definition at line 23 of file d4fan.h.
| d4fan::d4fan | ( | d4tess & | _tess | ) |
| void d4fan::eval | ( | uintc | _w | ) |
Definition at line 78 of file d4fan.cpp.
References d4tess::cp, d4tess::cpsimplexface(), dead, d4tess::debugcheck(), d4minoperator::eval(), simplexface::face, simplexface::id, d4tess::minimizer, virtualtetrahedron::set(), stot, d4tess::surfacedown(), d4tess::surfaceleft(), d4tess::surfaceviewable(), virtualtetrahedron::v, d4tess::vi, and d4tess::vs.
Referenced by d4tess::addpoint().
00079 { 00080 w = _w; 00081 dead.clear(); 00082 stot.clear(); 00083 process.clear(); 00084 00085 process.push_back(cp = tess.cpsimplexface()); 00086 00087 // <TODO> Test if cp is viewable to w. 00088 00089 // MessageGlobal mg; 00090 00091 // mg() << *this << endl << endl; 00092 // mg() << tess << endl; 00093 00094 addspike(); 00095 00096 // mg() << *this << endl << endl; 00097 // mg() << tess << endl; 00098 00099 00100 // k is the current surface face being processed. 00101 simplexface k; 00102 00103 // kt is an index into the central tetrehedron K. 00104 uint kt; 00105 00106 uint p[3]; 00107 00108 00109 uint sz = process.size(); 00110 for ( ; sz!=0; sz = process.size() ) 00111 { 00112 k = process[ sz-1 ]; 00113 process.pop_back(); 00114 dead.insert(k); 00115 00116 // mg() << SHOW(k) << endl; 00117 00118 // The current tetrahedron must have vs's base viewable to w. 00119 tess.cp = k.id; 00120 tess.vs.set( k.face ); 00121 assert(tess.surfaceviewable(w)); 00122 00123 // mg() << SHOW(tess.cp) << " " << SHOW(tess.vs) << endl; 00124 00125 for (uint i=0; i<3; ++i) 00126 p[i] = tess.vi[tess.cp].pi[ tess.vs.v[i] ]; 00127 00128 00129 // mg() << "p= " << p[0] << " " << p[1] << " " << p[2] << endl; 00130 00131 kt = stot[k]; 00132 d4tri & K(tess.vi[kt]); 00133 00134 // mg() << SHOW(kt) << " " << SHOW(K) << endl; 00135 00136 tess.surfacedown(); 00137 link(K.niFrompiInverse(p[2]),kt); 00138 00139 tess.surfacedown(); 00140 tess.surfaceleft(); 00141 link(K.niFrompiInverse(p[1]),kt); 00142 00143 tess.surfacedown(); 00144 tess.surfaceleft(); 00145 link(K.niFrompiInverse(p[0]),kt); 00146 } 00147 00148 00149 // Iterate over surface connecting the surface with 00150 // the fan. 00151 00152 simplexface sf; 00153 00154 for (map<simplexface,uint>::iterator i=stot.begin(); 00155 i!=stot.end(); ++i) 00156 { 00157 sf = i->first; 00158 tess.cp = sf.id; 00159 tess.vs.set(sf.face); 00160 tess.vi[ tess.cp ].ni[ tess.vs.v[3] ] = i->second; 00161 } 00162 00163 tess.debugcheck(); 00164 00165 // Apply minimization to each new tetrahedron with 00166 // an already existing tetrahedron on the old surface. 00167 for (map<simplexface,uint>::iterator i=stot.begin(); 00168 i!=stot.end(); ++i) 00169 tess.minimizer->eval( (i->first).id, i->second ); 00170 00171 }
Definition at line 180 of file d4fan.cpp.
References dead, stot, and d4tess::vi.
Referenced by operator<<().
00181 { 00182 os << "w=" << w << endl; 00183 // os << "surf" << endl << " "; 00184 // for( set<simplexface>::const_iterator i = surf.begin(); 00185 // i!=surf.end(); ++i) 00186 // os << *i << ":" << tess.vi[(*i).id] << endl; 00187 // os << endl; 00188 00189 os << "dead" << endl << " "; 00190 for( set<simplexface>::const_iterator i = dead.begin(); 00191 i!=dead.end(); ++i) 00192 os << *i << " "; 00193 os << endl; 00194 00195 os << "stot" << endl << " "; 00196 for( map<simplexface,uint>::const_iterator i = stot.begin(); 00197 i!=stot.end(); ++i) 00198 os << i->first << "->" << i->second << ": " << tess.vi[i->second] << endl; 00199 os << endl; 00200 00201 os << "process" << endl << " "; 00202 for ( uint i=0; i<process.size(); ++i) 00203 os << process[i] << " "; 00204 os << endl; 00205 00206 return os; 00207 }
| set< simplexface > d4fan::dead |
| map<simplexface,uint> d4fan::stot |
1.5.8