CheckAssetPage.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. #if !defined(Q_MOC_RUN)
  10. #include <AzCore/Asset/AssetCommon.h>
  11. #include <AzCore/Math/Crc.h>
  12. #include <AzCore/std/containers/map.h>
  13. #include <AzCore/std/containers/vector.h>
  14. #include <AzCore/std/smart_ptr/shared_ptr.h>
  15. #include <AzCore/std/string/string.h>
  16. #include <QLabel>
  17. #include <QString>
  18. #include <QTableWidget>
  19. #include <QTableWidgetItem>
  20. #include <QTimer>
  21. #include <QVector>
  22. #include <QWizardPage>
  23. #include <RobotImporter/Utils/SourceAssetsStorage.h>
  24. #endif
  25. namespace ROS2RobotImporter
  26. {
  27. class CheckAssetPage : public QWizardPage
  28. {
  29. Q_OBJECT
  30. public:
  31. explicit CheckAssetPage(QWizard* parent);
  32. //! Function reports assets that will be copied/processed by asset processor.
  33. void ReportAsset(const AZStd::string unresolvedFileName, const Utils::UrdfAsset& urdfAsset, const QString& type);
  34. void ClearAssetsList();
  35. bool IsEmpty() const;
  36. bool isComplete() const override;
  37. void OnAssetCopyStatusChanged(
  38. const Utils::CopyStatus& status, const AZStd::string& unresolvedFileName, const AZStd::string assetPath);
  39. void OnAssetProcessStatusChanged(const AZStd::string& unresolvedFileName, const Utils::UrdfAsset& urdfAsset, bool isError);
  40. private:
  41. bool m_success;
  42. QTableWidget* m_table{};
  43. QTableWidgetItem* createCell(bool isOk, const QString& text);
  44. unsigned int m_missingCount{ 0 };
  45. unsigned int m_failedCount{ 0 };
  46. void SetTitle();
  47. AZStd::unordered_map<AZStd::string, int> m_assetsToColumnIndex; //!< Map of unresolved asset to column index in the table.
  48. AZStd::unordered_map<AZ::Uuid, AZStd::string> m_assetsPaths; //! Map of asset UUIDs to asset source paths.
  49. AZStd::shared_ptr<Utils::UrdfAssetMap> m_urdfAssetMap;
  50. void DoubleClickRow(int row, int col);
  51. QIcon m_failureIcon;
  52. QIcon m_okIcon;
  53. QIcon m_processingIcon;
  54. int GetRowIndex(const AZStd::string& unresolvedFileName);
  55. };
  56. } // namespace ROS2RobotImporter