EditorWhiteBoxComponentModeBus.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 <AzToolsFramework/Viewport/ViewportTypes.h>
  11. #include <QPointer>
  12. class QWidget;
  13. namespace WhiteBox
  14. {
  15. //! Enum for the current sub-mode of the White Box ComponentMode.
  16. enum class SubMode
  17. {
  18. Default,
  19. EdgeRestore,
  20. Transform
  21. };
  22. using KeyboardModifierQueryFn = AZStd::function<AzToolsFramework::ViewportInteraction::KeyboardModifiers()>;
  23. //! Request bus for generic White Box ComponentMode operations (irrespective of the sub-mode).
  24. class EditorWhiteBoxComponentModeRequests : public AZ::EntityComponentBus
  25. {
  26. public:
  27. //! Signal that the white box has changed and the intersection data needs to be rebuilt.
  28. virtual void MarkWhiteBoxIntersectionDataDirty() = 0;
  29. //! Get the current sub-mode that White Box is in (Default Mode or Edge Restore mode).
  30. virtual SubMode GetCurrentSubMode() const = 0;
  31. //! Provides the ability to customize how keyboard modifier keys are queried.
  32. //! @note This could be overridden to return nothing or a fixed modifier value.
  33. virtual void OverrideKeyboardModifierQuery(const KeyboardModifierQueryFn& keyboardModifierQueryFn) = 0;
  34. protected:
  35. ~EditorWhiteBoxComponentModeRequests() = default;
  36. };
  37. using EditorWhiteBoxComponentModeRequestBus = AZ::EBus<EditorWhiteBoxComponentModeRequests>;
  38. } // namespace WhiteBox