Files Classes Functions Hierarchy
00001 #ifndef D3FAN_H 00002 #define D3FAN_H 00003 00004 #include <cassert> 00005 #include <set> 00006 #include <map> 00007 #include <vector> 00008 #include <iosfwd> 00009 using namespace std; 00010 00011 #include <d3tess.h> 00012 #include <simplexD2linked.h> 00013 #include <simplexface.h> 00014 #include <typedefs.h> 00015 #include <virtualtriangle.h> 00016 00017 00018 class d3tess; 00019 00020 00021 /* 00022 \brief Build a 2D fan from a point outside the convex mesh. 00023 00024 Assumed tess's virtual triangle's base 00025 is orientated and viewable to point w_ in eval. 00026 */ 00027 class d3fan 00028 { 00029 d3tess & tess; 00030 public: 00031 00032 // Triangle face to triangle. 00033 map<simplexface,uint> stot; 00034 00035 // Boundary or linked faces 00036 set< simplexface > dead; 00037 00038 // Constructor 00039 d3fan( d3tess & tess_ ); 00040 00041 // Build the 3D fan from the point w_ to the 00042 // surface of tess. Assume tess.cp on surface. 00043 void eval(uintc w_); 00044 00045 ostream & print(ostream & os) const; 00046 00047 private: 00048 00051 uint w; 00052 00057 vector<simplexface> process; 00058 00059 00063 void addspike(); 00064 00065 // When moving from one triangle on the old surface boundary 00066 // to another, the associated pointers to the new triangles 00067 // need to be connected. 00068 // 00069 // from - a newely created triangle which is the current focus 00070 // ie is being iterated around 00071 // fromni - when moving you know the link which you want to set 00072 // equal to the newely formed triangle that you are moving in 00073 // to. 00074 // vslocalpi - refers to the index to get the local point from 00075 // the cpsimplex. The inverse of this point gives the local 00076 // index to from when applied to the new triangle. 00077 // 00078 // Note: integer indexes are used and not pointers. This is 00079 // because the vi stack changes and so the pointers can not 00080 // be invalidated. 00081 bool const link 00082 ( 00083 uintc from, 00084 uintc fromni, 00085 uintc vslocalpi 00086 ); 00087 00089 simplexface cpf; 00090 00091 virtualtriangle const & vs; 00092 vector<simplexD2linked> & vi; 00093 uint & cp; 00094 }; 00095 00096 ostream & operator << (ostream & os, d3fan const & x); 00097 00098 // About: 00099 // 00100 // The class is intended to be constructed once and reused. 00101 // 00102 // It may be observed that a hash data structure are more 00103 // appropriate for stot and dead data structures. 00104 // <TODO> replace STL containers with hash tables. 00105 00106 00107 00108 00109 #endif 00110
1.5.8