2
0

GraphMetaInfoHandler.cpp 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. #include <AzCore/Memory/SystemAllocator.h>
  9. #include <SceneAPI/SceneUI/GraphMetaInfoHandler.h>
  10. #include <SceneAPI/SceneCore/DataTypes/GraphData/IMeshData.h>
  11. #include <SceneAPI/SceneCore/DataTypes/GraphData/IBoneData.h>
  12. #include <SceneAPI/SceneCore/DataTypes/GraphData/ITransform.h>
  13. namespace AZ
  14. {
  15. namespace SceneAPI
  16. {
  17. namespace UI
  18. {
  19. AZ_CLASS_ALLOCATOR_IMPL(GraphMetaInfoHandler, SystemAllocator);
  20. GraphMetaInfoHandler::GraphMetaInfoHandler()
  21. {
  22. BusConnect();
  23. }
  24. GraphMetaInfoHandler::~GraphMetaInfoHandler()
  25. {
  26. BusDisconnect();
  27. }
  28. void GraphMetaInfoHandler::GetIconPath(AZStd::string& iconPath, const DataTypes::IGraphObject* target)
  29. {
  30. if (target->RTTI_IsTypeOf(DataTypes::IMeshData::TYPEINFO_Uuid()))
  31. {
  32. iconPath = ":/SceneUI/Graph/MeshIcon.png";
  33. }
  34. else if (target->RTTI_IsTypeOf(DataTypes::IBoneData::TYPEINFO_Uuid()))
  35. {
  36. iconPath = ":/SceneUI/Graph/BoneIcon.png";
  37. }
  38. }
  39. void GraphMetaInfoHandler::GetToolTip(AZStd::string& toolTip, const DataTypes::IGraphObject* target)
  40. {
  41. if (target->RTTI_IsTypeOf(DataTypes::ITransform::TYPEINFO_Uuid()))
  42. {
  43. toolTip = "Transform information changes the translation, rotation and/or scale. Multiple transform will be added together.";
  44. }
  45. else if (target->RTTI_IsTypeOf(DataTypes::IMeshData::TYPEINFO_Uuid()))
  46. {
  47. toolTip = "MeshData contains the vertex information to create the mesh for the 3D model.";
  48. }
  49. else if (target->RTTI_IsTypeOf(DataTypes::IBoneData::TYPEINFO_Uuid()))
  50. {
  51. toolTip = "Bones make up an animation skeleton. Usually bones are hierarchically chained together and the root bone will be available for selection.";
  52. }
  53. }
  54. } // SceneData
  55. } // SceneAPI
  56. } // AZ