3
0

EditorWhiteBoxDefaultModeBus.h 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <AzCore/Component/ComponentBus.h>
  10. #include <WhiteBox/WhiteBoxToolApi.h>
  11. namespace WhiteBox
  12. {
  13. //! Request bus for White Box ComponentMode operations while in 'default' mode.
  14. class EditorWhiteBoxDefaultModeRequests : public AZ::EntityComponentBus
  15. {
  16. public:
  17. //! Create a polygon scale modifier for the given polygon handles.
  18. virtual void CreatePolygonScaleModifier(const Api::PolygonHandle& polygonHandle) = 0;
  19. //! Create an edge scale modifier for the given edge handle.
  20. virtual void CreateEdgeScaleModifier(Api::EdgeHandle edgeHandle) = 0;
  21. //! Assign whatever polygon is currently hovered to the selected polygon translation modifier.
  22. virtual void AssignSelectedPolygonTranslationModifier() = 0;
  23. //! Assign whatever edge is currently hovered to the selected edge translation modifier.
  24. virtual void AssignSelectedEdgeTranslationModifier() = 0;
  25. //! Assign whatever vertex is currently hovered to the vertex selection modifier.
  26. virtual void AssignSelectedVertexSelectionModifier() = 0;
  27. //! Refresh (rebuild) the polygon scale modifier.
  28. //! The internal manipulator will be rebuilt from the current white box handles stored in the modifier.
  29. virtual void RefreshPolygonScaleModifier() = 0;
  30. //! Refresh (rebuild) the edge scale modifier.
  31. //! The internal manipulator will be rebuilt from the current white box handles stored in the modifier.
  32. virtual void RefreshEdgeScaleModifier() = 0;
  33. //! Refresh (rebuild) the polygon translation modifier.
  34. //! The internal manipulator will be rebuilt from the current white box handles stored in the modifier.
  35. virtual void RefreshPolygonTranslationModifier() = 0;
  36. //! Refresh (rebuild) the edge translation modifier.
  37. //! The internal manipulator will be rebuilt from the current white box handles stored in the modifier.
  38. virtual void RefreshEdgeTranslationModifier() = 0;
  39. //! Refresh (rebuild) the vertex selection modifier.
  40. //! The internal manipulator will be rebuilt from the current white box handles stored in the modifier.
  41. virtual void RefreshVertexSelectionModifier() = 0;
  42. //! Returns the currently selected vertex handles.
  43. //! @note If no vertex handles are selected an empty vector is returned.
  44. virtual Api::VertexHandles SelectedVertexHandles() const = 0;
  45. //! Returns the currently selected edge handles.
  46. //! @note If no edge handles are selected an empty vector is returned.
  47. virtual Api::EdgeHandles SelectedEdgeHandles() const = 0;
  48. //! Returns the currently selected polygon handles.
  49. //! @note If no polygon handles are selected an empty vector is returned.
  50. virtual Api::PolygonHandles SelectedPolygonHandles() const = 0;
  51. //! Returns the hovered vertex handle.
  52. //! @note If no vertex is currently being hovered then an invalid VertexHandle is returned.
  53. virtual Api::VertexHandle HoveredVertexHandle() const = 0;
  54. //! Returns the hovered edge handle.
  55. //! @note If no edge is currently being hovered then an invalid EdgeHandle is returned.
  56. virtual Api::EdgeHandle HoveredEdgeHandle() const = 0;
  57. //! Returns the hovered polygon handle.
  58. //! @note If no polygon is currently being hovered then an empty PolygonHandle is returned.
  59. virtual Api::PolygonHandle HoveredPolygonHandle() const = 0;
  60. //! Hide the selected Edge.
  61. virtual void HideSelectedEdge() = 0;
  62. //! Hide the selected Vertex.
  63. virtual void HideSelectedVertex() = 0;
  64. protected:
  65. ~EditorWhiteBoxDefaultModeRequests() = default;
  66. };
  67. using EditorWhiteBoxDefaultModeRequestBus = AZ::EBus<EditorWhiteBoxDefaultModeRequests>;
  68. } // namespace WhiteBox