3
0

DepthOfFieldComponentController.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 <AzCore/Component/TransformBus.h>
  11. #include <AtomLyIntegration/CommonFeatures/PostProcess/DepthOfField/DepthOfFieldBus.h>
  12. #include <AtomLyIntegration/CommonFeatures/PostProcess/DepthOfField/DepthOfFieldComponentConfig.h>
  13. #include <Atom/Feature/PostProcess/DepthOfField/DepthOfFieldSettingsInterface.h>
  14. #include <Atom/Feature/PostProcess/PostProcessSettingsInterface.h>
  15. #include <Atom/Feature/PostProcess/PostProcessFeatureProcessorInterface.h>
  16. namespace AZ
  17. {
  18. namespace Render
  19. {
  20. class DepthOfFieldComponentController final
  21. : public DepthOfFieldRequestBus::Handler
  22. {
  23. public:
  24. friend class EditorDepthOfFieldComponent;
  25. AZ_TYPE_INFO(AZ::Render::DepthOfFieldComponentController, "{D0E1675C-7E6F-472D-B037-E0D7ED5AFBE8}");
  26. static void Reflect(AZ::ReflectContext* context);
  27. static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
  28. static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
  29. static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
  30. DepthOfFieldComponentController() = default;
  31. DepthOfFieldComponentController(const DepthOfFieldComponentConfig& config);
  32. void Activate(EntityId entityId);
  33. void Deactivate();
  34. void SetConfiguration(const DepthOfFieldComponentConfig& config);
  35. const DepthOfFieldComponentConfig& GetConfiguration() const;
  36. // Updates members that are inferred from the values of other parameters
  37. void UpdateInferredParams();
  38. // Auto-gen function override declarations (functions definitions in .cpp)...
  39. #include <Atom/Feature/ParamMacros/StartParamFunctionsOverride.inl>
  40. #include <Atom/Feature/PostProcess/DepthOfField/DepthOfFieldParams.inl>
  41. #include <Atom/Feature/ParamMacros/EndParams.inl>
  42. private:
  43. AZ_DISABLE_COPY(DepthOfFieldComponentController);
  44. void OnConfigChanged();
  45. PostProcessSettingsInterface* m_postProcessInterface = nullptr;
  46. DepthOfFieldSettingsInterface* m_depthOfFieldSettingsInterface = nullptr;
  47. DepthOfFieldComponentConfig m_configuration;
  48. EntityId m_entityId;
  49. };
  50. }
  51. }