1 | // generated by Fast Light User Interface Designer (fluid) version 2.0100
|
---|
2 |
|
---|
3 | #include "GeoMeshViewUI.h"
|
---|
4 | #include "resource.h"
|
---|
5 |
|
---|
6 | using namespace Geometry;
|
---|
7 | using namespace std;
|
---|
8 |
|
---|
9 | //---------------------------------------------------------------------------
|
---|
10 | // Menu File Open Callback
|
---|
11 | //---------------------------------------------------------------------------
|
---|
12 | inline void GeoMeshViewUI::cb_menuFileOpen_i(fltk::Item*, void*)
|
---|
13 | {
|
---|
14 | // Sets menus application state to NONE.
|
---|
15 | mApplicationState = NONE;
|
---|
16 |
|
---|
17 | // Loads a mesh file.
|
---|
18 | openMeshFile();
|
---|
19 |
|
---|
20 | // Debug.
|
---|
21 | cout << "Vertex Count SubMesh 0: "
|
---|
22 | << mGeoMesh->mSubMesh[0].mVertexBuffer->mVertexCount
|
---|
23 | << endl;
|
---|
24 | //----------------------------------------------------------
|
---|
25 |
|
---|
26 | // Deactive Lod strip visualization.
|
---|
27 | geoMeshView->deactiveLodStrip();
|
---|
28 |
|
---|
29 | // Deactive Lod tree visualization.
|
---|
30 | geoMeshView->deactiveLodTree();
|
---|
31 |
|
---|
32 | // Repaint the window.
|
---|
33 | mMainWindow->redraw();
|
---|
34 | }
|
---|
35 |
|
---|
36 | //---------------------------------------------------------------------------
|
---|
37 | // Repaint the FPS label.
|
---|
38 | //---------------------------------------------------------------------------
|
---|
39 | void GeoMeshViewUI::refreshFPS(int fps)
|
---|
40 | {
|
---|
41 | static char char_value[10];
|
---|
42 |
|
---|
43 | // Translate the FPS count to a char value.
|
---|
44 | sprintf(char_value,"FPS %d",fps);
|
---|
45 |
|
---|
46 | mFPS->label(char_value);
|
---|
47 |
|
---|
48 | // Repaint the window.
|
---|
49 | mMainWindow->redraw();
|
---|
50 | }
|
---|
51 |
|
---|
52 | void GeoMeshViewUI::cb_menuFileOpen(fltk::Item* o, void* v)
|
---|
53 | {
|
---|
54 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
55 | ->
|
---|
56 | cb_menuFileOpen_i(o,v);
|
---|
57 | }
|
---|
58 |
|
---|
59 | //---------------------------------------------------------------------------
|
---|
60 | // Save callback
|
---|
61 | //---------------------------------------------------------------------------
|
---|
62 | inline void GeoMeshViewUI::cb_menuFileSave_i(fltk::Item*, void*)
|
---|
63 | {
|
---|
64 | GeoMeshSaver *mesh_saver;
|
---|
65 |
|
---|
66 | // If there is a mesh object created.
|
---|
67 | if (mGeoMesh != NULL)
|
---|
68 | {
|
---|
69 | // Create a mesh saver with mesh bounds.
|
---|
70 | mesh_saver = new GeoMeshSaver(mMeshBounds);
|
---|
71 |
|
---|
72 | // Save the file mesh.
|
---|
73 | mesh_saver->save( mGeoMesh,
|
---|
74 | mFileName);
|
---|
75 |
|
---|
76 | // Free memory.
|
---|
77 | delete mesh_saver;
|
---|
78 | }
|
---|
79 | }
|
---|
80 |
|
---|
81 | void GeoMeshViewUI::cb_menuFileSave(fltk::Item* o, void* v)
|
---|
82 | {
|
---|
83 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
84 | ->
|
---|
85 | cb_menuFileSave_i(o,v);
|
---|
86 | }
|
---|
87 |
|
---|
88 | //---------------------------------------------------------------------------
|
---|
89 | // Save As Callback
|
---|
90 | //---------------------------------------------------------------------------
|
---|
91 | inline void GeoMeshViewUI::cb_menuOpenSaveAs_i(fltk::Item*, void*)
|
---|
92 | {
|
---|
93 | fltk::FileChooser *fcho;
|
---|
94 | GeoMeshSaver *mesh_saver;
|
---|
95 |
|
---|
96 | if (mGeoMesh != NULL)
|
---|
97 | {
|
---|
98 | fcho = new fltk::FileChooser("",
|
---|
99 | "*.mesh",
|
---|
100 | fltk::FileChooser::CREATE,
|
---|
101 | "Save Mesh as");
|
---|
102 |
|
---|
103 | fcho->exec();
|
---|
104 |
|
---|
105 | if (fcho->value())
|
---|
106 | {
|
---|
107 | mesh_saver = new GeoMeshSaver(mMeshBounds);
|
---|
108 |
|
---|
109 | mesh_saver->save( mGeoMesh,
|
---|
110 | filename_name(fcho->value()));
|
---|
111 |
|
---|
112 | delete mesh_saver;
|
---|
113 | }
|
---|
114 |
|
---|
115 | // Repaint the window.
|
---|
116 | mMainWindow->redraw();
|
---|
117 |
|
---|
118 | delete fcho;
|
---|
119 | }
|
---|
120 | }
|
---|
121 |
|
---|
122 | void GeoMeshViewUI::cb_menuOpenSaveAs(fltk::Item* o, void* v)
|
---|
123 | {
|
---|
124 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
125 | ->
|
---|
126 | cb_menuOpenSaveAs_i(o,v);
|
---|
127 | }
|
---|
128 |
|
---|
129 | //---------------------------------------------------------------------------
|
---|
130 | // Mesh info callback
|
---|
131 | //---------------------------------------------------------------------------
|
---|
132 | inline void GeoMeshViewUI::cb_menuMeshInfo_i(fltk::Item*, void*)
|
---|
133 | {
|
---|
134 | // Show title.
|
---|
135 | mProcessTitle->label("Mesh Info");
|
---|
136 |
|
---|
137 | showMeshInfo();
|
---|
138 | mMainWindow->redraw();
|
---|
139 | }
|
---|
140 |
|
---|
141 | void GeoMeshViewUI::cb_menuMeshInfo(fltk::Item* o, void* v)
|
---|
142 | {
|
---|
143 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
144 | ->
|
---|
145 | cb_menuMeshInfo_i(o,v);
|
---|
146 | }
|
---|
147 |
|
---|
148 | //---------------------------------------------------------------------------
|
---|
149 | // Mesh Export to OBJ callback
|
---|
150 | //---------------------------------------------------------------------------
|
---|
151 | inline void GeoMeshViewUI::cb_menuMeshExportOBJ_i(fltk::Item*, void*)
|
---|
152 | {
|
---|
153 | char *p;
|
---|
154 |
|
---|
155 | // Sets menus application state to NONE.
|
---|
156 | mApplicationState = NONE;
|
---|
157 |
|
---|
158 | // Open file chooser dialog.
|
---|
159 | p = fltk::file_chooser( "Export to OBJ",
|
---|
160 | "*.obj",
|
---|
161 | "");
|
---|
162 | if (p && mGeoMesh)
|
---|
163 | {
|
---|
164 | mGeoMesh->exportToOBJ(p);
|
---|
165 | }
|
---|
166 | }
|
---|
167 |
|
---|
168 | void GeoMeshViewUI::cb_menuMeshExportOBJ(fltk::Item* o, void* v)
|
---|
169 | {
|
---|
170 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
171 | ->
|
---|
172 | cb_menuMeshExportOBJ_i(o,v);
|
---|
173 | }
|
---|
174 |
|
---|
175 | //---------------------------------------------------------------------------
|
---|
176 | // Transform to Shared Vertex callback
|
---|
177 | //---------------------------------------------------------------------------
|
---|
178 | inline void GeoMeshViewUI::cb_menuTransformSharedVertex_i(fltk::Item*, void*)
|
---|
179 | {
|
---|
180 | Mesh *mesh_aux;
|
---|
181 |
|
---|
182 | // if the undo mesh is not initialized.
|
---|
183 | if (mGeoMesh != NULL)
|
---|
184 | {
|
---|
185 | // Deletes the actual mesh.
|
---|
186 | delete mUndoMesh;
|
---|
187 |
|
---|
188 | mUndoMesh = new Mesh();
|
---|
189 |
|
---|
190 | // Restore the previous mesh.
|
---|
191 | *mUndoMesh = *mGeoMesh;
|
---|
192 |
|
---|
193 | // Transform NoSV Mesh to a SV Mesh.
|
---|
194 | mesh_aux = mGeoMesh->toSharedVertex();
|
---|
195 |
|
---|
196 | // Deletes the mesh No Shared Vertex.
|
---|
197 | delete mGeoMesh;
|
---|
198 |
|
---|
199 | // Gets the mesh Shared Vertex.
|
---|
200 | mGeoMesh = mesh_aux;
|
---|
201 |
|
---|
202 | // Visualize the mesh stripified.
|
---|
203 | geoMeshView->setMesh(mGeoMesh);
|
---|
204 |
|
---|
205 | // Refresh mesh information.
|
---|
206 | showMeshInfo();
|
---|
207 |
|
---|
208 | // Repaint the window.
|
---|
209 | mMainWindow->redraw();
|
---|
210 | }
|
---|
211 | }
|
---|
212 |
|
---|
213 | void GeoMeshViewUI::cb_menuFileTransformSharedVertex(fltk::Item* o, void* v)
|
---|
214 | {
|
---|
215 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
216 | ->
|
---|
217 | cb_menuTransformSharedVertex_i(o,v);
|
---|
218 | }
|
---|
219 |
|
---|
220 | //---------------------------------------------------------------------------
|
---|
221 | // Quit Callback
|
---|
222 | //---------------------------------------------------------------------------
|
---|
223 | inline void GeoMeshViewUI::cb_menuOpenQuit_i(fltk::Item*, void*)
|
---|
224 | {
|
---|
225 | delete this;
|
---|
226 | }
|
---|
227 |
|
---|
228 | void GeoMeshViewUI::cb_menuOpenQuit(fltk::Item* o, void* v)
|
---|
229 | {
|
---|
230 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
231 | ->
|
---|
232 | cb_menuOpenQuit_i(o,v);
|
---|
233 | }
|
---|
234 |
|
---|
235 | //---------------------------------------------------------------------------
|
---|
236 | // Undo Callback
|
---|
237 | //---------------------------------------------------------------------------
|
---|
238 | inline void GeoMeshViewUI::cb_menuEditUndo_i(fltk::Item*, void*)
|
---|
239 | {
|
---|
240 | // Undo the mesh changes.
|
---|
241 | undo();
|
---|
242 | }
|
---|
243 |
|
---|
244 | void GeoMeshViewUI::cb_menuEditUndo(fltk::Item* o, void* v)
|
---|
245 | {
|
---|
246 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
247 | ->
|
---|
248 | cb_menuEditUndo_i(o,v);
|
---|
249 | }
|
---|
250 |
|
---|
251 | //---------------------------------------------------------------------------
|
---|
252 | // Fit Callback
|
---|
253 | //---------------------------------------------------------------------------
|
---|
254 | inline void GeoMeshViewUI::cb_menuEditFit_i(fltk::Item*, void*)
|
---|
255 | {
|
---|
256 | geoMeshView->fit();
|
---|
257 | mMainWindow->redraw();
|
---|
258 | }
|
---|
259 |
|
---|
260 | void GeoMeshViewUI::cb_menuEditFit(fltk::Item* o, void* v)
|
---|
261 | {
|
---|
262 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
263 | ->
|
---|
264 | cb_menuEditFit_i(o,v);
|
---|
265 | }
|
---|
266 |
|
---|
267 | //---------------------------------------------------------------------------
|
---|
268 | // Rotate Callback
|
---|
269 | //---------------------------------------------------------------------------
|
---|
270 | inline void GeoMeshViewUI::cb_menuEditRotate_i(fltk::Item *item, void*)
|
---|
271 | {
|
---|
272 | // If the item is activated.
|
---|
273 | if (item->value())
|
---|
274 | {
|
---|
275 | menuEditPan->clear_value();
|
---|
276 | geoMeshView->deactivePan();
|
---|
277 |
|
---|
278 | geoMeshView->activeRotate();
|
---|
279 | }
|
---|
280 | else
|
---|
281 | {
|
---|
282 | menuEditPan->set_value();
|
---|
283 | geoMeshView->activePan();
|
---|
284 |
|
---|
285 | geoMeshView->deactiveRotate();
|
---|
286 | }
|
---|
287 |
|
---|
288 | // Repaint the main window.
|
---|
289 | mMainWindow->redraw();
|
---|
290 | }
|
---|
291 |
|
---|
292 | void GeoMeshViewUI::cb_menuEditRotate(fltk::Item* o, void* v)
|
---|
293 | {
|
---|
294 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
295 | ->
|
---|
296 | cb_menuEditRotate_i(o,v);
|
---|
297 | }
|
---|
298 |
|
---|
299 | //---------------------------------------------------------------------------
|
---|
300 | // Pan Callback
|
---|
301 | //---------------------------------------------------------------------------
|
---|
302 | inline void GeoMeshViewUI::cb_menuEditPan_i(fltk::Item *item, void*)
|
---|
303 | {
|
---|
304 | // If the item is activated.
|
---|
305 | if (item->value())
|
---|
306 | {
|
---|
307 | geoMeshView->activePan();
|
---|
308 |
|
---|
309 | menuEditRotate->clear_value();
|
---|
310 | geoMeshView->deactiveRotate();
|
---|
311 | }
|
---|
312 | else
|
---|
313 | {
|
---|
314 | geoMeshView->deactivePan();
|
---|
315 |
|
---|
316 | menuEditRotate->set_value();
|
---|
317 | geoMeshView->activeRotate();
|
---|
318 | }
|
---|
319 |
|
---|
320 | // Repaint the main window.
|
---|
321 | mMainWindow->redraw();
|
---|
322 | }
|
---|
323 |
|
---|
324 | void GeoMeshViewUI::cb_menuEditPan(fltk::Item* o, void* v)
|
---|
325 | {
|
---|
326 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
327 | ->
|
---|
328 | cb_menuEditPan_i(o,v);
|
---|
329 | }
|
---|
330 |
|
---|
331 | //---------------------------------------------------------------------------
|
---|
332 | // Zoom Callback
|
---|
333 | //---------------------------------------------------------------------------
|
---|
334 | inline void GeoMeshViewUI::cb_menuEditZoom_i(fltk::Item*, void*)
|
---|
335 | {
|
---|
336 | }
|
---|
337 |
|
---|
338 | void GeoMeshViewUI::cb_menuEditZoom(fltk::Item* o, void* v)
|
---|
339 | {
|
---|
340 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
341 | ->
|
---|
342 | cb_menuEditZoom_i(o,v);
|
---|
343 | }
|
---|
344 |
|
---|
345 | //---------------------------------------------------------------------------
|
---|
346 | // Wire Callback
|
---|
347 | //---------------------------------------------------------------------------
|
---|
348 | inline void GeoMeshViewUI::cb_menuRenderWire_i(fltk::Item *item, void*)
|
---|
349 | {
|
---|
350 | if (item->value())
|
---|
351 | {
|
---|
352 | geoMeshView->activeWire();
|
---|
353 | }
|
---|
354 | else
|
---|
355 | {
|
---|
356 | geoMeshView->deactiveWire();
|
---|
357 | }
|
---|
358 |
|
---|
359 | // Repaint the canvas.
|
---|
360 | //geoMeshView->redraw();
|
---|
361 |
|
---|
362 | // Repaint the main window.
|
---|
363 | mMainWindow->redraw();
|
---|
364 | }
|
---|
365 |
|
---|
366 | void GeoMeshViewUI::cb_menuRenderWire(fltk::Item* o, void* v)
|
---|
367 | {
|
---|
368 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
369 | ->
|
---|
370 | cb_menuRenderWire_i(o,v);
|
---|
371 | }
|
---|
372 |
|
---|
373 | //---------------------------------------------------------------------------
|
---|
374 | // Solid Callback
|
---|
375 | //---------------------------------------------------------------------------
|
---|
376 | inline void GeoMeshViewUI::cb_menuRenderSolid_i(fltk::Item *item, void*)
|
---|
377 | {
|
---|
378 | if (item->value())
|
---|
379 | {
|
---|
380 | geoMeshView->activeSolid();
|
---|
381 | }
|
---|
382 | else
|
---|
383 | {
|
---|
384 | geoMeshView->deactiveSolid();
|
---|
385 | }
|
---|
386 |
|
---|
387 | // Repaint the canvas.
|
---|
388 | //geoMeshView->redraw();
|
---|
389 |
|
---|
390 | // Repaint the main window.
|
---|
391 | mMainWindow->redraw();
|
---|
392 | }
|
---|
393 |
|
---|
394 | void GeoMeshViewUI::cb_menuRenderSolid(fltk::Item* o, void* v)
|
---|
395 | {
|
---|
396 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
397 | ->
|
---|
398 | cb_menuRenderSolid_i(o,v);
|
---|
399 | }
|
---|
400 |
|
---|
401 | //---------------------------------------------------------------------------
|
---|
402 | // CW callback
|
---|
403 | //---------------------------------------------------------------------------
|
---|
404 | inline void GeoMeshViewUI::cb_menuRenderCW_i(fltk::Item *item, void*)
|
---|
405 | {
|
---|
406 | // Clear the CCW state.
|
---|
407 | menuRenderCCW->clear_value();
|
---|
408 | geoMeshView->deactiveCCW();
|
---|
409 |
|
---|
410 | // If the item is activated.
|
---|
411 | if (item->value())
|
---|
412 | {
|
---|
413 | geoMeshView->activeCW();
|
---|
414 | }
|
---|
415 | else
|
---|
416 | {
|
---|
417 | geoMeshView->deactiveCW();
|
---|
418 | }
|
---|
419 |
|
---|
420 | // Repaint the main window.
|
---|
421 | mMainWindow->redraw();
|
---|
422 | }
|
---|
423 |
|
---|
424 | void GeoMeshViewUI::cb_menuRenderCW(fltk::Item* o, void* v)
|
---|
425 | {
|
---|
426 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
427 | ->
|
---|
428 | cb_menuRenderCW_i(o,v);
|
---|
429 | }
|
---|
430 |
|
---|
431 | //---------------------------------------------------------------------------
|
---|
432 | // CCW callback
|
---|
433 | //---------------------------------------------------------------------------
|
---|
434 | inline void GeoMeshViewUI::cb_menuRenderCCW_i(fltk::Item *item, void*)
|
---|
435 | {
|
---|
436 | // Clear the CW state.
|
---|
437 | menuRenderCW->clear_value();
|
---|
438 | geoMeshView->deactiveCW();
|
---|
439 |
|
---|
440 | // If the item is activated.
|
---|
441 | if (item->value())
|
---|
442 | {
|
---|
443 | geoMeshView->activeCCW();
|
---|
444 | }
|
---|
445 | else
|
---|
446 | {
|
---|
447 | geoMeshView->deactiveCCW();
|
---|
448 | }
|
---|
449 |
|
---|
450 | // Repaint the main window.
|
---|
451 | mMainWindow->redraw();
|
---|
452 | }
|
---|
453 |
|
---|
454 | void GeoMeshViewUI::cb_menuRenderCCW(fltk::Item* o, void* v)
|
---|
455 | {
|
---|
456 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
457 | ->
|
---|
458 | cb_menuRenderCCW_i(o,v);
|
---|
459 | }
|
---|
460 |
|
---|
461 | //---------------------------------------------------------------------------
|
---|
462 | // Flat callback
|
---|
463 | //---------------------------------------------------------------------------
|
---|
464 | inline void GeoMeshViewUI::cb_menuRenderFlat_i(fltk::Item*, void*)
|
---|
465 | {
|
---|
466 | // Deactive smooth flag.
|
---|
467 | menuRenderSmooth->clear_value();
|
---|
468 |
|
---|
469 | // Sets flat lighting.
|
---|
470 | geoMeshView->flat();
|
---|
471 |
|
---|
472 | // Repaint the main window.
|
---|
473 | mMainWindow->redraw();
|
---|
474 | }
|
---|
475 |
|
---|
476 | void GeoMeshViewUI::cb_menuRenderFlat(fltk::Item* o, void* v)
|
---|
477 | {
|
---|
478 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
479 | ->
|
---|
480 | cb_menuRenderFlat_i(o,v);
|
---|
481 | }
|
---|
482 |
|
---|
483 | //---------------------------------------------------------------------------
|
---|
484 | // Smooth Callback
|
---|
485 | //---------------------------------------------------------------------------
|
---|
486 | inline void GeoMeshViewUI::cb_menuRenderSmooth_i(fltk::Item*, void*)
|
---|
487 | {
|
---|
488 | // Deactive flat flag.
|
---|
489 | menuRenderFlat->clear_value();
|
---|
490 |
|
---|
491 | // Sets smooth lighting.
|
---|
492 | geoMeshView->smooth();
|
---|
493 |
|
---|
494 | // Repaint the main window.
|
---|
495 | mMainWindow->redraw();
|
---|
496 | }
|
---|
497 |
|
---|
498 | void GeoMeshViewUI::cb_menuRenderSmooth(fltk::Item* o, void* v)
|
---|
499 | {
|
---|
500 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
501 | ->
|
---|
502 | cb_menuRenderSmooth_i(o,v);
|
---|
503 | }
|
---|
504 |
|
---|
505 | //---------------------------------------------------------------------------
|
---|
506 | // Textures callback
|
---|
507 | //---------------------------------------------------------------------------
|
---|
508 | inline void GeoMeshViewUI::cb_menuRenderTextures_i(fltk::Item*, void*)
|
---|
509 | {
|
---|
510 | // Repaint the main window.
|
---|
511 | mMainWindow->redraw();
|
---|
512 | }
|
---|
513 |
|
---|
514 | void GeoMeshViewUI::cb_menuRenderTextures(fltk::Item* o, void* v)
|
---|
515 | {
|
---|
516 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
517 | ->
|
---|
518 | cb_menuRenderTextures_i(o,v);
|
---|
519 | }
|
---|
520 |
|
---|
521 | //---------------------------------------------------------------------------
|
---|
522 | // Stripify Callback
|
---|
523 | //---------------------------------------------------------------------------
|
---|
524 | inline void GeoMeshViewUI::cb_menuStripify_i(fltk::Item*, void*)
|
---|
525 | {
|
---|
526 | // Show title.
|
---|
527 | mProcessTitle->label("Stripify");
|
---|
528 | mProcessBar->position(0);
|
---|
529 |
|
---|
530 | // Hide the right panel.
|
---|
531 | hideRightPanel();
|
---|
532 |
|
---|
533 | // Show the stripify panel.
|
---|
534 | showStripify();
|
---|
535 |
|
---|
536 | // Sets menus application state to STRIPIFY.
|
---|
537 | mApplicationState = STRIPIFY;
|
---|
538 |
|
---|
539 | // Repaint the window.
|
---|
540 | mMainWindow->redraw();
|
---|
541 | }
|
---|
542 |
|
---|
543 | void GeoMeshViewUI::cb_menuStripify(fltk::Item* o, void* v)
|
---|
544 | {
|
---|
545 | ((GeoMeshViewUI*) (o->parent()->parent()->user_data()))
|
---|
546 | ->
|
---|
547 | cb_menuStripify_i(o,v);
|
---|
548 | }
|
---|
549 |
|
---|
550 | //---------------------------------------------------------------------------
|
---|
551 | // Simplify Callback
|
---|
552 | //---------------------------------------------------------------------------
|
---|
553 | inline void GeoMeshViewUI::cb_menuSimplify_i(fltk::ItemGroup*, void*)
|
---|
554 | {
|
---|
555 | }
|
---|
556 |
|
---|
557 | void GeoMeshViewUI::cb_menuSimplify(fltk::ItemGroup* o, void* v)
|
---|
558 | {
|
---|
559 | ((GeoMeshViewUI*) (o->parent()->parent()->user_data()))
|
---|
560 | ->
|
---|
561 | cb_menuSimplify_i(o,v);
|
---|
562 | }
|
---|
563 |
|
---|
564 | //---------------------------------------------------------------------------
|
---|
565 | // Edge collapse Callback
|
---|
566 | //---------------------------------------------------------------------------
|
---|
567 | inline void GeoMeshViewUI::cb_menuSimplifyEdgeCollapse_i(fltk::Item*, void*)
|
---|
568 | {
|
---|
569 | // Show title.
|
---|
570 | mProcessTitle->label("Mesh Simplification");
|
---|
571 | mProcessBar->position(0);
|
---|
572 |
|
---|
573 | // Hide the right panel.
|
---|
574 | hideRightPanel();
|
---|
575 |
|
---|
576 | // Show the edge collapse panel.
|
---|
577 | showEdgeCollapse();
|
---|
578 |
|
---|
579 | // Sets menus application state to EDGE_COLLAPSE.
|
---|
580 | mApplicationState = EDGE_COLLAPSE;
|
---|
581 |
|
---|
582 | // Repaint the window.
|
---|
583 | mMainWindow->redraw();
|
---|
584 |
|
---|
585 | }
|
---|
586 |
|
---|
587 | void GeoMeshViewUI::cb_menuSimplifyEdgeCollapse(fltk::Item* o, void* v)
|
---|
588 | {
|
---|
589 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
590 | ->
|
---|
591 | cb_menuSimplifyEdgeCollapse_i(o,v);
|
---|
592 | }
|
---|
593 |
|
---|
594 | //---------------------------------------------------------------------------
|
---|
595 | // Leaves collapse Callback
|
---|
596 | //---------------------------------------------------------------------------
|
---|
597 | inline void GeoMeshViewUI::cb_menuSimplifyLeavesCollapse_i(fltk::Item*, void*)
|
---|
598 | {
|
---|
599 | // Show title.
|
---|
600 | mProcessTitle->label("Leaves Simplification");
|
---|
601 | mProcessBar->position(0);
|
---|
602 |
|
---|
603 | // Hide the right panel.
|
---|
604 | hideRightPanel();
|
---|
605 |
|
---|
606 | // Show the leaves collapse panel.
|
---|
607 | showLeavesCollapse();
|
---|
608 |
|
---|
609 | // Sets menus application state to LEAVES_COLLAPSE.
|
---|
610 | mApplicationState = LEAVES_COLLAPSE;
|
---|
611 |
|
---|
612 | // Repaint the window.
|
---|
613 | mMainWindow->redraw();
|
---|
614 | }
|
---|
615 |
|
---|
616 | void GeoMeshViewUI::cb_menuSimplifyLeavesCollapse(fltk::Item* o, void* v)
|
---|
617 | {
|
---|
618 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
619 | ->
|
---|
620 | cb_menuSimplifyLeavesCollapse_i(o,v);
|
---|
621 | }
|
---|
622 |
|
---|
623 | //---------------------------------------------------------------------------
|
---|
624 | // Tree select leaves simplification Callback
|
---|
625 | //---------------------------------------------------------------------------
|
---|
626 | inline void GeoMeshViewUI::cb_menuSelectLeaves_i(fltk::Item*, void*)
|
---|
627 | {
|
---|
628 | // Show title.
|
---|
629 | mProcessTitle->label("Select Leaves");
|
---|
630 |
|
---|
631 | showMeshInfo();
|
---|
632 | mButtonProcess->show();
|
---|
633 | mButtonProcess->activate();
|
---|
634 | mApplicationState = SELECT_LEAVES;
|
---|
635 | }
|
---|
636 |
|
---|
637 | void GeoMeshViewUI::cb_menuSelectLeaves(fltk::Item* o, void* v)
|
---|
638 | {
|
---|
639 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
640 | ->
|
---|
641 | cb_menuSelectLeaves_i(o,v);
|
---|
642 | }
|
---|
643 |
|
---|
644 | //---------------------------------------------------------------------------
|
---|
645 | // Auto Generate LodStrips Callback
|
---|
646 | //---------------------------------------------------------------------------
|
---|
647 | inline void GeoMeshViewUI::cb_menuLodStripsGenerate_i(fltk::Item*, void*)
|
---|
648 | {
|
---|
649 | // Show title.
|
---|
650 | mProcessTitle->label("Generate LodStrips");
|
---|
651 | mProcessBar->position(0);
|
---|
652 | mBuildBar->position(0);
|
---|
653 |
|
---|
654 | // Hide the right panel.
|
---|
655 | hideRightPanel();
|
---|
656 |
|
---|
657 | // Show the LodStrips panel.
|
---|
658 | showAutoGenerateLodStrips();
|
---|
659 |
|
---|
660 | // Sets menus application state to LODSTRIPS_AUTO.
|
---|
661 | mApplicationState = LODSTRIPS_AUTO;
|
---|
662 |
|
---|
663 | // Repaint the window.
|
---|
664 | mMainWindow->redraw();
|
---|
665 | }
|
---|
666 |
|
---|
667 | void GeoMeshViewUI::cb_menuLodStripsGenerate(fltk::Item* o, void* v)
|
---|
668 | {
|
---|
669 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
670 | ->
|
---|
671 | cb_menuLodStripsGenerate_i(o,v);
|
---|
672 | }
|
---|
673 |
|
---|
674 | //---------------------------------------------------------------------------
|
---|
675 | // Visualize LodStrips Callback
|
---|
676 | //---------------------------------------------------------------------------
|
---|
677 | inline void GeoMeshViewUI::cb_menuLodStripsVisualize_i(fltk::Item*, void*)
|
---|
678 | {
|
---|
679 | fltk::FileChooser *fcho;
|
---|
680 | const char *lod_file;
|
---|
681 |
|
---|
682 | // Sets menus application state to NONE.
|
---|
683 | mApplicationState = NONE;
|
---|
684 |
|
---|
685 | // Deactive Lod strip visualization.
|
---|
686 | geoMeshView->deactiveLodStrip();
|
---|
687 | geoMeshView->deactiveLodTree();
|
---|
688 |
|
---|
689 | // Loads a mesh file.
|
---|
690 | openMeshFile();
|
---|
691 |
|
---|
692 | // Show title.
|
---|
693 | mProcessTitle->label("Visualize LodStrips");
|
---|
694 |
|
---|
695 | // If an object is loaded.
|
---|
696 | if (mGeoMesh != NULL)
|
---|
697 | {
|
---|
698 | fcho = new fltk::FileChooser("",
|
---|
699 | "*.lod",
|
---|
700 | fltk::FileChooser::CREATE,
|
---|
701 | "Open Lod file");
|
---|
702 |
|
---|
703 | fcho->exec();
|
---|
704 |
|
---|
705 | // If a file was selected.
|
---|
706 | if (fcho->value())
|
---|
707 | {
|
---|
708 | // Build lod strips library.
|
---|
709 | setLodStripsLibrary(string(fcho->value()), mGeoMesh);
|
---|
710 |
|
---|
711 | // Sets the aplication mode.
|
---|
712 | mApplicationState = VISUALIZE_LODSTRIPS;
|
---|
713 | }
|
---|
714 |
|
---|
715 | // Free memory.
|
---|
716 | delete fcho;
|
---|
717 | }
|
---|
718 |
|
---|
719 | // Hide the right panel.
|
---|
720 | hideRightPanel();
|
---|
721 |
|
---|
722 | // Show the Visulize LodStrips panel.
|
---|
723 | showSlider();
|
---|
724 |
|
---|
725 | // Repaint the window.
|
---|
726 | mMainWindow->redraw();
|
---|
727 | }
|
---|
728 |
|
---|
729 |
|
---|
730 | inline void GeoMeshViewUI::cb_menuLodTreesVisualize_i(fltk::Item*, void*)
|
---|
731 | {
|
---|
732 | fltk::FileChooser *fcho;
|
---|
733 | const char *lod_file;
|
---|
734 |
|
---|
735 | // Sets menus application state to NONE.
|
---|
736 | mApplicationState = NONE;
|
---|
737 |
|
---|
738 | // Deactive Lod strip visualization.
|
---|
739 | geoMeshView->deactiveLodTree();
|
---|
740 | geoMeshView->deactiveLodStrip();
|
---|
741 |
|
---|
742 | // Loads a mesh file.
|
---|
743 | openMeshFile();
|
---|
744 |
|
---|
745 | // Show title.
|
---|
746 | mProcessTitle->label("Visualize LodTrees");
|
---|
747 |
|
---|
748 | // If an object is loaded.
|
---|
749 | if (mGeoMesh != NULL)
|
---|
750 | {
|
---|
751 | fcho = new fltk::FileChooser("",
|
---|
752 | "*.lod",
|
---|
753 | fltk::FileChooser::CREATE,
|
---|
754 | "Open Lod file");
|
---|
755 |
|
---|
756 | fcho->exec();
|
---|
757 |
|
---|
758 | // If a file was selected.
|
---|
759 | if (fcho->value())
|
---|
760 | {
|
---|
761 | // Build lod strips library.
|
---|
762 | setLodTreesLibrary(string(fcho->value()), mGeoMesh);
|
---|
763 |
|
---|
764 | // Sets the aplication mode.
|
---|
765 | mApplicationState = VISUALIZE_LODTREES;
|
---|
766 | }
|
---|
767 |
|
---|
768 | // Free memory.
|
---|
769 | delete fcho;
|
---|
770 | }
|
---|
771 |
|
---|
772 | // Hide the right panel.
|
---|
773 | hideRightPanel();
|
---|
774 |
|
---|
775 | // Show the Visulize LodTree panel.
|
---|
776 | showSlider();
|
---|
777 |
|
---|
778 | // Repaint the window.
|
---|
779 | mMainWindow->redraw();
|
---|
780 | }
|
---|
781 | void GeoMeshViewUI::cb_menuLodTreesVisualize(fltk::Item *o, void *v)
|
---|
782 | {
|
---|
783 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
784 | ->
|
---|
785 | cb_menuLodTreesVisualize_i(o,v);
|
---|
786 | }
|
---|
787 |
|
---|
788 | void GeoMeshViewUI::cb_menuLodStripsVisualize(fltk::Item* o, void* v)
|
---|
789 | {
|
---|
790 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
791 | ->
|
---|
792 | cb_menuLodStripsVisualize_i(o,v);
|
---|
793 | }
|
---|
794 |
|
---|
795 | //---------------------------------------------------------------------------
|
---|
796 | // Open LodStrip trunk Callback
|
---|
797 | //---------------------------------------------------------------------------
|
---|
798 | inline void GeoMeshViewUI::cb_menuLodTreesOpenLodStripTrunk_i(fltk::Item*, void*)
|
---|
799 | {
|
---|
800 | }
|
---|
801 |
|
---|
802 | void GeoMeshViewUI::cb_menuLodTreesOpenLodStripTrunk(fltk::Item* o, void* v)
|
---|
803 | {
|
---|
804 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
805 | ->
|
---|
806 | cb_menuLodTreesOpenLodStripTrunk_i(o,v);
|
---|
807 | }
|
---|
808 |
|
---|
809 | //---------------------------------------------------------------------------
|
---|
810 | // Open leaves simplification Callback
|
---|
811 | //---------------------------------------------------------------------------
|
---|
812 | inline void GeoMeshViewUI::cb_menuLodTreesOpenLeavesSimplification_i(fltk::Item*, void*)
|
---|
813 | {
|
---|
814 | // Hide the right panel.
|
---|
815 | hideRightPanel();
|
---|
816 |
|
---|
817 | // Show the LodTrees panel.
|
---|
818 | showOpenLeavesSimplification();
|
---|
819 |
|
---|
820 | // Sets menus application state to LODTREES.
|
---|
821 | mApplicationState = LODTREES;
|
---|
822 |
|
---|
823 | // Repaint the window.
|
---|
824 | mMainWindow->redraw();
|
---|
825 | }
|
---|
826 |
|
---|
827 | void GeoMeshViewUI::cb_menuLodTreesOpenLeavesSimplification(fltk::Item* o, void* v)
|
---|
828 | {
|
---|
829 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
830 | ->
|
---|
831 | cb_menuLodTreesOpenLeavesSimplification_i(o,v);
|
---|
832 | }
|
---|
833 |
|
---|
834 |
|
---|
835 |
|
---|
836 | //---------------------------------------------------------------------------
|
---|
837 | // About Callback
|
---|
838 | //---------------------------------------------------------------------------
|
---|
839 | inline void GeoMeshViewUI::cb_menuHelpAbout_i(fltk::Item*, void*)
|
---|
840 | {
|
---|
841 | new GTAboutDialog();
|
---|
842 | }
|
---|
843 |
|
---|
844 | void GeoMeshViewUI::cb_menuHelpAbout(fltk::Item* o, void* v)
|
---|
845 | {
|
---|
846 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
847 | ->
|
---|
848 | cb_menuHelpAbout_i(o,v);
|
---|
849 | }
|
---|
850 |
|
---|
851 | //---------------------------------------------------------------------------
|
---|
852 | // Button Process Callback
|
---|
853 | //---------------------------------------------------------------------------
|
---|
854 | inline void GeoMeshViewUI::cb_mButtonProcess_i(fltk::Button*, void*)
|
---|
855 | {
|
---|
856 | Mesh *mesh_aux;
|
---|
857 |
|
---|
858 | // Sets the progress bar to process bar.
|
---|
859 | progressBarType = PROCESS;
|
---|
860 | mProcessBar->position(0);
|
---|
861 |
|
---|
862 | // If there is a mesh object.
|
---|
863 | if (mGeoMesh != NULL)
|
---|
864 | {
|
---|
865 | // Choose between aplication state.
|
---|
866 | switch(mApplicationState)
|
---|
867 | {
|
---|
868 | // Stripify state.
|
---|
869 | case STRIPIFY:
|
---|
870 |
|
---|
871 | // Stripify the mesh object.
|
---|
872 | stripify();
|
---|
873 |
|
---|
874 | break;
|
---|
875 |
|
---|
876 | // Simplify edge collapse state.
|
---|
877 | case EDGE_COLLAPSE:
|
---|
878 |
|
---|
879 | // if the mesh is stripified.
|
---|
880 | if (mGeoMesh->mType == GEO_TRIANGLE_STRIPS)
|
---|
881 | {
|
---|
882 | fltk::alert("Can't simplify a mesh in triagle strips.");
|
---|
883 | }
|
---|
884 | else
|
---|
885 | {
|
---|
886 | // Simplify the mesh object.
|
---|
887 | simplifyEdgeCollapse();
|
---|
888 | }
|
---|
889 | break;
|
---|
890 |
|
---|
891 | // Simplify leaves
|
---|
892 | case LEAVES_COLLAPSE:
|
---|
893 |
|
---|
894 | // Simplify the mesh object.
|
---|
895 | simplifyLeavesCollapse();
|
---|
896 |
|
---|
897 | // Create the leaves simplification sequence.
|
---|
898 | createLeavesSequence();
|
---|
899 |
|
---|
900 | break;
|
---|
901 |
|
---|
902 | // Simplify and generate simplification sequence.
|
---|
903 | case LODSTRIPS_AUTO:
|
---|
904 |
|
---|
905 | // if the mesh is stripified.
|
---|
906 | if (mGeoMesh->mType == GEO_TRIANGLE_STRIPS)
|
---|
907 | {
|
---|
908 | fltk::alert("Can't simplify a mesh in triagle strips.");
|
---|
909 | }
|
---|
910 | else
|
---|
911 | {
|
---|
912 | // Transform NoSV Mesh to a SV Mesh.
|
---|
913 | mesh_aux = mGeoMesh->toSharedVertex();
|
---|
914 |
|
---|
915 | // Deletes the mesh No Shared Vertex.
|
---|
916 | delete mGeoMesh;
|
---|
917 |
|
---|
918 | // Gets the mesh Shared Vertex.
|
---|
919 | mGeoMesh = mesh_aux;
|
---|
920 |
|
---|
921 | // Simplify the mesh object.
|
---|
922 | simplifyEdgeCollapse();
|
---|
923 |
|
---|
924 | // Create the qslim simplification sequence.
|
---|
925 | createQslimSequence();
|
---|
926 | }
|
---|
927 |
|
---|
928 | break;
|
---|
929 |
|
---|
930 | // Añadido 23-12-2005
|
---|
931 | case SELECT_LEAVES:
|
---|
932 |
|
---|
933 | idMeshLeaves = paintMesh();
|
---|
934 |
|
---|
935 | // Set the leaves submesh.
|
---|
936 | geoMeshView->setLeavesSubmesh(idMeshLeaves);
|
---|
937 |
|
---|
938 | // Refresh mesh info.
|
---|
939 | showMeshInfo();
|
---|
940 |
|
---|
941 | break;
|
---|
942 | }
|
---|
943 |
|
---|
944 | // Refresh geometry attributes.
|
---|
945 | refreshApplicationBar();
|
---|
946 | }
|
---|
947 |
|
---|
948 | // Repaint the GL Window.
|
---|
949 | mMainWindow->redraw();
|
---|
950 | }
|
---|
951 |
|
---|
952 | void GeoMeshViewUI::cb_mButtonProcess(fltk::Button* o, void* v)
|
---|
953 | {
|
---|
954 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
955 | ->
|
---|
956 | cb_mButtonProcess_i(o,v);
|
---|
957 | }
|
---|
958 |
|
---|
959 | //---------------------------------------------------------------------------
|
---|
960 | // Button Sort Callback
|
---|
961 | //---------------------------------------------------------------------------
|
---|
962 | inline void GeoMeshViewUI::cb_mButtonSort_i(fltk::Button*, void*)
|
---|
963 | {
|
---|
964 | }
|
---|
965 |
|
---|
966 | void GeoMeshViewUI::cb_mButtonSort(fltk::Button* o, void* v)
|
---|
967 | {
|
---|
968 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
969 | ->
|
---|
970 | cb_mButtonSort_i(o,v);
|
---|
971 | }
|
---|
972 |
|
---|
973 | //---------------------------------------------------------------------------
|
---|
974 | // Button Build Callback
|
---|
975 | //---------------------------------------------------------------------------
|
---|
976 | inline void GeoMeshViewUI::cb_mButtonBuild_i(fltk::Button*, void*)
|
---|
977 | {
|
---|
978 | char *file_name;
|
---|
979 | GeoMeshSaver *mesh_saver;
|
---|
980 | Serializer *oSerializer;
|
---|
981 |
|
---|
982 | // Sets the progress bar to process bar.
|
---|
983 | progressBarType = BUILD;
|
---|
984 |
|
---|
985 | // Reset the build bar.
|
---|
986 | mBuildBar->position(0);
|
---|
987 |
|
---|
988 | // If there is a mesh object.
|
---|
989 | if (mGeoMesh != NULL)
|
---|
990 | {
|
---|
991 | // Choose between aplication state.
|
---|
992 | switch(mApplicationState)
|
---|
993 | {
|
---|
994 | // Build the LOD file.
|
---|
995 | case LODSTRIPS_AUTO:
|
---|
996 |
|
---|
997 | // Builder
|
---|
998 | // Open file chooser dialog.
|
---|
999 | file_name = fltk::file_chooser( "Build LOD",
|
---|
1000 | "*",
|
---|
1001 | "");
|
---|
1002 |
|
---|
1003 | // If a file was selected.
|
---|
1004 | if (file_name)
|
---|
1005 | {
|
---|
1006 | // Undo the simplification changes.
|
---|
1007 | undo();
|
---|
1008 |
|
---|
1009 | // Stripify the mesh object.
|
---|
1010 | stripify();
|
---|
1011 |
|
---|
1012 | // Reset the build bar.
|
---|
1013 | mBuildBar->position(0);
|
---|
1014 |
|
---|
1015 | // Simplification sequence.
|
---|
1016 | oMeshSimpSequence = new MeshSimplificationSequence();
|
---|
1017 |
|
---|
1018 | // Loads a simplification sequence file.
|
---|
1019 | oMeshSimpSequence->Load(Serializer( "mqslimSequence.txt",
|
---|
1020 | Serializer::READ));
|
---|
1021 |
|
---|
1022 | // If the simplification sequence and the mesh exist.
|
---|
1023 | if (oMeshSimpSequence && mGeoMesh)
|
---|
1024 | {
|
---|
1025 | oLodStrip = new LodStripsConstructor( mGeoMesh,
|
---|
1026 | oMeshSimpSequence,
|
---|
1027 | idMeshLeaves,
|
---|
1028 | progress_function);
|
---|
1029 |
|
---|
1030 | oSerializer = new Serializer( strcat(file_name,".lod"),
|
---|
1031 | Serializer::Mode::WRITE);
|
---|
1032 |
|
---|
1033 | oLodStrip->Save(*oSerializer);
|
---|
1034 |
|
---|
1035 | // Close file.
|
---|
1036 | delete oSerializer;
|
---|
1037 |
|
---|
1038 | // Deletes the previous mesh.
|
---|
1039 | delete mUndoMesh;
|
---|
1040 |
|
---|
1041 | mUndoMesh = new Mesh();
|
---|
1042 |
|
---|
1043 | // Sets the undo mesh.
|
---|
1044 | *mUndoMesh = *mGeoMesh;
|
---|
1045 |
|
---|
1046 | delete mGeoMesh;
|
---|
1047 |
|
---|
1048 | mGeoMesh = oLodStrip->GetMesh();
|
---|
1049 |
|
---|
1050 | geoMeshView->setMesh(mGeoMesh);
|
---|
1051 |
|
---|
1052 | mesh_saver = new GeoMeshSaver(mMeshBounds);
|
---|
1053 | file_name[strlen(file_name) - 4] = '\0';
|
---|
1054 | mesh_saver->save( mGeoMesh,
|
---|
1055 | strcat(file_name,".mesh"));
|
---|
1056 | delete mesh_saver;
|
---|
1057 |
|
---|
1058 | }
|
---|
1059 | else
|
---|
1060 | {
|
---|
1061 | // Error message.
|
---|
1062 | fltk::alert("There is no simplification sequence.");
|
---|
1063 | }
|
---|
1064 |
|
---|
1065 | // Deletes the siplification sequence object.
|
---|
1066 | delete oMeshSimpSequence;
|
---|
1067 | }
|
---|
1068 | break;
|
---|
1069 | }
|
---|
1070 | // Refresh data aplication.
|
---|
1071 | refreshApplicationBar();
|
---|
1072 | }
|
---|
1073 | }
|
---|
1074 |
|
---|
1075 | void GeoMeshViewUI::cb_mButtonBuild(fltk::Button *o, void *v)
|
---|
1076 | {
|
---|
1077 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
1078 | ->
|
---|
1079 | cb_mButtonBuild_i(o,v);
|
---|
1080 | }
|
---|
1081 |
|
---|
1082 | //---------------------------------------------------------------------------
|
---|
1083 | // Lod Slider Callback
|
---|
1084 | //---------------------------------------------------------------------------
|
---|
1085 | inline void GeoMeshViewUI::cb_mLodSlider_i(fltk::Slider *o, void *)
|
---|
1086 | {
|
---|
1087 | // Change the lod.
|
---|
1088 | geoMeshView->GoToLod((unsigned int)o->value());
|
---|
1089 |
|
---|
1090 | // Refresh data aplication.
|
---|
1091 | refreshApplicationBar();
|
---|
1092 |
|
---|
1093 | mMainWindow->flush();
|
---|
1094 | }
|
---|
1095 |
|
---|
1096 | void GeoMeshViewUI::cb_mLodSlider(fltk::Slider *o, void *v)
|
---|
1097 | {
|
---|
1098 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
1099 | ->
|
---|
1100 | cb_mLodSlider_i(o,v);
|
---|
1101 | }
|
---|
1102 |
|
---|
1103 | //---------------------------------------------------------------------------
|
---|
1104 | // Mesh Info Callback
|
---|
1105 | //---------------------------------------------------------------------------
|
---|
1106 | inline void GeoMeshViewUI::cb_mMeshInfo_i(fltk::Browser *, void *)
|
---|
1107 | {
|
---|
1108 | paintMesh();
|
---|
1109 | }
|
---|
1110 |
|
---|
1111 | void GeoMeshViewUI::cb_mMeshInfo(fltk::Browser* o, void* v)
|
---|
1112 | {
|
---|
1113 | ((GeoMeshViewUI*) (o->parent()->parent()->parent()->user_data()))
|
---|
1114 | ->
|
---|
1115 | cb_mMeshInfo_i(o,v);
|
---|
1116 | }
|
---|
1117 |
|
---|
1118 | //---------------------------------------------------------------------------
|
---|
1119 | // Logo Callback
|
---|
1120 | //---------------------------------------------------------------------------
|
---|
1121 | inline void GeoMeshViewUI::cb_mLogo_i(fltk::InvisibleBox*, void*)
|
---|
1122 | {
|
---|
1123 | }
|
---|
1124 |
|
---|
1125 | void GeoMeshViewUI::cb_mLogo(fltk::InvisibleBox* o, void* v)
|
---|
1126 | {
|
---|
1127 | ((GeoMeshViewUI*) (o->parent()->parent()->user_data()))
|
---|
1128 | ->
|
---|
1129 | cb_mLogo_i(o,v);
|
---|
1130 | }
|
---|
1131 |
|
---|
1132 | //---------------------------------------------------------------------------
|
---|
1133 | // Show the stripify panel
|
---|
1134 | //---------------------------------------------------------------------------
|
---|
1135 | void GeoMeshViewUI::showStripify()
|
---|
1136 | {
|
---|
1137 | /*
|
---|
1138 | mTypeLabel->set_visible();
|
---|
1139 | mTypeLabel->activate();
|
---|
1140 |
|
---|
1141 | mOneCacheStrip->set_visible();
|
---|
1142 | mOneCacheStrip->activate();
|
---|
1143 |
|
---|
1144 | mQualityStrips->set_visible();
|
---|
1145 | mQualityStrips->activate();
|
---|
1146 | */
|
---|
1147 |
|
---|
1148 | mButtonProcess->set_visible();
|
---|
1149 | mButtonProcess->activate();
|
---|
1150 |
|
---|
1151 | mProcessBar->set_visible();
|
---|
1152 | mProcessBar->activate();
|
---|
1153 | }
|
---|
1154 |
|
---|
1155 | //---------------------------------------------------------------------------
|
---|
1156 | // Hide the stripify panel
|
---|
1157 | //---------------------------------------------------------------------------
|
---|
1158 | void GeoMeshViewUI::hideStripify()
|
---|
1159 | {
|
---|
1160 | /*
|
---|
1161 | mTypeLabel->hide();
|
---|
1162 | mTypeLabel->deactivate();
|
---|
1163 | */
|
---|
1164 |
|
---|
1165 | mOneCacheStrip->hide();
|
---|
1166 | mOneCacheStrip->deactivate();
|
---|
1167 |
|
---|
1168 | mQualityStrips->hide();
|
---|
1169 | mQualityStrips->deactivate();
|
---|
1170 |
|
---|
1171 | mButtonProcess->hide();
|
---|
1172 | mButtonProcess->deactivate();
|
---|
1173 |
|
---|
1174 | mProcessBar->hide();
|
---|
1175 | mProcessBar->deactivate();
|
---|
1176 | }
|
---|
1177 |
|
---|
1178 | //---------------------------------------------------------------------------
|
---|
1179 | // Show the Simplify Edge Collapse panel
|
---|
1180 | //---------------------------------------------------------------------------
|
---|
1181 | void GeoMeshViewUI::showEdgeCollapse()
|
---|
1182 | {
|
---|
1183 | mMetricLabel->set_visible();
|
---|
1184 | mMetricLabel->activate();
|
---|
1185 |
|
---|
1186 | mGeometryBased->set_visible();
|
---|
1187 | mGeometryBased->activate();
|
---|
1188 | mGeometryBased->set();
|
---|
1189 |
|
---|
1190 | mImageBased->set_visible();
|
---|
1191 | mImageBased->activate();
|
---|
1192 |
|
---|
1193 | /*
|
---|
1194 | mTypeLabel->set_visible();
|
---|
1195 | mTypeLabel->activate();
|
---|
1196 |
|
---|
1197 | mChangeVertices->set_visible();
|
---|
1198 | mChangeVertices->activate();
|
---|
1199 | */
|
---|
1200 |
|
---|
1201 | mMeshReductionLabel->set_visible();
|
---|
1202 | mMeshReductionLabel->activate();
|
---|
1203 |
|
---|
1204 | mPercent->set_visible();
|
---|
1205 | mPercent->activate();
|
---|
1206 | mPercent->set();
|
---|
1207 |
|
---|
1208 | mVerticesNumber->set_visible();
|
---|
1209 | mVerticesNumber->activate();
|
---|
1210 |
|
---|
1211 | mMeshReduction->set_visible();
|
---|
1212 |
|
---|
1213 | // JGA
|
---|
1214 | // Allows floating point.
|
---|
1215 | mMeshReduction->type(fltk::FloatInput::FLOAT);
|
---|
1216 |
|
---|
1217 | mMeshReduction->activate();
|
---|
1218 |
|
---|
1219 | mButtonProcess->set_visible();
|
---|
1220 | mButtonProcess->activate();
|
---|
1221 |
|
---|
1222 | mProcessBar->set_visible();
|
---|
1223 | mProcessBar->activate();
|
---|
1224 | }
|
---|
1225 |
|
---|
1226 | //---------------------------------------------------------------------------
|
---|
1227 | // Hide the Simplify Edge Collapse
|
---|
1228 | //---------------------------------------------------------------------------
|
---|
1229 | void GeoMeshViewUI::hideEdgeCollapse()
|
---|
1230 | {
|
---|
1231 | mMetricLabel->hide();
|
---|
1232 | mMetricLabel->deactivate();
|
---|
1233 |
|
---|
1234 | mGeometryBased->hide();
|
---|
1235 | mGeometryBased->deactivate();
|
---|
1236 |
|
---|
1237 | mImageBased->hide();
|
---|
1238 | mImageBased->deactivate();
|
---|
1239 |
|
---|
1240 | /*
|
---|
1241 | mTypeLabel->hide();
|
---|
1242 | mTypeLabel->deactivate();
|
---|
1243 |
|
---|
1244 | mChangeVertices->hide();
|
---|
1245 | mChangeVertices->deactivate();
|
---|
1246 | */
|
---|
1247 |
|
---|
1248 | mMeshReductionLabel->hide();
|
---|
1249 | mMeshReductionLabel->deactivate();
|
---|
1250 |
|
---|
1251 | mPercent->hide();
|
---|
1252 | mPercent->deactivate();
|
---|
1253 |
|
---|
1254 | mVerticesNumber->hide();
|
---|
1255 | mVerticesNumber->deactivate();
|
---|
1256 |
|
---|
1257 | mMeshReduction->hide();
|
---|
1258 | mMeshReduction->deactivate();
|
---|
1259 |
|
---|
1260 | mButtonProcess->hide();
|
---|
1261 | mButtonProcess->deactivate();
|
---|
1262 |
|
---|
1263 | mProcessBar->hide();
|
---|
1264 | mProcessBar->deactivate();
|
---|
1265 | }
|
---|
1266 |
|
---|
1267 | //---------------------------------------------------------------------------
|
---|
1268 | // Show the Simlify Leaves Collapse
|
---|
1269 | //---------------------------------------------------------------------------
|
---|
1270 | void GeoMeshViewUI::showLeavesCollapse()
|
---|
1271 | {
|
---|
1272 | mMetricLabel->set_visible();
|
---|
1273 | mMetricLabel->activate();
|
---|
1274 |
|
---|
1275 | mGeometryBased->set_visible();
|
---|
1276 | mGeometryBased->activate();
|
---|
1277 | mGeometryBased->set();
|
---|
1278 |
|
---|
1279 | mImageBased->set_visible();
|
---|
1280 | mImageBased->activate();
|
---|
1281 |
|
---|
1282 | /*
|
---|
1283 | mTypeLabel->set_visible();
|
---|
1284 | mTypeLabel->activate();
|
---|
1285 |
|
---|
1286 | mChangeTexture->set_visible();
|
---|
1287 | mChangeTexture->activate();
|
---|
1288 | */
|
---|
1289 |
|
---|
1290 | mMeshReductionLabel->set_visible();
|
---|
1291 | mMeshReductionLabel->activate();
|
---|
1292 |
|
---|
1293 | mPercent->set_visible();
|
---|
1294 | mPercent->activate();
|
---|
1295 | mPercent->set();
|
---|
1296 |
|
---|
1297 | mVerticesNumber->set_visible();
|
---|
1298 | mVerticesNumber->activate();
|
---|
1299 |
|
---|
1300 | mMeshReduction->set_visible();
|
---|
1301 | mMeshReduction->type(fltk::FloatInput::FLOAT);
|
---|
1302 | mMeshReduction->activate();
|
---|
1303 |
|
---|
1304 | mButtonProcess->set_visible();
|
---|
1305 | mButtonProcess->activate();
|
---|
1306 |
|
---|
1307 | mProcessBar->set_visible();
|
---|
1308 | mProcessBar->activate();
|
---|
1309 | }
|
---|
1310 |
|
---|
1311 | //---------------------------------------------------------------------------
|
---|
1312 | // Hide the Simplify Leaves Collapse
|
---|
1313 | //---------------------------------------------------------------------------
|
---|
1314 | void GeoMeshViewUI::hideLeavesCollapse()
|
---|
1315 | {
|
---|
1316 | mMetricLabel->hide();
|
---|
1317 | mMetricLabel->deactivate();
|
---|
1318 |
|
---|
1319 | mGeometryBased->hide();
|
---|
1320 | mGeometryBased->deactivate();
|
---|
1321 |
|
---|
1322 | mImageBased->hide();
|
---|
1323 | mImageBased->deactivate();
|
---|
1324 |
|
---|
1325 | /*
|
---|
1326 | mTypeLabel->hide();
|
---|
1327 | mTypeLabel->deactivate();
|
---|
1328 |
|
---|
1329 | mChangeTexture->hide();
|
---|
1330 | mChangeTexture->deactivate();
|
---|
1331 | */
|
---|
1332 |
|
---|
1333 | mMeshReductionLabel->hide();
|
---|
1334 | mMeshReductionLabel->deactivate();
|
---|
1335 |
|
---|
1336 | mPercent->hide();
|
---|
1337 | mPercent->deactivate();
|
---|
1338 |
|
---|
1339 | mVerticesNumber->hide();
|
---|
1340 | mVerticesNumber->deactivate();
|
---|
1341 |
|
---|
1342 | mMeshReduction->hide();
|
---|
1343 | mMeshReduction->deactivate();
|
---|
1344 |
|
---|
1345 | mButtonProcess->hide();
|
---|
1346 | mButtonProcess->deactivate();
|
---|
1347 |
|
---|
1348 | mProcessBar->hide();
|
---|
1349 | mProcessBar->deactivate();
|
---|
1350 | }
|
---|
1351 |
|
---|
1352 | //---------------------------------------------------------------------------
|
---|
1353 | // Show the LodStrips Panel
|
---|
1354 | //---------------------------------------------------------------------------
|
---|
1355 | void GeoMeshViewUI::showOpenMeshSimplification()
|
---|
1356 | {
|
---|
1357 | mButtonProcess->set_visible();
|
---|
1358 | mButtonProcess->activate();
|
---|
1359 |
|
---|
1360 | mProcessBar->set_visible();
|
---|
1361 | mProcessBar->activate();
|
---|
1362 |
|
---|
1363 | mButtonBuild->set_visible();
|
---|
1364 | mButtonBuild->activate();
|
---|
1365 |
|
---|
1366 | mBuildBar->set_visible();
|
---|
1367 | mBuildBar->activate();
|
---|
1368 | }
|
---|
1369 |
|
---|
1370 | //---------------------------------------------------------------------------
|
---|
1371 | // Hide the LodStrips Panel
|
---|
1372 | //---------------------------------------------------------------------------
|
---|
1373 | void GeoMeshViewUI::hideOpenMeshSimplification()
|
---|
1374 | {
|
---|
1375 | mButtonProcess->hide();
|
---|
1376 | mButtonProcess->deactivate();
|
---|
1377 |
|
---|
1378 | mProcessBar->hide();
|
---|
1379 | mProcessBar->deactivate();
|
---|
1380 |
|
---|
1381 | mButtonBuild->hide();
|
---|
1382 | mButtonBuild->deactivate();
|
---|
1383 |
|
---|
1384 | mBuildBar->hide();
|
---|
1385 | mBuildBar->deactivate();
|
---|
1386 | }
|
---|
1387 |
|
---|
1388 | //---------------------------------------------------------------------------
|
---|
1389 | // Shows the auto generate LodStrips panel
|
---|
1390 | //---------------------------------------------------------------------------
|
---|
1391 | void GeoMeshViewUI::showAutoGenerateLodStrips()
|
---|
1392 | {
|
---|
1393 | // Shows the simplify panel.
|
---|
1394 | showEdgeCollapse();
|
---|
1395 |
|
---|
1396 | mButtonBuild->set_visible();
|
---|
1397 | mButtonBuild->activate();
|
---|
1398 |
|
---|
1399 | mBuildBar->set_visible();
|
---|
1400 | mBuildBar->activate();
|
---|
1401 | }
|
---|
1402 |
|
---|
1403 | //---------------------------------------------------------------------------
|
---|
1404 | // Show the LodStrips visulization panel
|
---|
1405 | //---------------------------------------------------------------------------
|
---|
1406 | void GeoMeshViewUI::showSlider()
|
---|
1407 | {
|
---|
1408 | mLodSlider->set_visible();
|
---|
1409 | mLodSlider->activate();
|
---|
1410 | }
|
---|
1411 |
|
---|
1412 | //---------------------------------------------------------------------------
|
---|
1413 | // Hide the LodStrips visualization panel
|
---|
1414 | //---------------------------------------------------------------------------
|
---|
1415 | void GeoMeshViewUI::hideSlider()
|
---|
1416 | {
|
---|
1417 | mLodSlider->hide();
|
---|
1418 | mLodSlider->deactivate();
|
---|
1419 | }
|
---|
1420 |
|
---|
1421 |
|
---|
1422 | //---------------------------------------------------------------------------
|
---|
1423 | // Show the LodTrees Panel
|
---|
1424 | //---------------------------------------------------------------------------
|
---|
1425 | void GeoMeshViewUI::showOpenLeavesSimplification()
|
---|
1426 | {
|
---|
1427 | mButtonBuild->set_visible();
|
---|
1428 | mButtonBuild->activate();
|
---|
1429 |
|
---|
1430 | mBuildBar->set_visible();
|
---|
1431 | mBuildBar->activate();
|
---|
1432 | }
|
---|
1433 |
|
---|
1434 | //---------------------------------------------------------------------------
|
---|
1435 | // Hide the LodTrees Panel
|
---|
1436 | //---------------------------------------------------------------------------
|
---|
1437 | void GeoMeshViewUI::hideOpenLeavesSimplification()
|
---|
1438 | {
|
---|
1439 | mButtonBuild->hide();
|
---|
1440 | mButtonBuild->deactivate();
|
---|
1441 |
|
---|
1442 | mBuildBar->hide();
|
---|
1443 | mBuildBar->deactivate();
|
---|
1444 | }
|
---|
1445 |
|
---|
1446 | //---------------------------------------------------------------------------
|
---|
1447 | // Show the mesh info browser
|
---|
1448 | //---------------------------------------------------------------------------
|
---|
1449 | void GeoMeshViewUI::showMeshInfo()
|
---|
1450 | {
|
---|
1451 | char type[10];
|
---|
1452 |
|
---|
1453 | if (mGeoMesh)
|
---|
1454 | {
|
---|
1455 | // Remove previous mesh information
|
---|
1456 | this->mMeshInfo->remove_all();
|
---|
1457 | ogeometry = new fltk::ItemGroup("Geometry");
|
---|
1458 | ogeometry->begin();
|
---|
1459 |
|
---|
1460 | fltk::ItemGroup **oprueba;
|
---|
1461 | oprueba=new fltk::ItemGroup*[mGeoMesh->mSubMeshCount];
|
---|
1462 | for(int i=0; i<mGeoMesh->mSubMeshCount;i++)
|
---|
1463 | {
|
---|
1464 | char *cadena=new char[12];
|
---|
1465 |
|
---|
1466 | if (geoMeshView->getLeavesSubmesh() >= 0)
|
---|
1467 | {
|
---|
1468 | if (geoMeshView->getLeavesSubmesh() == i)
|
---|
1469 | {
|
---|
1470 | strcpy(type,"(Leaves)");
|
---|
1471 | }
|
---|
1472 | else
|
---|
1473 | {
|
---|
1474 | strcpy(type,"(Trunc)");
|
---|
1475 | }
|
---|
1476 | }
|
---|
1477 | else
|
---|
1478 | {
|
---|
1479 | strcpy(type,"");
|
---|
1480 | }
|
---|
1481 |
|
---|
1482 | // Submesh identifier.
|
---|
1483 | sprintf(cadena,"SubMesh %d %s",i,type);
|
---|
1484 |
|
---|
1485 | oprueba[i] = new fltk::ItemGroup(cadena);
|
---|
1486 | oprueba[i]->begin();
|
---|
1487 | fltk::Item *sharedGeometry;
|
---|
1488 | if (mGeoMesh->mSubMesh[i].mSharedVertexBuffer)
|
---|
1489 | {
|
---|
1490 | sharedGeometry = new fltk::Item("Shared Geometry: Yes");
|
---|
1491 | }
|
---|
1492 | else
|
---|
1493 | {
|
---|
1494 | sharedGeometry = new fltk::Item("Shared Geometry: No");
|
---|
1495 | }
|
---|
1496 |
|
---|
1497 | char *cadena2=new char[30];
|
---|
1498 | sprintf(cadena2, "Number of indexes: %d",mGeoMesh->mSubMesh[i].mIndexCount);
|
---|
1499 | fltk::Item *numberIndex = new fltk::Item(cadena2);
|
---|
1500 | if (mGeoMesh->mSubMesh[i].mType==Geometry::GEO_TRIANGLE_LIST)
|
---|
1501 | {
|
---|
1502 | fltk::Item *type = new fltk::Item("Triangle List");
|
---|
1503 | }
|
---|
1504 | else
|
---|
1505 | {
|
---|
1506 | fltk::Item *type = new fltk::Item("Triangle Strips");
|
---|
1507 | }
|
---|
1508 |
|
---|
1509 | char *cadenavertex=new char[30];
|
---|
1510 | sprintf(cadenavertex, "Number of vertices: %d",mGeoMesh->mSubMesh[i].mVertexBuffer->mVertexCount);
|
---|
1511 | fltk::Item *numberVertex = new fltk::Item(cadenavertex);
|
---|
1512 |
|
---|
1513 | if (mGeoMesh->mSubMesh[i].mVertexBuffer->mVertexInfo & Geometry::VERTEX_NORMAL)
|
---|
1514 | {
|
---|
1515 | fltk::Item *normals = new fltk::Item("Normals: Yes");
|
---|
1516 | }
|
---|
1517 | else
|
---|
1518 | {
|
---|
1519 | fltk::Item *normals = new fltk::Item("Normals: No");
|
---|
1520 | }
|
---|
1521 |
|
---|
1522 | if (mGeoMesh->mSubMesh[i].mVertexBuffer->mVertexInfo & Geometry::VERTEX_TEXCOORDS)
|
---|
1523 | {
|
---|
1524 | fltk::Item *textures = new fltk::Item("Textures: Yes");
|
---|
1525 | }
|
---|
1526 | else
|
---|
1527 | {
|
---|
1528 | fltk::Item *textures = new fltk::Item("Textures: No");
|
---|
1529 | }
|
---|
1530 |
|
---|
1531 |
|
---|
1532 | oprueba[i]->end();
|
---|
1533 | }
|
---|
1534 | ogeometry->end();
|
---|
1535 | this->mMeshInfo->add(ogeometry);
|
---|
1536 | }
|
---|
1537 |
|
---|
1538 | // Hide the right panel.
|
---|
1539 | hideRightPanel();
|
---|
1540 |
|
---|
1541 | mMeshInfo->set_visible();
|
---|
1542 | mMeshInfo->activate();
|
---|
1543 | }
|
---|
1544 |
|
---|
1545 | //---------------------------------------------------------------------------
|
---|
1546 | // Hide the mesh info browser
|
---|
1547 | //---------------------------------------------------------------------------
|
---|
1548 | void GeoMeshViewUI::hideMeshInfo()
|
---|
1549 | {
|
---|
1550 | mMeshInfo->hide();
|
---|
1551 | mMeshInfo->deactivate();
|
---|
1552 | }
|
---|
1553 |
|
---|
1554 | //---------------------------------------------------------------------------
|
---|
1555 | // Hide the right panel
|
---|
1556 | //---------------------------------------------------------------------------
|
---|
1557 | void GeoMeshViewUI::hideRightPanel()
|
---|
1558 | {
|
---|
1559 | hideStripify();
|
---|
1560 | hideEdgeCollapse();
|
---|
1561 | hideLeavesCollapse();
|
---|
1562 | hideOpenMeshSimplification();
|
---|
1563 | hideOpenLeavesSimplification();
|
---|
1564 | hideSlider();
|
---|
1565 | hideMeshInfo();
|
---|
1566 | }
|
---|
1567 |
|
---|
1568 | //---------------------------------------------------------------------------
|
---|
1569 | // Get the number of vertices
|
---|
1570 | //---------------------------------------------------------------------------
|
---|
1571 | size_t GeoMeshViewUI::getVertexCount(Mesh *geoMesh)
|
---|
1572 | {
|
---|
1573 | size_t vertex_count;
|
---|
1574 | SubMesh *geoSubMesh;
|
---|
1575 |
|
---|
1576 | vertex_count = geoMesh->mVertexBuffer->mVertexCount;
|
---|
1577 |
|
---|
1578 | // For each submesh.
|
---|
1579 | for (int submesh = 0; submesh < geoMesh->mSubMeshCount; submesh++)
|
---|
1580 | {
|
---|
1581 | // Gets the actual submesh.
|
---|
1582 | geoSubMesh = &geoMesh->mSubMesh[submesh];
|
---|
1583 |
|
---|
1584 | // If the mesh does not have shared vertex.
|
---|
1585 | if (!geoSubMesh->mSharedVertexBuffer)
|
---|
1586 | {
|
---|
1587 | // Adds the vertex of the submesh to the total count.
|
---|
1588 | vertex_count += geoSubMesh->mVertexBuffer->mVertexCount;
|
---|
1589 | }
|
---|
1590 | }
|
---|
1591 |
|
---|
1592 | return vertex_count;
|
---|
1593 | }
|
---|
1594 |
|
---|
1595 | //---------------------------------------------------------------------------
|
---|
1596 | // Get the number of triangles
|
---|
1597 | //---------------------------------------------------------------------------
|
---|
1598 | size_t GeoMeshViewUI::getTriangleCount(Geometry::Mesh *geoMesh)
|
---|
1599 | {
|
---|
1600 | size_t triangle_count;
|
---|
1601 | SubMesh *geoSubMesh;
|
---|
1602 |
|
---|
1603 | // Initialize the triangle count.
|
---|
1604 | triangle_count = 0;
|
---|
1605 |
|
---|
1606 | // If the application is in visualize lodstrips mode.
|
---|
1607 | if (mApplicationState == VISUALIZE_LODSTRIPS)
|
---|
1608 | {
|
---|
1609 | triangle_count = geoMeshView->getLodStripsTriangleCount();
|
---|
1610 | }
|
---|
1611 | else
|
---|
1612 | {
|
---|
1613 | // For each submesh.
|
---|
1614 | for (int submesh = 0; submesh < geoMesh->mSubMeshCount; submesh++)
|
---|
1615 | {
|
---|
1616 | // Gets the actual submesh.
|
---|
1617 | geoSubMesh = &geoMesh->mSubMesh[submesh];
|
---|
1618 |
|
---|
1619 | switch (geoMesh->mType)
|
---|
1620 | {
|
---|
1621 | case GEO_TRIANGLE_LIST:
|
---|
1622 | triangle_count += geoSubMesh->mIndexCount / 3;
|
---|
1623 | break;
|
---|
1624 | case GEO_TRIANGLE_STRIPS:
|
---|
1625 | triangle_count += geoSubMesh->mIndexCount - 2;
|
---|
1626 | break;
|
---|
1627 | }
|
---|
1628 | }
|
---|
1629 | }
|
---|
1630 |
|
---|
1631 | return triangle_count;
|
---|
1632 | }
|
---|
1633 |
|
---|
1634 | //---------------------------------------------------------------------------
|
---|
1635 | // Get the number of strips
|
---|
1636 | //---------------------------------------------------------------------------
|
---|
1637 | size_t GeoMeshViewUI::getStripCount(Geometry::Mesh *geoMesh)
|
---|
1638 | {
|
---|
1639 | size_t strip_count;
|
---|
1640 | SubMesh *geoSubMesh;
|
---|
1641 |
|
---|
1642 | // Initialize the triangle count.
|
---|
1643 | strip_count = 0;
|
---|
1644 |
|
---|
1645 | if (geoMesh->mType == GEO_TRIANGLE_STRIPS)
|
---|
1646 | {
|
---|
1647 | // For each submesh.
|
---|
1648 | for (int submesh = 0; submesh < geoMesh->mSubMeshCount; submesh++)
|
---|
1649 | {
|
---|
1650 | // Gets the actual submesh.
|
---|
1651 | geoSubMesh = &geoMesh->mSubMesh[submesh];
|
---|
1652 |
|
---|
1653 | strip_count += geoSubMesh->mStripCount;
|
---|
1654 | }
|
---|
1655 | }
|
---|
1656 | return strip_count;
|
---|
1657 | }
|
---|
1658 |
|
---|
1659 | //---------------------------------------------------------------------------
|
---|
1660 | // It paints the submesh selected by the mMeshInfo tree
|
---|
1661 | // Trate the mMeshInfo event
|
---|
1662 | //---------------------------------------------------------------------------
|
---|
1663 | int GeoMeshViewUI::paintMesh(void)
|
---|
1664 | {
|
---|
1665 | char selectedTag[100];
|
---|
1666 | char *pch;
|
---|
1667 | char *p;
|
---|
1668 | int meshNumber;
|
---|
1669 |
|
---|
1670 | // Initializa mesh to not selected.
|
---|
1671 | meshNumber = -1;
|
---|
1672 |
|
---|
1673 | // Shows the selected object label
|
---|
1674 | strcpy(selectedTag,mMeshInfo->goto_focus()->label());
|
---|
1675 |
|
---|
1676 | p=strstr(selectedTag,"SubMesh ");
|
---|
1677 |
|
---|
1678 | // If the item begins with string "SubMesh"
|
---|
1679 | if (p!=NULL)
|
---|
1680 | {
|
---|
1681 | pch = strtok (selectedTag," ");
|
---|
1682 | pch = strtok (NULL, " ");
|
---|
1683 | sscanf(pch,"%d",&meshNumber);
|
---|
1684 | }
|
---|
1685 |
|
---|
1686 | geoMeshView->setColorSubmeshi(meshNumber);
|
---|
1687 | geoMeshView->redraw();
|
---|
1688 |
|
---|
1689 | return meshNumber;
|
---|
1690 | }
|
---|
1691 |
|
---|
1692 | //---------------------------------------------------------------------------
|
---|
1693 | // Simplify the mesh object.
|
---|
1694 | //---------------------------------------------------------------------------
|
---|
1695 | void GeoMeshViewUI::simplifyEdgeCollapse()
|
---|
1696 | {
|
---|
1697 | Real percent;
|
---|
1698 |
|
---|
1699 | simplificacionState = QSLIM;
|
---|
1700 |
|
---|
1701 | mMeshSimplifier = new ImageBasedSimplifier(mGeoMesh, progress_function);
|
---|
1702 |
|
---|
1703 | mMeshSimplifier->setMeshLeaves(idMeshLeaves);
|
---|
1704 |
|
---|
1705 | if (mPercent->value() == true)
|
---|
1706 | {
|
---|
1707 | // Simplificación por porcentaje
|
---|
1708 | if (mMeshReduction->fvalue() <= 100.0 && mMeshReduction->fvalue()>0.0)
|
---|
1709 | {
|
---|
1710 | percent = mMeshReduction->fvalue();
|
---|
1711 | percent = percent / 100.0;
|
---|
1712 |
|
---|
1713 | // Simplifica el geomesh -> Parámetro es un factor LOD [0,1].
|
---|
1714 | mMeshSimplifier->Simplify(percent);
|
---|
1715 |
|
---|
1716 | // Deletes the previous mesh.
|
---|
1717 | delete mUndoMesh;
|
---|
1718 |
|
---|
1719 | mUndoMesh = new Mesh();
|
---|
1720 |
|
---|
1721 | // Sets the undo mesh.
|
---|
1722 | *mUndoMesh = *mGeoMesh;
|
---|
1723 |
|
---|
1724 | delete mGeoMesh;
|
---|
1725 |
|
---|
1726 | mGeoMesh = mMeshSimplifier->GetMesh();
|
---|
1727 |
|
---|
1728 | // Visualize mesh.
|
---|
1729 | geoMeshView->setMesh(mGeoMesh);
|
---|
1730 | }
|
---|
1731 | else
|
---|
1732 | {
|
---|
1733 | fltk::alert("Wrong value for simplification.\n"
|
---|
1734 | "Valid values [0..100]");
|
---|
1735 | }
|
---|
1736 | }
|
---|
1737 | else
|
---|
1738 | {
|
---|
1739 | // Simplificar hasta un número de vértices.
|
---|
1740 | uint32 v = (uint32)mMeshReduction->fvalue();
|
---|
1741 |
|
---|
1742 | // Simplifica el geomesh -> Parámetro es un factor LOD [0,1].
|
---|
1743 | mMeshSimplifier->Simplify(v);
|
---|
1744 |
|
---|
1745 | // Deletes the previous mesh.
|
---|
1746 | delete mUndoMesh;
|
---|
1747 |
|
---|
1748 | mUndoMesh = new Mesh();
|
---|
1749 |
|
---|
1750 | // Sets the undo mesh.
|
---|
1751 | *mUndoMesh = *mGeoMesh;
|
---|
1752 |
|
---|
1753 | delete mGeoMesh;
|
---|
1754 |
|
---|
1755 | mGeoMesh = mMeshSimplifier->GetMesh();
|
---|
1756 |
|
---|
1757 | // Visualize the mesh.
|
---|
1758 | geoMeshView->setMesh(mGeoMesh);
|
---|
1759 | }
|
---|
1760 | }
|
---|
1761 |
|
---|
1762 | //---------------------------------------------------------------------------
|
---|
1763 | // Simplify the mesh object.
|
---|
1764 | //---------------------------------------------------------------------------
|
---|
1765 | void GeoMeshViewUI::simplifyLeavesCollapse()
|
---|
1766 | {
|
---|
1767 | uint32 vi;
|
---|
1768 |
|
---|
1769 | // if the mesh is stripified.
|
---|
1770 | if (mGeoMesh->mType == GEO_TRIANGLE_STRIPS)
|
---|
1771 | {
|
---|
1772 | fltk::alert("Can't simplify a tree in triagle strips.");
|
---|
1773 | }
|
---|
1774 | // if the mesh is in triangle list.
|
---|
1775 | else
|
---|
1776 | {
|
---|
1777 | simplificacionState = HOJAS;
|
---|
1778 |
|
---|
1779 | mTreeSimplifier = new TreeSimplifier(mGeoMesh, progress_function);
|
---|
1780 | vi = (uint32)mMeshReduction->fvalue();
|
---|
1781 |
|
---|
1782 | // Simplify
|
---|
1783 | if(idMeshLeaves != (unsigned short)-1)
|
---|
1784 | {
|
---|
1785 | // Simplify
|
---|
1786 | mTreeSimplifier->Simplify(vi, idMeshLeaves);
|
---|
1787 |
|
---|
1788 | // Deletes the previous mesh.
|
---|
1789 | delete mUndoMesh;
|
---|
1790 |
|
---|
1791 | mUndoMesh = new Mesh();
|
---|
1792 |
|
---|
1793 | // Sets the undo mesh.
|
---|
1794 | *mUndoMesh = *mGeoMesh;
|
---|
1795 |
|
---|
1796 | delete mGeoMesh;
|
---|
1797 |
|
---|
1798 | mGeoMesh = mTreeSimplifier->GetMesh();
|
---|
1799 |
|
---|
1800 | geoMeshView->setMesh(mGeoMesh);
|
---|
1801 | }
|
---|
1802 | else
|
---|
1803 | {
|
---|
1804 | fltk::alert("You must select the mesh that contains the leaves.");
|
---|
1805 | }
|
---|
1806 | }
|
---|
1807 | }
|
---|
1808 |
|
---|
1809 | //---------------------------------------------------------------------------
|
---|
1810 | // Create a simplification sequence of the QSLIM method.
|
---|
1811 | //---------------------------------------------------------------------------
|
---|
1812 | void GeoMeshViewUI::createQslimSequence()
|
---|
1813 | {
|
---|
1814 | MeshSimplificationSequence *secsimpl;
|
---|
1815 |
|
---|
1816 | secsimpl = mMeshSimplifier->GetSimplificationSequence();
|
---|
1817 |
|
---|
1818 | secsimpl->putMeshName(nombremesh); // Nombre del mesh para guardar la secuencia de simplificación
|
---|
1819 | secsimpl->Save(Geometry::Serializer("mqslimSequence.txt",Serializer::WRITE));
|
---|
1820 |
|
---|
1821 | delete secsimpl;
|
---|
1822 | }
|
---|
1823 |
|
---|
1824 | //---------------------------------------------------------------------------
|
---|
1825 | // Create a simplification sequence of the leaves.
|
---|
1826 | //---------------------------------------------------------------------------
|
---|
1827 | void GeoMeshViewUI::createLeavesSequence()
|
---|
1828 | {
|
---|
1829 | TreeSimplificationSequence *tree_sequencer;
|
---|
1830 |
|
---|
1831 | tree_sequencer = mTreeSimplifier->GetSimplificationSequence();
|
---|
1832 |
|
---|
1833 | tree_sequencer->putMeshName(nombremesh);
|
---|
1834 | tree_sequencer->Save(Serializer("leavesSequence.txt",Serializer::WRITE));
|
---|
1835 |
|
---|
1836 | delete tree_sequencer;
|
---|
1837 | }
|
---|
1838 |
|
---|
1839 | //---------------------------------------------------------------------------
|
---|
1840 | // Stripify the mesh object.
|
---|
1841 | //---------------------------------------------------------------------------
|
---|
1842 | void GeoMeshViewUI::stripify()
|
---|
1843 | {
|
---|
1844 | char char_value[10];
|
---|
1845 | CustomStripifier *geoStripifier;
|
---|
1846 |
|
---|
1847 | // if the mesh is stripified.
|
---|
1848 | if (mGeoMesh->mType == GEO_TRIANGLE_STRIPS)
|
---|
1849 | {
|
---|
1850 | fltk::alert("The mesh is already in strips.");
|
---|
1851 | }
|
---|
1852 | // if the mesh is in triangle list.
|
---|
1853 | else
|
---|
1854 | {
|
---|
1855 | //Stripify.
|
---|
1856 | geoStripifier = new CustomStripifier(mGeoMesh);
|
---|
1857 |
|
---|
1858 | // Set the progress bar function.
|
---|
1859 | geoStripifier->SetProgressFunc(progress_function);
|
---|
1860 |
|
---|
1861 | // Sets the leaves submesh if exists.
|
---|
1862 | geoStripifier->SetSubMeshLeaves(idMeshLeaves);
|
---|
1863 |
|
---|
1864 | if (geoStripifier->Stripify())
|
---|
1865 | {
|
---|
1866 | // Deletes the mesh object.
|
---|
1867 | delete mUndoMesh;
|
---|
1868 |
|
---|
1869 | mUndoMesh = new Mesh();
|
---|
1870 |
|
---|
1871 | *mUndoMesh = *mGeoMesh;
|
---|
1872 |
|
---|
1873 | delete mGeoMesh;
|
---|
1874 |
|
---|
1875 | // Gets the mesh stripified.
|
---|
1876 | mGeoMesh = geoStripifier->GetMesh();
|
---|
1877 |
|
---|
1878 | // Visualize the mesh stripified.
|
---|
1879 | geoMeshView->setMesh(mGeoMesh);
|
---|
1880 |
|
---|
1881 | // Store the color of the strips.
|
---|
1882 | geoMeshView->setStripColors();
|
---|
1883 | }
|
---|
1884 | else
|
---|
1885 | {
|
---|
1886 | // Error message.
|
---|
1887 | fltk::alert("Impossible to stripify. The mesh is not manifold");
|
---|
1888 | }
|
---|
1889 |
|
---|
1890 | // Deletes the stripifier object.
|
---|
1891 | delete geoStripifier;
|
---|
1892 | }
|
---|
1893 | }
|
---|
1894 |
|
---|
1895 | //---------------------------------------------------------------------------
|
---|
1896 | // Method that undo then mesh changes.
|
---|
1897 | //---------------------------------------------------------------------------
|
---|
1898 | void GeoMeshViewUI::undo()
|
---|
1899 | {
|
---|
1900 | // if the undo mesh is not initialized.
|
---|
1901 | if (mUndoMesh != NULL)
|
---|
1902 | {
|
---|
1903 | // Deletes the actual mesh.
|
---|
1904 | delete mGeoMesh;
|
---|
1905 |
|
---|
1906 | mGeoMesh = new Mesh();
|
---|
1907 |
|
---|
1908 | // Restore the previous mesh.
|
---|
1909 | *mGeoMesh = *mUndoMesh;
|
---|
1910 |
|
---|
1911 | // Visualize the mesh.
|
---|
1912 | geoMeshView->setMesh(mGeoMesh);
|
---|
1913 |
|
---|
1914 | // Refresh geometry attributes.
|
---|
1915 | refreshApplicationBar();
|
---|
1916 |
|
---|
1917 | // Repaint the window.
|
---|
1918 | mMainWindow->redraw();
|
---|
1919 | }
|
---|
1920 | }
|
---|
1921 |
|
---|
1922 | //---------------------------------------------------------------------------
|
---|
1923 | // Refresh number of vertices, triangles, strips, ...
|
---|
1924 | //---------------------------------------------------------------------------
|
---|
1925 | void GeoMeshViewUI::refreshApplicationBar()
|
---|
1926 | {
|
---|
1927 | static char vertices_value[50];
|
---|
1928 | static char triangles_value[50];
|
---|
1929 | static char strips_value[50];
|
---|
1930 |
|
---|
1931 | // Translate the vertex count to a char value.
|
---|
1932 | sprintf(vertices_value,"Vertices %d",getVertexCount(mGeoMesh));
|
---|
1933 |
|
---|
1934 | mVertices->label(vertices_value);
|
---|
1935 |
|
---|
1936 | // Translate the triangle count to a char value.
|
---|
1937 | sprintf(triangles_value,"Triangles %d",getTriangleCount(mGeoMesh));
|
---|
1938 |
|
---|
1939 | mTriangles->label(triangles_value);
|
---|
1940 |
|
---|
1941 | // Translate the triangle count to a char value.
|
---|
1942 | sprintf(strips_value,"Strips %d",getStripCount(mGeoMesh));
|
---|
1943 |
|
---|
1944 | mStrips->label(strips_value);
|
---|
1945 | }
|
---|
1946 |
|
---|
1947 | // Method that updates the porgress bar.
|
---|
1948 | float GeoMeshViewUI::updateProgressBar(float v)
|
---|
1949 | {
|
---|
1950 | fltk::ProgressBar *progressBar;
|
---|
1951 |
|
---|
1952 | // Choose progress bar to update.
|
---|
1953 | switch(progressBarType)
|
---|
1954 | {
|
---|
1955 | case PROCESS:
|
---|
1956 | progressBar = mProcessBar;
|
---|
1957 | break;
|
---|
1958 | case BUILD:
|
---|
1959 | progressBar = mBuildBar;
|
---|
1960 | break;
|
---|
1961 | }
|
---|
1962 |
|
---|
1963 | // Update progress bar.
|
---|
1964 | progressBar->step(v);
|
---|
1965 | progressBar->step();
|
---|
1966 | mMainWindow->flush();
|
---|
1967 | //mMainWindow->redraw();
|
---|
1968 |
|
---|
1969 | return 0;
|
---|
1970 | }
|
---|
1971 |
|
---|
1972 | //---------------------------------------------------------------------------
|
---|
1973 | // Initialize the lodstripslibrary for visualization.
|
---|
1974 | //---------------------------------------------------------------------------
|
---|
1975 | void GeoMeshViewUI::setLodStripsLibrary(std::string lodfile, Mesh *geomesh)
|
---|
1976 | {
|
---|
1977 | // If there is no lod strips object.
|
---|
1978 | if (lodStripsLib)
|
---|
1979 | {
|
---|
1980 | delete lodStripsLib;
|
---|
1981 | }
|
---|
1982 |
|
---|
1983 | // New lod strips object.
|
---|
1984 | lodStripsLib = new LodStripsLibrary(lodfile, geomesh);
|
---|
1985 |
|
---|
1986 | // Sets the slider range.
|
---|
1987 | mLodSlider->range(lodStripsLib->MaxLod(),
|
---|
1988 | lodStripsLib->MinLod());
|
---|
1989 |
|
---|
1990 | // Pass to geomeshview the lod strips object.
|
---|
1991 | geoMeshView->setLodStripsLibrary(lodStripsLib);
|
---|
1992 |
|
---|
1993 | // Puts the slider in the max position.
|
---|
1994 | mLodSlider->value(lodStripsLib->MinLod());
|
---|
1995 | }
|
---|
1996 |
|
---|
1997 | //---------------------------------------------------------------------------
|
---|
1998 | // Initialize the lodTreelibrary for visualization.
|
---|
1999 | //---------------------------------------------------------------------------
|
---|
2000 | void GeoMeshViewUI::setLodTreesLibrary(std::string lodfile, Mesh *geomesh)
|
---|
2001 | {
|
---|
2002 | // If there is no lod strips object.
|
---|
2003 | if (lodTreeLib)
|
---|
2004 | {
|
---|
2005 | delete lodTreeLib;
|
---|
2006 | }
|
---|
2007 |
|
---|
2008 | // New lod strips object.
|
---|
2009 | lodTreeLib = new Geometry::LodTreeLibrary(lodfile, geomesh,"\\\\quake\\home\\\Modelos\\betula_populifolia\\vertices.obj",
|
---|
2010 | "\\\\quake\\home\\\Modelos\\betula_populifolia\\hojas.obj",
|
---|
2011 | "\\\\quake\\home\\\Modelos\\betula_populifolia\\simplifica.obj");
|
---|
2012 |
|
---|
2013 | // Sets the slider range.
|
---|
2014 | mLodSlider->range(lodTreeLib->MaxTrunkLod(), lodTreeLib->MinTrunkLod());
|
---|
2015 |
|
---|
2016 | // Pass to geomeshview the lod strips object.
|
---|
2017 | geoMeshView->setLodTreesLibrary(lodTreeLib);
|
---|
2018 |
|
---|
2019 | // Puts the slider in the max position.
|
---|
2020 | mLodSlider->value(lodTreeLib->MinTrunkLod());
|
---|
2021 | }
|
---|
2022 |
|
---|
2023 | //---------------------------------------------------------------------------
|
---|
2024 | // Open a mesh file.
|
---|
2025 | //---------------------------------------------------------------------------
|
---|
2026 | void GeoMeshViewUI::openMeshFile()
|
---|
2027 | {
|
---|
2028 | fltk::FileChooser *fcho;
|
---|
2029 | static char char_value[10];
|
---|
2030 | static char title[256];
|
---|
2031 |
|
---|
2032 | fcho = new fltk::FileChooser("",
|
---|
2033 | "*.mesh",
|
---|
2034 | fltk::FileChooser::CREATE,
|
---|
2035 | "Open mesh file");
|
---|
2036 |
|
---|
2037 | fcho->exec();
|
---|
2038 |
|
---|
2039 | // File name.
|
---|
2040 | mFileName = (char *)fcho->value();
|
---|
2041 |
|
---|
2042 | if (mFileName)
|
---|
2043 | {
|
---|
2044 | // Set Window Title.
|
---|
2045 | strcpy(title,mFileName);
|
---|
2046 | mMainWindow->label(strcat(title," - GeoTool"));
|
---|
2047 |
|
---|
2048 | // Identify the mesh that stores the leaves
|
---|
2049 | idMeshLeaves = -1;
|
---|
2050 |
|
---|
2051 | // Stores the name of the mesh.
|
---|
2052 | nombremesh = new char[255];
|
---|
2053 | strcpy(nombremesh,mFileName);
|
---|
2054 |
|
---|
2055 | // Delete the current mesh.
|
---|
2056 | delete mGeoMesh;
|
---|
2057 | delete mUndoMesh;
|
---|
2058 |
|
---|
2059 | // Loads a new mesh.
|
---|
2060 | mGeoMesh = geoMeshLoader->load(mFileName);
|
---|
2061 |
|
---|
2062 | // Reset the undo mesh.
|
---|
2063 | mUndoMesh = new Mesh();
|
---|
2064 | *mUndoMesh = *mGeoMesh;
|
---|
2065 |
|
---|
2066 | // Translate the MB count to a char value.
|
---|
2067 | sprintf(char_value,
|
---|
2068 | "MB %.3f",
|
---|
2069 | (float)geoMeshLoader->getFileSize()/1024/1024);
|
---|
2070 |
|
---|
2071 | mMB->label(char_value);
|
---|
2072 |
|
---|
2073 | // Visualize mesh.
|
---|
2074 | geoMeshView->setMesh(mGeoMesh);
|
---|
2075 |
|
---|
2076 | // Get the mesh bounds.
|
---|
2077 | mMeshBounds = geoMeshView->getBoundingBox();
|
---|
2078 |
|
---|
2079 | // Hide right panel.
|
---|
2080 | hideRightPanel();
|
---|
2081 |
|
---|
2082 | // Quit culling.
|
---|
2083 | menuRenderCW->clear_value();
|
---|
2084 | menuRenderCCW->clear_value();
|
---|
2085 | geoMeshView->deactiveCW();
|
---|
2086 | geoMeshView->deactiveCCW();
|
---|
2087 |
|
---|
2088 | // Deactive solid mode and wire.
|
---|
2089 | menuRenderSolid->clear_value();
|
---|
2090 | menuRenderWire->clear_value();
|
---|
2091 | geoMeshView->deactiveSolid();
|
---|
2092 | geoMeshView->deactiveWire();
|
---|
2093 |
|
---|
2094 | // Fit model in midle.
|
---|
2095 | geoMeshView->fit();
|
---|
2096 |
|
---|
2097 | // Lighting smooth.
|
---|
2098 | menuRenderFlat->clear_value();
|
---|
2099 | menuRenderSmooth->set_value();
|
---|
2100 | geoMeshView->smooth();
|
---|
2101 |
|
---|
2102 | // Show title.
|
---|
2103 | mProcessTitle->label("Mesh Info");
|
---|
2104 |
|
---|
2105 | // Shows the mesh info.
|
---|
2106 | showMeshInfo();
|
---|
2107 |
|
---|
2108 | // if the mesh is stripified.
|
---|
2109 | geoMeshView->setStripColors();
|
---|
2110 |
|
---|
2111 | // Refresh geometry attributes.
|
---|
2112 | refreshApplicationBar();
|
---|
2113 | }
|
---|
2114 |
|
---|
2115 | // Free memory.
|
---|
2116 | delete fcho;
|
---|
2117 | }
|
---|
2118 |
|
---|
2119 | /******************/
|
---|
2120 | /* Constructor */
|
---|
2121 | /******************/
|
---|
2122 | GeoMeshViewUI::GeoMeshViewUI(TIPOFUNC fun)
|
---|
2123 | {
|
---|
2124 | progress_function = fun;
|
---|
2125 | fltk::gifImage *logo;
|
---|
2126 |
|
---|
2127 | // Initialize the file name.
|
---|
2128 | mFileName = NULL;
|
---|
2129 |
|
---|
2130 | // Initialize the 3D object.
|
---|
2131 | mGeoMesh = NULL;
|
---|
2132 | mUndoMesh = NULL;
|
---|
2133 |
|
---|
2134 | // Initialize the lod strip object.
|
---|
2135 | lodStripsLib = NULL;
|
---|
2136 | lodTreeLib = NULL;
|
---|
2137 |
|
---|
2138 | // Identify the mesh that stores the leaves
|
---|
2139 | idMeshLeaves = -1;
|
---|
2140 |
|
---|
2141 | // Initialize the loader of meshes.
|
---|
2142 | geoMeshLoader = new GeoMeshLoader();
|
---|
2143 |
|
---|
2144 | // Initialize the menus application state.
|
---|
2145 | mApplicationState = NONE;
|
---|
2146 |
|
---|
2147 | {
|
---|
2148 | fltk::Window* o = new fltk::Window(800, 600,"GeoTool");
|
---|
2149 |
|
---|
2150 | mMainWindow = o;
|
---|
2151 |
|
---|
2152 | // Program Icon for Win32.
|
---|
2153 | mMainWindow->icon((char *)LoadIcon( GetModuleHandle(0),
|
---|
2154 | MAKEINTRESOURCE(GEOICON)));
|
---|
2155 |
|
---|
2156 | // Double buffer.
|
---|
2157 | mMainWindow->set_double_buffer();
|
---|
2158 |
|
---|
2159 | o->user_data((void*)(this));
|
---|
2160 | o->begin();
|
---|
2161 |
|
---|
2162 | {
|
---|
2163 | fltk::Group* o = new fltk::Group(0, 27, 806, 559);
|
---|
2164 | o->begin();
|
---|
2165 |
|
---|
2166 | {
|
---|
2167 | fltk::Group* o;
|
---|
2168 | o = MainView = new fltk::Group(0, 0, 600, 500);
|
---|
2169 | o->begin();
|
---|
2170 |
|
---|
2171 | {
|
---|
2172 | fltk::InvisibleBox* o;
|
---|
2173 | o = cframe = new fltk::InvisibleBox(0, 0, 600, 500);
|
---|
2174 | o->box(fltk::FLAT_BOX);
|
---|
2175 | o->color((fltk::Color)0xffffff00);
|
---|
2176 | //fltk::Group::current()->resizable(o);
|
---|
2177 | }
|
---|
2178 |
|
---|
2179 | {
|
---|
2180 | GeoMeshView* o;
|
---|
2181 | o = geoMeshView = new GeoMeshView( 0,0,600,500,0,this);
|
---|
2182 | }
|
---|
2183 |
|
---|
2184 | o->end();
|
---|
2185 |
|
---|
2186 | fltk::Group::current()->resizable(o);
|
---|
2187 |
|
---|
2188 | }
|
---|
2189 |
|
---|
2190 | {
|
---|
2191 | fltk::Group* o;
|
---|
2192 | o = MainView = new fltk::Group(600, 0, 200, 500);
|
---|
2193 | o->begin();
|
---|
2194 |
|
---|
2195 | {
|
---|
2196 | fltk::Button* o;
|
---|
2197 | //o = mButtonProcess = new fltk::Button(665, 410, 73, 25, "Process");
|
---|
2198 | o = mButtonProcess = new fltk::Button(65, 410, 73, 25, "Process");
|
---|
2199 | o->callback((fltk::Callback*)cb_mButtonProcess);
|
---|
2200 | o->hide();
|
---|
2201 | o->deactivate();
|
---|
2202 | }
|
---|
2203 |
|
---|
2204 | {
|
---|
2205 | fltk::ProgressBar* o;
|
---|
2206 | //o = mProcessBar = new fltk::ProgressBar(616, 435, 175, 18);
|
---|
2207 | o = mProcessBar = new fltk::ProgressBar(16, 435, 175, 18);
|
---|
2208 | o->hide();
|
---|
2209 | o->deactivate();
|
---|
2210 | }
|
---|
2211 |
|
---|
2212 | {
|
---|
2213 | fltk::Button* o;
|
---|
2214 | o = mButtonSort = new fltk::Button(65, 375, 73, 25, "Sort");
|
---|
2215 | o->callback((fltk::Callback*)cb_mButtonSort);
|
---|
2216 | o->hide();
|
---|
2217 | o->deactivate();
|
---|
2218 | }
|
---|
2219 |
|
---|
2220 | {
|
---|
2221 | fltk::ProgressBar* o;
|
---|
2222 | o = mSortBar = new fltk::ProgressBar(16, 390, 175, 18);
|
---|
2223 | o->hide();
|
---|
2224 | o->deactivate();
|
---|
2225 | }
|
---|
2226 |
|
---|
2227 | {
|
---|
2228 | fltk::Button* o;
|
---|
2229 | o = mButtonBuild = new fltk::Button(65, 455, 73, 25, "Build");
|
---|
2230 | o->callback((fltk::Callback*)cb_mButtonBuild);
|
---|
2231 | o->hide();
|
---|
2232 | o->deactivate();
|
---|
2233 | }
|
---|
2234 |
|
---|
2235 | {
|
---|
2236 | fltk::ProgressBar* o;
|
---|
2237 | o = mBuildBar = new fltk::ProgressBar(16, 480, 175, 18);
|
---|
2238 | o->hide();
|
---|
2239 | o->deactivate();
|
---|
2240 | }
|
---|
2241 |
|
---|
2242 | {
|
---|
2243 | fltk::Slider* o;
|
---|
2244 | o = mLodSlider = new fltk::Slider(16, 50, 30, 450);
|
---|
2245 | o->type(fltk::Slider::TICK_BELOW);
|
---|
2246 | o->set_vertical();
|
---|
2247 | o->callback((fltk::Callback*)cb_mLodSlider);
|
---|
2248 | o->hide();
|
---|
2249 | o->deactivate();
|
---|
2250 | }
|
---|
2251 |
|
---|
2252 | {
|
---|
2253 | mMetricLabel = new fltk::Output(26, 28, 5, 25, "Metric");
|
---|
2254 | fltk::Output* o = mMetricLabel;
|
---|
2255 | o->set_vertical();
|
---|
2256 | o->box(fltk::NO_BOX);
|
---|
2257 | o->labelfont(fltk::HELVETICA_BOLD);
|
---|
2258 | o->color((fltk::Color)0xe0dfe300);
|
---|
2259 | o->align(fltk::ALIGN_RIGHT);
|
---|
2260 | }
|
---|
2261 |
|
---|
2262 | {
|
---|
2263 | fltk::Group* o;
|
---|
2264 | o = MainView = new fltk::Group(30, 40, 30, 60);
|
---|
2265 | o->begin();
|
---|
2266 | {
|
---|
2267 | mGeometryBased = new fltk::RadioButton(0, 8, 25, 25, "Geometry based");
|
---|
2268 | mImageBased = new fltk::RadioButton(0, 23, 25, 25, "Image based");
|
---|
2269 | }
|
---|
2270 | o->end();
|
---|
2271 | }
|
---|
2272 |
|
---|
2273 | //mChangeVertices = new fltk::CheckButton(30, 104, 25, 25, "Change vertices");
|
---|
2274 |
|
---|
2275 | {
|
---|
2276 | mProcessTitle = new fltk::Widget(0, 0, 200, 25, "");
|
---|
2277 | fltk::Widget* o = mProcessTitle;
|
---|
2278 | o->set_vertical();
|
---|
2279 | o->box(fltk::NO_BOX);
|
---|
2280 | o->labelfont(fltk::HELVETICA_BOLD);
|
---|
2281 | o->labelsize(15.0);
|
---|
2282 | o->color((fltk::Color)0xe0dfe300);
|
---|
2283 | o->align(fltk::ALIGN_CENTER);
|
---|
2284 | }
|
---|
2285 |
|
---|
2286 | /*
|
---|
2287 | {
|
---|
2288 | mTypeLabel = new fltk::Output(26, 82, 5, 25, "Type");
|
---|
2289 | fltk::Output* o = mTypeLabel;
|
---|
2290 | o->set_vertical();
|
---|
2291 | o->box(fltk::NO_BOX);
|
---|
2292 | o->labelfont(fltk::HELVETICA_BOLD);
|
---|
2293 | o->color((fltk::Color)0xe0dfe300);
|
---|
2294 | o->align(fltk::ALIGN_RIGHT);
|
---|
2295 | }
|
---|
2296 | */
|
---|
2297 |
|
---|
2298 | {
|
---|
2299 | mMeshReductionLabel = new fltk::Output(26, 124, 5, 25, "Mesh Reduction");
|
---|
2300 | fltk::Output* o = mMeshReductionLabel;
|
---|
2301 | o->set_vertical();
|
---|
2302 | o->box(fltk::NO_BOX);
|
---|
2303 | o->labelfont(fltk::HELVETICA_BOLD);
|
---|
2304 | o->color((fltk::Color)0xe0dfe300);
|
---|
2305 | o->align(fltk::ALIGN_RIGHT);
|
---|
2306 | }
|
---|
2307 |
|
---|
2308 | //mChangeTexture = new fltk::CheckButton(30, 104, 25, 25, "Change texture");
|
---|
2309 |
|
---|
2310 | {
|
---|
2311 | fltk::Group* o;
|
---|
2312 | o = MainView = new fltk::Group(30, 140, 30, 60);
|
---|
2313 | o->begin();
|
---|
2314 |
|
---|
2315 | {
|
---|
2316 | mPercent = new fltk::RadioButton(0, 5, 25, 25, "%");
|
---|
2317 | mVerticesNumber = new fltk::RadioButton(0, 20, 25, 25, "Vertices number");
|
---|
2318 | }
|
---|
2319 | o->end();
|
---|
2320 | }
|
---|
2321 |
|
---|
2322 | {
|
---|
2323 | mMeshReduction = new fltk::FloatInput(75, 181, 75, 21, "Value:");
|
---|
2324 | fltk::FloatInput* o = mMeshReduction;
|
---|
2325 | o->type(1);
|
---|
2326 | }
|
---|
2327 |
|
---|
2328 | {
|
---|
2329 | fltk::Group* o;
|
---|
2330 | o = MainView = new fltk::Group(30, 100, 30, 60);
|
---|
2331 | o->begin();
|
---|
2332 |
|
---|
2333 | {
|
---|
2334 | mOneCacheStrip = new fltk::RadioButton(0, 4, 25, 25, "One cache strip");
|
---|
2335 | mQualityStrips = new fltk::RadioButton(0, 23, 25, 25, "Quality strips");
|
---|
2336 | }
|
---|
2337 | o->end();
|
---|
2338 | }
|
---|
2339 |
|
---|
2340 | {
|
---|
2341 | fltk::Browser* o = mMeshInfo = new fltk::Browser(0, 20, 200, 380);
|
---|
2342 | o->set_vertical();
|
---|
2343 | o->callback((fltk::Callback*)cb_mMeshInfo);
|
---|
2344 | }
|
---|
2345 | o->end();
|
---|
2346 | }
|
---|
2347 |
|
---|
2348 | o->end();
|
---|
2349 |
|
---|
2350 | fltk::Group::current()->resizable(o);
|
---|
2351 | }
|
---|
2352 |
|
---|
2353 | {
|
---|
2354 | fltk::MenuBar* o = menuBar = new fltk::MenuBar(1, 2, 801, 21);
|
---|
2355 | o->begin();
|
---|
2356 |
|
---|
2357 | // Menu File.
|
---|
2358 | {
|
---|
2359 | fltk::ItemGroup* o = menuFile = new fltk::ItemGroup("File");
|
---|
2360 | o->begin();
|
---|
2361 |
|
---|
2362 | {
|
---|
2363 | fltk::Item* o = menuFileOpen = new fltk::Item("Open");
|
---|
2364 | o->callback((fltk::Callback*)cb_menuFileOpen);
|
---|
2365 | }
|
---|
2366 |
|
---|
2367 | {
|
---|
2368 | fltk::Item* o = menuFileSave = new fltk::Item("Save");
|
---|
2369 | o->callback((fltk::Callback*)cb_menuFileSave);
|
---|
2370 | }
|
---|
2371 |
|
---|
2372 | {
|
---|
2373 | fltk::Item* o = menuOpenSaveAs = new fltk::Item("Save As");
|
---|
2374 | o->callback((fltk::Callback*)cb_menuOpenSaveAs);
|
---|
2375 | }
|
---|
2376 |
|
---|
2377 | //{
|
---|
2378 | // fltk::Item* o = menuMeshExportOBJ = new fltk::Item("Export to OBJ");
|
---|
2379 | // o->callback((fltk::Callback*)cb_menuMeshExportOBJ);
|
---|
2380 | //}
|
---|
2381 |
|
---|
2382 | //{
|
---|
2383 | // fltk::Item* o = menuFileTransformSharedVertex = new fltk::Item("Transform to Shared Vertex");
|
---|
2384 | // o->callback((fltk::Callback*)cb_menuFileTransformSharedVertex);
|
---|
2385 | //}
|
---|
2386 |
|
---|
2387 | {
|
---|
2388 | fltk::Item* o = menuOpenQuit = new fltk::Item("Quit");
|
---|
2389 | o->callback((fltk::Callback*)cb_menuOpenQuit);
|
---|
2390 | }
|
---|
2391 |
|
---|
2392 | o->end();
|
---|
2393 | }
|
---|
2394 |
|
---|
2395 | // Menu Edit.
|
---|
2396 | {
|
---|
2397 | fltk::ItemGroup* o = menuEdit = new fltk::ItemGroup("Edit");
|
---|
2398 | o->begin();
|
---|
2399 |
|
---|
2400 | {
|
---|
2401 | fltk::Item* o = menuEditUndo = new fltk::Item("Undo");
|
---|
2402 | o->callback((fltk::Callback*)cb_menuEditUndo);
|
---|
2403 | }
|
---|
2404 |
|
---|
2405 | {
|
---|
2406 | fltk::Item* o = menuEditFit = new fltk::Item("Fit");
|
---|
2407 | o->callback((fltk::Callback*)cb_menuEditFit);
|
---|
2408 |
|
---|
2409 | }
|
---|
2410 |
|
---|
2411 | {
|
---|
2412 | fltk::Item* o = menuEditRotate = new fltk::Item("Rotate");
|
---|
2413 | o->type(fltk::Item::RADIO);
|
---|
2414 | o->set_value();
|
---|
2415 | o->callback((fltk::Callback*)cb_menuEditRotate);
|
---|
2416 | }
|
---|
2417 |
|
---|
2418 | {
|
---|
2419 | fltk::Item* o = menuEditPan = new fltk::Item("Pan");
|
---|
2420 | o->type(fltk::Item::RADIO);
|
---|
2421 | o->callback((fltk::Callback*)cb_menuEditPan);
|
---|
2422 | }
|
---|
2423 |
|
---|
2424 | //{
|
---|
2425 | // fltk::Item* o = menuEditZoom = new fltk::Item("Zoom");
|
---|
2426 | // o->callback((fltk::Callback*)cb_menuEditZoom);
|
---|
2427 | //}
|
---|
2428 |
|
---|
2429 | new fltk::Divider();
|
---|
2430 |
|
---|
2431 | {
|
---|
2432 | fltk::Item* o = menuMeshInfo = new fltk::Item("Mesh info");
|
---|
2433 | o->callback((fltk::Callback*)cb_menuMeshInfo);
|
---|
2434 | }
|
---|
2435 |
|
---|
2436 | {
|
---|
2437 | fltk::Item* o;
|
---|
2438 | o = menuSelectLeaves = new fltk::Item("Select leaves");
|
---|
2439 | o->callback((fltk::Callback*)cb_menuSelectLeaves);
|
---|
2440 | }
|
---|
2441 |
|
---|
2442 | o->end();
|
---|
2443 | }
|
---|
2444 |
|
---|
2445 | // Menu Render.
|
---|
2446 | {
|
---|
2447 | fltk::ItemGroup* o = menuRender = new fltk::ItemGroup("Render");
|
---|
2448 | o->begin();
|
---|
2449 |
|
---|
2450 | {
|
---|
2451 | fltk::Item* o = menuRenderWire = new fltk::Item("Wire");
|
---|
2452 | o->type(fltk::Item::RADIO);
|
---|
2453 | o->callback((fltk::Callback*)cb_menuRenderWire);
|
---|
2454 | }
|
---|
2455 |
|
---|
2456 | {
|
---|
2457 | fltk::Item* o = menuRenderSolid = new fltk::Item("Solid");
|
---|
2458 | o->type(fltk::Item::RADIO);
|
---|
2459 | o->callback((fltk::Callback*)cb_menuRenderSolid);
|
---|
2460 | }
|
---|
2461 |
|
---|
2462 | //new fltk::Divider();
|
---|
2463 |
|
---|
2464 | {
|
---|
2465 | fltk::Item* o = menuRenderCW = new fltk::Item("CW");
|
---|
2466 | o->type(fltk::Item::RADIO);
|
---|
2467 | o->callback((fltk::Callback*)cb_menuRenderCW);
|
---|
2468 |
|
---|
2469 | o->hide();
|
---|
2470 | }
|
---|
2471 |
|
---|
2472 | {
|
---|
2473 | fltk::Item* o = menuRenderCCW = new fltk::Item("CCW");
|
---|
2474 | o->type(fltk::Item::RADIO);
|
---|
2475 | o->set_value();
|
---|
2476 | o->callback((fltk::Callback*)cb_menuRenderCCW);
|
---|
2477 |
|
---|
2478 | o->hide();
|
---|
2479 | }
|
---|
2480 |
|
---|
2481 | new fltk::Divider();
|
---|
2482 |
|
---|
2483 | {
|
---|
2484 | fltk::Item* o = menuRenderFlat = new fltk::Item("Flat");
|
---|
2485 | o->type(fltk::Item::RADIO);
|
---|
2486 | o->clear_value();
|
---|
2487 | o->callback((fltk::Callback*)cb_menuRenderFlat);
|
---|
2488 | }
|
---|
2489 |
|
---|
2490 | {
|
---|
2491 | fltk::Item* o = menuRenderSmooth = new fltk::Item("Smooth");
|
---|
2492 | o->type(fltk::Item::RADIO);
|
---|
2493 | o->set_value();
|
---|
2494 | o->callback((fltk::Callback*)cb_menuRenderSmooth);
|
---|
2495 | }
|
---|
2496 |
|
---|
2497 | //new fltk::Divider();
|
---|
2498 |
|
---|
2499 | //{
|
---|
2500 | // fltk::Item* o = menuRenderTextures = new fltk::Item("Textures");
|
---|
2501 | // o->callback((fltk::Callback*)cb_menuRenderTextures);
|
---|
2502 | //}
|
---|
2503 |
|
---|
2504 | o->end();
|
---|
2505 | }
|
---|
2506 |
|
---|
2507 | // Menu Stripify.
|
---|
2508 | {
|
---|
2509 | fltk::Item* o = menuStripify = new fltk::Item("Stripify");
|
---|
2510 | o->callback((fltk::Callback*)cb_menuStripify);
|
---|
2511 | }
|
---|
2512 |
|
---|
2513 | // Menu Simplify.
|
---|
2514 | {
|
---|
2515 | fltk::ItemGroup* o = menuSimplify = new fltk::ItemGroup("Simplify");
|
---|
2516 | o->callback((fltk::Callback*)cb_menuSimplify);
|
---|
2517 | o->begin();
|
---|
2518 |
|
---|
2519 | {
|
---|
2520 | fltk::Item* o;
|
---|
2521 | o = menuSimplifyEdgeCollapse = new fltk::Item("Mesh Simplification");
|
---|
2522 | o->callback((fltk::Callback*)cb_menuSimplifyEdgeCollapse);
|
---|
2523 | }
|
---|
2524 |
|
---|
2525 | {
|
---|
2526 | fltk::Item* o;
|
---|
2527 | o = menuSimplifyLeavesCollapse = new fltk::Item("Leaves Simplification");
|
---|
2528 | o->callback((fltk::Callback*)cb_menuSimplifyLeavesCollapse);
|
---|
2529 | }
|
---|
2530 |
|
---|
2531 | o->end();
|
---|
2532 | }
|
---|
2533 |
|
---|
2534 | // Menu LodStrips.
|
---|
2535 | {
|
---|
2536 | fltk::ItemGroup* o;
|
---|
2537 | o = menuLodStrips = new fltk::ItemGroup("LodStrips");
|
---|
2538 | o->begin();
|
---|
2539 |
|
---|
2540 | {
|
---|
2541 | fltk::Item* o;
|
---|
2542 | o = menuLodStripsGenerate = new fltk::Item("Generate");
|
---|
2543 | o->callback((fltk::Callback*)cb_menuLodStripsGenerate);
|
---|
2544 | }
|
---|
2545 |
|
---|
2546 | {
|
---|
2547 | fltk::Item* o;
|
---|
2548 | o = menuLodStripsVisualize = new fltk::Item("Visualize");
|
---|
2549 | o->callback((fltk::Callback*)cb_menuLodStripsVisualize);
|
---|
2550 | }
|
---|
2551 |
|
---|
2552 | o->end();
|
---|
2553 | }
|
---|
2554 |
|
---|
2555 | // Menu LodTrees.
|
---|
2556 |
|
---|
2557 | {
|
---|
2558 | fltk::ItemGroup* o;
|
---|
2559 | o = menuLodTrees = new fltk::ItemGroup("LodTrees");
|
---|
2560 | o->begin();
|
---|
2561 |
|
---|
2562 | {
|
---|
2563 | fltk::Item* o;
|
---|
2564 | o = menuLodTreesVisualize = new fltk::Item("Visualize Trunk");
|
---|
2565 | o->callback((fltk::Callback*)cb_menuLodTreesVisualize);
|
---|
2566 | }
|
---|
2567 |
|
---|
2568 | o->end();
|
---|
2569 | }
|
---|
2570 |
|
---|
2571 |
|
---|
2572 | {
|
---|
2573 | fltk::ItemGroup* o = new fltk::ItemGroup("?");
|
---|
2574 | o->begin();
|
---|
2575 |
|
---|
2576 | {
|
---|
2577 | fltk::Item* o = menuHelpAbout = new fltk::Item("About");
|
---|
2578 | o->callback((fltk::Callback*)cb_menuHelpAbout);
|
---|
2579 | }
|
---|
2580 |
|
---|
2581 | o->end();
|
---|
2582 | }
|
---|
2583 |
|
---|
2584 | /* {
|
---|
2585 | fltk::SharedImage *gifLogo = logo->get("media\\logos\\logo.gif");
|
---|
2586 |
|
---|
2587 | //o->callback((fltk::Callback*)cb_mLogo);
|
---|
2588 |
|
---|
2589 | mLogo = new fltk::InvisibleBox(406, 1, 43, 13);
|
---|
2590 | mLogo->image(gifLogo);
|
---|
2591 | }*/
|
---|
2592 |
|
---|
2593 | o->end();
|
---|
2594 | }
|
---|
2595 |
|
---|
2596 | {
|
---|
2597 | fltk::Group* o;
|
---|
2598 | o = ApplicationBar = new fltk::Group(0, 570, 807, 28);
|
---|
2599 | o->box(fltk::BORDER_BOX);
|
---|
2600 | o->begin();
|
---|
2601 |
|
---|
2602 | {
|
---|
2603 | fltk::Widget* o;
|
---|
2604 | o = mFPS = new fltk::Widget(10, 4, 30, 15, "FPS ");
|
---|
2605 | o->box(fltk::NO_BOX);
|
---|
2606 | o->labelfont(fltk::HELVETICA_BOLD);
|
---|
2607 | o->color((fltk::Color)0xe0dfe300);
|
---|
2608 | }
|
---|
2609 |
|
---|
2610 | {
|
---|
2611 | fltk::Widget* o;
|
---|
2612 | o = mVertices = new fltk::Widget(154, 4, 40, 15, "Vertices");
|
---|
2613 | o->box(fltk::NO_BOX);
|
---|
2614 | o->labelfont(fltk::HELVETICA_BOLD);
|
---|
2615 | o->color((fltk::Color)0xe0dfe300);
|
---|
2616 | }
|
---|
2617 |
|
---|
2618 | {
|
---|
2619 | fltk::Widget* o;
|
---|
2620 | o = mTriangles = new fltk::Widget(254, 3, 40, 15, "Triangles");
|
---|
2621 | o->box(fltk::NO_BOX);
|
---|
2622 | o->labelfont(fltk::HELVETICA_BOLD);
|
---|
2623 | o->color((fltk::Color)0xe0dfe300);
|
---|
2624 |
|
---|
2625 | // Hide triangle count.
|
---|
2626 | o->hide();
|
---|
2627 | }
|
---|
2628 |
|
---|
2629 | {
|
---|
2630 | fltk::Widget* o;
|
---|
2631 | o = mStrips = new fltk::Widget(354, 3, 30, 15, "Strips");
|
---|
2632 | o->box(fltk::NO_BOX);
|
---|
2633 | o->labelfont(fltk::HELVETICA_BOLD);
|
---|
2634 | o->color((fltk::Color)0xe0dfe300);
|
---|
2635 | }
|
---|
2636 |
|
---|
2637 | //{
|
---|
2638 | // fltk::Widget* o;
|
---|
2639 | // o = mQuads = new fltk::Widget(454, 4, 40, 15, "Quads");
|
---|
2640 | // o->box(fltk::NO_BOX);
|
---|
2641 | // o->labelfont(fltk::HELVETICA_BOLD);
|
---|
2642 | // o->color((fltk::Color)0xe0dfe300);
|
---|
2643 | //}
|
---|
2644 |
|
---|
2645 | {
|
---|
2646 | fltk::Widget* o;
|
---|
2647 | o = mMB = new fltk::Widget(740, 3, 30, 15, "MB");
|
---|
2648 | o->box(fltk::NO_BOX);
|
---|
2649 | o->labelfont(fltk::HELVETICA_BOLD);
|
---|
2650 | o->color((fltk::Color)0xe0dfe300);
|
---|
2651 | }
|
---|
2652 | o->end();
|
---|
2653 | }
|
---|
2654 |
|
---|
2655 |
|
---|
2656 | o->end();
|
---|
2657 | }
|
---|
2658 |
|
---|
2659 | fltk::focus(geoMeshView);
|
---|
2660 |
|
---|
2661 |
|
---|
2662 | /*Hide Right Panel*/
|
---|
2663 | hideRightPanel();
|
---|
2664 |
|
---|
2665 | mMainWindow->show();
|
---|
2666 | }
|
---|
2667 |
|
---|
2668 | /****************/
|
---|
2669 | /* Destroyer */
|
---|
2670 | /****************/
|
---|
2671 | GeoMeshViewUI::~GeoMeshViewUI()
|
---|
2672 | {
|
---|
2673 | delete geoMeshLoader;
|
---|
2674 | mMainWindow->destroy();
|
---|
2675 | }
|
---|
2676 |
|
---|
2677 | // Shows the main window.
|
---|
2678 | void GeoMeshViewUI::show()
|
---|
2679 | {
|
---|
2680 | }
|
---|
2681 |
|
---|