You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
3.4 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2016 Mario Luzeiro <mrluzeiro@ua.pt>
  5. * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
  6. * Copyright (C) 2013 Wayne Stambaugh <stambaughw@gmail.com>
  7. * Copyright (C) 2023 CERN
  8. * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License
  12. * as published by the Free Software Foundation; either version 2
  13. * of the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, you may find one here:
  22. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  23. * or you may search the http://www.gnu.org website for the version 2 license,
  24. * or you may write to the Free Software Foundation, Inc.,
  25. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  26. */
  27. #include <wx/wupdlock.h>
  28. #include <wx/choice.h>
  29. #include <bitmaps.h>
  30. #include <dialogs/eda_view_switcher.h>
  31. #include <eda_3d_viewer_frame.h>
  32. #include <tool/action_toolbar.h>
  33. #include <tools/eda_3d_actions.h>
  34. #include <3d_viewer_id.h>
  35. #include <toolbars_3d.h>
  36. std::optional<TOOLBAR_CONFIGURATION> EDA_3D_VIEWER_TOOLBAR_SETTINGS::DefaultToolbarConfig( TOOLBAR_LOC aToolbar )
  37. {
  38. TOOLBAR_CONFIGURATION config;
  39. // clang-format off
  40. switch( aToolbar )
  41. {
  42. case TOOLBAR_LOC::LEFT:
  43. case TOOLBAR_LOC::RIGHT:
  44. case TOOLBAR_LOC::TOP_AUX:
  45. return std::nullopt;
  46. case TOOLBAR_LOC::TOP_MAIN:
  47. config.AppendAction( EDA_3D_ACTIONS::reloadBoard );
  48. config.AppendSeparator()
  49. .AppendAction( EDA_3D_ACTIONS::copyToClipboard );
  50. config.AppendSeparator()
  51. .AppendAction( EDA_3D_ACTIONS::toggleRaytacing );
  52. config.AppendSeparator()
  53. .AppendAction( ACTIONS::zoomRedraw )
  54. .AppendAction( ACTIONS::zoomInCenter )
  55. .AppendAction( ACTIONS::zoomOutCenter )
  56. .AppendAction( ACTIONS::zoomFitScreen );
  57. config.AppendSeparator()
  58. .AppendAction( EDA_3D_ACTIONS::rotateXCW )
  59. .AppendAction( EDA_3D_ACTIONS::rotateXCCW );
  60. config.AppendSeparator()
  61. .AppendAction( EDA_3D_ACTIONS::rotateYCW )
  62. .AppendAction( EDA_3D_ACTIONS::rotateYCCW );
  63. config.AppendSeparator()
  64. .AppendAction( EDA_3D_ACTIONS::rotateZCW )
  65. .AppendAction( EDA_3D_ACTIONS::rotateZCCW );
  66. config.AppendSeparator()
  67. .AppendAction( EDA_3D_ACTIONS::flipView );
  68. config.AppendSeparator()
  69. .AppendAction( EDA_3D_ACTIONS::moveLeft )
  70. .AppendAction( EDA_3D_ACTIONS::moveRight )
  71. .AppendAction( EDA_3D_ACTIONS::moveUp )
  72. .AppendAction( EDA_3D_ACTIONS::moveDown );
  73. config.AppendSeparator()
  74. .AppendAction( EDA_3D_ACTIONS::toggleOrtho );
  75. config.AppendSeparator()
  76. .AppendAction( EDA_3D_ACTIONS::showLayersManager );
  77. break;
  78. }
  79. // clang-format on
  80. return config;
  81. }