WhiteBoxSystemComponent.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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/Component.h>
  10. #include <WhiteBox/WhiteBoxBus.h>
  11. namespace AZ::Data
  12. {
  13. class AssetHandler;
  14. }
  15. namespace WhiteBox
  16. {
  17. class RenderMeshInterface;
  18. //! System component for the White Box Tool.
  19. class WhiteBoxSystemComponent
  20. : public AZ::Component
  21. , private WhiteBoxRequestBus::Handler
  22. {
  23. public:
  24. AZ_COMPONENT(WhiteBoxSystemComponent, "{BD393FD9-CF47-433D-B171-C44FE2F7069F}");
  25. static void Reflect(AZ::ReflectContext* context);
  26. WhiteBoxSystemComponent();
  27. WhiteBoxSystemComponent(const WhiteBoxSystemComponent&) = delete;
  28. WhiteBoxSystemComponent& operator=(const WhiteBoxSystemComponent&) = delete;
  29. ~WhiteBoxSystemComponent();
  30. static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
  31. static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
  32. static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
  33. static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent);
  34. // WhiteBoxRequestBus ...
  35. AZStd::unique_ptr<RenderMeshInterface> CreateRenderMeshInterface(AZ::EntityId entityId) override;
  36. void SetRenderMeshInterfaceBuilder(RenderMeshInterfaceBuilderFn builder) override;
  37. protected:
  38. // AZ::Component ...
  39. void Activate() override;
  40. void Deactivate() override;
  41. AZStd::vector<AZStd::unique_ptr<AZ::Data::AssetHandler>> m_assetHandlers;
  42. private:
  43. //! The builder invoked by CreateRenderMeshInterface.
  44. RenderMeshInterfaceBuilderFn m_renderMeshInterfaceBuilder;
  45. };
  46. } // namespace WhiteBox