Menubar.File.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. Menubar.File = function ( signals ) {
  2. var container = new UI.Panel();
  3. container.setClass( 'menu' );
  4. var title = new UI.Panel();
  5. title.setTextContent( 'File' ).setColor( '#666' );
  6. title.setMargin( '0px' );
  7. title.setPadding( '8px' );
  8. container.add( title );
  9. //
  10. var options = new UI.Panel();
  11. options.setClass( 'options' );
  12. container.add( options );
  13. /*
  14. // open
  15. var option = new UI.Panel();
  16. option.setClass( 'option' );
  17. option.setTextContent( 'Open' );
  18. option.onClick( function () { alert( 'Open' ) } );
  19. options.add( option );
  20. */
  21. // reset scene
  22. var option = new UI.Panel();
  23. option.setClass( 'option' );
  24. option.setTextContent( 'Reset' );
  25. option.onClick( function () { signals.resetScene.dispatch(); } );
  26. options.add( option );
  27. // export geometry
  28. var option = new UI.Panel();
  29. option.setClass( 'option' );
  30. option.setTextContent( 'Export Geometry' );
  31. option.onClick( function () { signals.exportGeometry.dispatch( { exporter: THREE.GeometryExporter } ); } );
  32. options.add( option );
  33. // export scene
  34. var option = new UI.Panel();
  35. option.setClass( 'option' );
  36. option.setTextContent( 'Export Scene' );
  37. option.onClick( function () { signals.exportScene.dispatch( { exporter: THREE.SceneExporter } ); } );
  38. options.add( option );
  39. // export scene 2
  40. var option = new UI.Panel();
  41. option.setClass( 'option' );
  42. option.setTextContent( 'Export Scene 2' );
  43. option.onClick( function () { signals.exportScene.dispatch( { exporter: THREE.SceneExporter2 } ); } );
  44. options.add( option );
  45. // export OBJ
  46. var option = new UI.Panel();
  47. option.setClass( 'option' );
  48. option.setTextContent( 'Export OBJ' );
  49. option.onClick( function () { signals.exportGeometry.dispatch( { exporter: THREE.OBJExporter } ); } );
  50. options.add( option );
  51. //
  52. return container;
  53. }