Files Classes Functions Hierarchy
#include <menu01.h>
Public Member Functions | |
| menu01 (T &_x) | |
| void | draw () |
| Designed to display the current menusystem. | |
| menu01 () | |
Public Attributes | |
| gobjglTranslatef | meshAoffset |
Protected Member Functions | |
| void | readImmediate (char const key) |
| void | readBufferedTerminationAction () |
| Optionally define a callback function for when the buffered read has completed. | |
| void | readBufferedTerminationAction () |
| Optionally define a callback function for when the buffered read has completed. | |
| void | readImmediate (char const ch) |
Protected Attributes | |
| uint | simplexdelete |
| uint | simplexsplitting |
| uint | simplexswap |
| uint | simplexminedgelength |
| primitiveWindow * | displaywindow |
| int | state |
Definition at line 17 of file menu01.h.
Definition at line 50 of file menu01.h.
References menusystem::addfont10(), menusystem::addfont12(), menusystem::addnewline(), menu01< T >::displaywindow, menu01< T >::simplexdelete, menu01< T >::simplexminedgelength, menu01< T >::simplexsplitting, and menu01< T >::simplexswap.
00051 : menusystem(this,0,true,point2<int>(60,30),20), x(_x), meshAoffset(pt3()) 00052 { 00053 addfont12("Partitions and Miscelaneous Mesh Operations Menu"); 00054 addnewline(); 00055 addfont10(simplexdelete, 00056 "'d' Enter simplex to delete: "); 00057 addnewline(); 00058 addfont10("'c' Clip the mesh with the partition "); 00059 addnewline(); 00060 addfont10(simplexminedgelength, 00061 "'e' Minimize the simplexes edge length, enter delta: "); 00062 addnewline(); 00063 addfont10("'j' 'J' Rotate partition anti clockwise and clockwise"); 00064 addnewline(); 00065 addfont10("'k' 'K' Translate partition right and left"); 00066 addnewline(); 00067 addfont10("'l' 'L' Translate partition up and down"); 00068 addnewline(); 00069 addfont10("'m' Splitting the simplex on the boundies midpoint"); 00070 addnewline(); 00071 addfont10(simplexsplitting, 00072 " Enter s p1 for the simplex and point index: "); 00073 addnewline(); 00074 addfont10("'p' Printing the mesh (toggle to display and update)"); 00075 addnewline(); 00076 addfont10("'r' Removing null simplexes"); 00077 addnewline(); 00078 addfont10(simplexswap, 00079 "'s' Swapping two simplexes, enter i and j: "); 00080 addnewline(); 00081 addfont10("'z' 'Z' Offset mesh A forward or backwards"); 00082 00083 addnewline(); 00084 addnewline(); 00085 addfont10("ESC Quit"); 00086 00087 displaywindow = new primitiveWindow( point3<double>(6.3,7.0,0.0), 0.20 ); 00088 }
Definition at line 109 of file menusystemtest.cpp.
References menusystem::addfont10(), and menusystem::addfont12().
00109 : 00110 menusystem(this,0,true,point2<int>(60,30),20) 00111 { 00112 addfont12(" Main Menu",1); 00113 addfont10("1. Read a string in.",1); 00114 addfont10("2. Read a string in immediately: ",1); 00115 /* 00116 addfont10("2. Read a string in immediately: "); 00117 Xpush(); 00118 X.x += 120; 00119 addfont10(""); 00120 Xpop(); 00121 addnewline(); 00122 */ 00123 addfont10("3. Submenu",1); 00124 addfont10("ESC Quit"); 00125 }
Designed to display the current menusystem.
Reimplemented from menusystem.
Definition at line 42 of file menu01.h.
References menu01< T >::displaywindow, and gobjContainer::draw().
Referenced by test01obj< P, PD >::display().
00043 { 00044 displaywindow->draw(); 00045 00046 menusystem::draw(); 00047 }
| void menu01< T >::readBufferedTerminationAction | ( | ) | [inline, protected, virtual] |
Optionally define a callback function for when the buffered read has completed.
Reimplemented from menusystem.
Definition at line 30 of file menusystemtest.cpp.
00031 { 00032 if (state==1) 00033 { 00034 cout << SHOW(readBufferedResult) << endl; 00035 state=0; 00036 } 00037 00038 }
| void menu01< T >::readBufferedTerminationAction | ( | ) | [inline, protected, virtual] |
Optionally define a callback function for when the buffered read has completed.
Reimplemented from menusystem.
Definition at line 94 of file menu01.h.
References delta, d3meshiterrecursive< B >::evallinear(), and menusystem::readBufferedResult.
00095 { 00096 stringstream ss(readBufferedResult); 00097 00098 switch (state) 00099 { 00100 case 'd': 00101 { 00102 uint z; 00103 ss >> z; 00104 x.mesh->simplexdelete(z); 00105 00106 break; 00107 } 00108 00109 case 'm': 00110 { 00111 uint s; 00112 uint p0; 00113 ss >> s >> p0; 00114 00115 x.mesh->splitmidpoint1D(s,p0); 00116 00117 break; 00118 } 00119 00120 case 's': 00121 { 00122 uint i,j; 00123 ss >> i >> j; 00124 x.mesh->simplexswap(i,j); 00125 00126 break; 00127 } 00128 00129 case 'e': 00130 { 00131 double delta; 00132 ss >> delta; 00133 maxEdgeLength op(*x.mesh,delta); 00134 00135 d3meshiterrecursive<maxEdgeLength> i(x.mesh->vi,op); 00136 00137 i.evallinear(); 00138 00139 break; 00140 } 00141 } 00142 00143 x.mesh->debugcheck(); 00144 x.meshdraw->meshupdate(); 00145 glutPostRedisplay(); 00146 }
Definition at line 149 of file menu01.h.
References menu01< T >::displaywindow, menu01< T >::meshAoffset, gobjContainer::nuke(), menusystem::readBufferedSet(), primitiveWindow::reset(), menu01< T >::simplexdelete, menu01< T >::simplexminedgelength, menu01< T >::simplexsplitting, menu01< T >::simplexswap, gobjContainer::vg, and gobjglTranslatef::z.
00150 { 00151 switch (key) 00152 { 00153 case 27: 00154 exit(0); 00155 break; 00156 00157 case 'd': 00158 { 00159 state='d'; 00160 readBufferedSet(simplexdelete); 00161 break; 00162 } 00163 00164 case 'c': 00165 x.clip->eval(); 00166 x.meshdraw->meshupdate(); 00167 break; 00168 00169 case 'e': 00170 { 00171 state='e'; 00172 readBufferedSet(simplexminedgelength); 00173 break; 00174 } 00175 00176 case 'j': 00177 { 00178 x.hdraw->rotate(0.1); 00179 x.meshdraw->meshupdate(); 00180 break; 00181 } 00182 00183 case 'J': 00184 { 00185 x.hdraw->rotate(-0.1); 00186 x.meshdraw->meshupdate(); 00187 break; 00188 } 00189 00190 case 'k': 00191 { 00192 x.hdraw->translate( pt2(0.1,0.0) ); 00193 x.meshdraw->meshupdate(); 00194 break; 00195 } 00196 00197 case 'K': 00198 { 00199 x.hdraw->translate( pt2(-0.1,0.0) ); 00200 x.meshdraw->meshupdate(); 00201 break; 00202 } 00203 00204 case 'l': 00205 { 00206 x.hdraw->translate( pt2(0.0,0.1) ); 00207 x.meshdraw->meshupdate(); 00208 break; 00209 } 00210 00211 case 'L': 00212 { 00213 x.hdraw->translate( pt2(0.0,-0.1) ); 00214 x.meshdraw->meshupdate(); 00215 break; 00216 } 00217 00218 case 'm': 00219 { 00220 state='m'; 00221 readBufferedSet(simplexsplitting); 00222 break; 00223 } 00224 00225 case 'p': 00226 { 00227 // Toggle the print display. 00228 if (displaywindow->vg.empty()==false) 00229 displaywindow->nuke(); 00230 else 00231 { 00232 displaywindow->reset(); 00233 *displaywindow << *x.mesh; 00234 cout << *x.mesh << endl; 00235 // *displaywindow << endl; 00236 00237 // string t1; 00238 // for (uint i=1; i<x.clip->bv.size(); ++i) 00239 // { 00240 // t1=""; 00241 // t1 += i; 00242 // t1 += (" " + x.clip->bv[i]); 00243 // *displaywindow << t1; 00244 // *displaywindow << endl; 00245 // } 00246 } 00247 00248 // NOTE: I am having a lot of trouble with this code. Streams 00249 // are notorious in C++ and though I have had several discussions 00250 // over time I have not got much but trouble from C++ streams. 00251 // 00252 // Normally I would implement serialization in strings. This time I 00253 // tried yet again to create an integrated solution and use streams and 00254 // again I have been frustrated with them. At issue is their use. 00255 // I do not want to manage buffers but wish the stream to do this and 00256 // more. In short I wish to read a stream and interpret it without 00257 // crashing. Serialization is easy with text files where the data is 00258 // simply read and written too. This is all I want to do with streams 00259 // - read the data as text. I am matching them with data that writes 00260 // text and flushes with the endl. After some reading and internet 00261 // I still have not a simple answer or met any that does this. 00262 // The technology of streams seems to be in a one way direction - that 00263 // of favoring the user of a stream rather than the designed of a stream. 00264 // Why is what I am attempting to do so difficult? I am almost at 00265 // the point where I will no longer use streams but write out strings. 00266 // Then have the stream interact with the strings. This would solve this 00267 // reverse issue where I have a stream and want it back as text because 00268 // all the objects I use have an operator that can easily do this. 00269 // Further this solution is simple and generic. If all my code does this 00270 // then I will only have issues with dealing with strings and not 00271 // streams - which are much harder to deal with. Infact I have convinced 00272 // myself that this is a much more efficient path, fk the standards committee 00273 // for seeing the streams only at such a low level and not at all data 00274 // driven. I keep hearing about how wonderful streams are but I have 00275 // yet to implement them properly. I wrote a parser with streams which 00276 // failed so I rewrote with strings and it succeeded. Streams are to the 00277 // uninitiated a vial technology that is prohibative. The committee needs 00278 // a good kick up the arse. 00279 00280 00281 //cout << *x.mesh << endl; 00282 // for (uint i=1; i<x.clip->bv.size(); ++i) 00283 // cout << i << " " << x.clip->bv[i] << endl; 00284 00285 break; 00286 } 00287 00288 case 'r': 00289 { 00290 x.mesh->removenullsimplexes(); 00291 cout << *x.mesh << endl; 00292 00293 x.meshdraw->meshupdate(); 00294 break; 00295 } 00296 00297 case 's': 00298 { 00299 state='s'; 00300 readBufferedSet(simplexswap); 00301 break; 00302 } 00303 00304 00305 case 'z': 00306 { 00307 meshAoffset.z += 0.01; 00308 break; 00309 } 00310 00311 case 'Z': 00312 { 00313 meshAoffset.z -= 0.01; 00314 break; 00315 } 00316 } 00317 00318 glutPostRedisplay(); 00319 }
primitiveWindow* menu01< T >::displaywindow [protected] |
Definition at line 38 of file menu01.h.
Referenced by menu01< T >::draw(), menu01< T >::menu01(), and menu01< T >::readImmediate().
| gobjglTranslatef menu01< T >::meshAoffset |
Definition at line 27 of file menu01.h.
Referenced by menu01< T >::readImmediate(), and test01obj< P, PD >::test01obj().
uint menu01< T >::simplexdelete [protected] |
Definition at line 33 of file menu01.h.
Referenced by menu01< T >::menu01(), and menu01< T >::readImmediate().
uint menu01< T >::simplexminedgelength [protected] |
Definition at line 36 of file menu01.h.
Referenced by menu01< T >::menu01(), and menu01< T >::readImmediate().
uint menu01< T >::simplexsplitting [protected] |
Definition at line 34 of file menu01.h.
Referenced by menu01< T >::menu01(), and menu01< T >::readImmediate().
uint menu01< T >::simplexswap [protected] |
Definition at line 35 of file menu01.h.
Referenced by menu01< T >::menu01(), and menu01< T >::readImmediate().
Definition at line 28 of file menusystemtest.cpp.
1.5.8