LoggingGroup.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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/std/string/string.h>
  10. #include <AzCore/Memory/Memory.h>
  11. #include <AzCore/Memory/SystemAllocator.h>
  12. #include <SceneAPI/SceneCore/DataTypes/Groups/IGroup.h>
  13. namespace AZ
  14. {
  15. class ReflectContext;
  16. }
  17. namespace SceneLoggingExample
  18. {
  19. // The LoggingGroup class contains the settings that will be interpreted by the exporter.
  20. // Groups typically contain settings and information only. They rarely implement any advanced logic.
  21. //
  22. // Groups tend to have a one-to-one relationship to the target format. For example, every mesh group
  23. // will produce a .cgf file in the cache. Groups also aim to be the most basic form of the required data,
  24. // providing the minimum information that is needed to create a valid product in the cache.
  25. //
  26. // To further fine tune the group, you can add rules (also called modifiers). For example, you can add a rule to
  27. // control the world matrix.
  28. class LoggingGroup : public AZ::SceneAPI::DataTypes::IGroup
  29. {
  30. public:
  31. LoggingGroup();
  32. ~LoggingGroup() override = default;
  33. AZ_RTTI(LoggingGroup, "{A5ECF95D-2E84-4574-BF93-09E469E2BA4E}", AZ::SceneAPI::DataTypes::IGroup);
  34. AZ_CLASS_ALLOCATOR(LoggingGroup, AZ::SystemAllocator);
  35. static void Reflect(AZ::ReflectContext* context);
  36. void SetName(const AZStd::string& name);
  37. void SetName(AZStd::string&& name);
  38. const AZStd::string& GetName() const override;
  39. const AZ::Uuid& GetId() const override;
  40. AZ::SceneAPI::Containers::RuleContainer& GetRuleContainer() override;
  41. const AZ::SceneAPI::Containers::RuleContainer& GetRuleContainerConst() const override;
  42. const AZStd::string& GetGraphLogRoot() const;
  43. bool DoesLogGraph() const;
  44. bool DoesLogProcessingEvents() const;
  45. void ShouldLogProcessingEvents(bool state);
  46. protected:
  47. AZ::SceneAPI::Containers::RuleContainer m_ruleContainer;
  48. AZStd::string m_groupName;
  49. AZStd::string m_graphLogRoot;
  50. AZ::Uuid m_id;
  51. bool m_logProcessingEvents;
  52. static const char* s_disabledOption;
  53. };
  54. } // namespace SceneLoggingExample