Menubar.File.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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(); } );
  38. options.add( option );
  39. // export OBJ
  40. var option = new UI.Panel();
  41. option.setClass( 'option' );
  42. option.setTextContent( 'Export OBJ' );
  43. option.onClick( function () { signals.exportGeometry.dispatch( { exporter: THREE.OBJExporter } ); } );
  44. options.add( option );
  45. //
  46. return container;
  47. }