ConnectionLayerControllerComponent.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 <Source/Components/LayerControllerComponent.h>
  10. #include <GraphCanvas/Components/Connections/ConnectionBus.h>
  11. namespace GraphCanvas
  12. {
  13. class ConnectionLayerControllerComponent
  14. : public LayerControllerComponent
  15. , public ConnectionNotificationBus::Handler
  16. , public LayerControllerNotificationBus::MultiHandler
  17. {
  18. public:
  19. static void Reflect(AZ::ReflectContext* context);
  20. AZ_COMPONENT(ConnectionLayerControllerComponent, "{9D71AFFE-539A-467B-8012-470100E0DA98}", LayerControllerComponent);
  21. ConnectionLayerControllerComponent();
  22. void Activate() override;
  23. // SceneMemberNotificationBus
  24. void OnSceneSet(const AZ::EntityId& sceneId) override;
  25. ////
  26. // ConnecitonNotificationBus
  27. void OnMoveBegin() override;
  28. void OnMoveFinalized(bool isValidConnection) override;
  29. void OnSourceSlotIdChanged(const AZ::EntityId&, const AZ::EntityId&) override;
  30. void OnTargetSlotIdChanged(const AZ::EntityId&, const AZ::EntityId&) override;
  31. ////
  32. // LayerControllerNotificationBus
  33. void OnOffsetsChanged(int selectionOffset, int groupOffset) override;
  34. ////
  35. private:
  36. void UpdateEndpoints();
  37. LayerControllerRequests* m_sourceLayerController;
  38. LayerControllerRequests* m_targetLayerController;
  39. };
  40. }