LODSceneGraphWidget.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 <AzSceneDef.h>
  10. #include <SceneAPI/SceneUI/SceneWidgets/SceneGraphWidget.h>
  11. #include <SceneAPIExt/Data/LodNodeSelectionList.h>
  12. namespace EMotionFX
  13. {
  14. namespace Pipeline
  15. {
  16. namespace UI
  17. {
  18. // LODSceneGraphWidget extends the functionality of SceneGraphWidget by providing the ability to hide item that are uncheckable.
  19. // It also override the filtering method so that any nodes that not belongs to a certain LOD level will be filtered out.
  20. // Note: In a case that a node belongs to this LOD but parent node aren't, the node will create an orphan UI node in the tree structure.
  21. class LODSceneGraphWidget
  22. : public SceneUI::SceneGraphWidget
  23. {
  24. public:
  25. AZ_CLASS_ALLOCATOR_DECL
  26. LODSceneGraphWidget(const SceneContainers::Scene& scene, const SceneDataTypes::ISceneNodeSelectionList& targetList,
  27. QWidget* parent = nullptr);
  28. // Option to hide the uncheckable item in the tree view.
  29. void HideUncheckableItem(bool hide);
  30. // Note: Some refactor is needed in the base UI function to avoid lot of code duplication. Since we are not allowed to add behaviors that tied to LOD needs
  31. // in the base UI, this is the best intermediate solution.
  32. void Build() override;
  33. private:
  34. bool m_hideUncheckableItem;
  35. Data::LodNodeSelectionList m_lodSelectionList;
  36. };
  37. }
  38. }
  39. }