TexturePropertyEditor.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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/PlatformDef.h>
  11. // warning C4251: 'QBrush::d': class 'QScopedPointer<QBrushData,QBrushDataPointerDeleter>' needs to have dll-interface to be used by clients of class 'QBrush'
  12. // warning C4800: 'uint': forcing value to bool 'true' or 'false' (performance warning)
  13. AZ_PUSH_DISABLE_WARNING(4800 4251, "-Wunknown-warning-option")
  14. #include <QDialog>
  15. AZ_POP_DISABLE_WARNING
  16. #include <AzCore/Memory/SystemAllocator.h>
  17. #include <AzQtComponents/Components/StyledDialog.h>
  18. #include <AzToolsFramework/SourceControl/SourceControlAPI.h>
  19. #include <Source/Editor/EditorCommon.h>
  20. #include <Source/Editor/TexturePresetSelectionWidget.h>
  21. #include <Source/Editor/TexturePreviewWidget.h>
  22. #include <Source/Editor/ResolutionSettingWidget.h>
  23. #include <Source/Editor/MipmapSettingWidget.h>
  24. #endif
  25. namespace Ui
  26. {
  27. class TexturePropertyEditor;
  28. }
  29. namespace ImageProcessingAtomEditor
  30. {
  31. class TexturePropertyEditor
  32. : public AzQtComponents::StyledDialog
  33. , protected EditorInternalNotificationBus::Handler
  34. {
  35. Q_OBJECT
  36. public:
  37. AZ_CLASS_ALLOCATOR(TexturePropertyEditor, AZ::SystemAllocator);
  38. explicit TexturePropertyEditor(const AZ::Uuid& sourceTextureId, QWidget* parent = nullptr);
  39. ~TexturePropertyEditor();
  40. bool HasValidImage();
  41. protected:
  42. void OnHelp();
  43. void OnSave();
  44. ////////////////////////////////////////////////////////////////////////
  45. //EditorInternalNotificationBus
  46. void OnEditorSettingsChanged(bool needRefresh, const AZStd::string& platform) override;
  47. ////////////////////////////////////////////////////////////////////////
  48. bool event(QEvent* event) override;
  49. private:
  50. QScopedPointer<Ui::TexturePropertyEditor> m_ui;
  51. QScopedPointer<TexturePreviewWidget> m_previewWidget;
  52. QScopedPointer<TexturePresetSelectionWidget> m_presetSelectionWidget;
  53. QScopedPointer<ResolutionSettingWidget> m_resolutionSettingWidget;
  54. QScopedPointer<MipmapSettingWidget> m_mipmapSettingWidget;
  55. EditorTextureSetting m_textureSetting;
  56. bool m_validImage = true;
  57. void SaveTextureSetting(AZStd::string outputPath);
  58. void DeleteLegacySetting();
  59. };
  60. } //namespace ImageProcessingAtomEditor