PredefinedAspectRatios.h 1006 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. #ifndef CRYINCLUDE_EDITOR_UTIL_PREDEFINEDASPECTRATIOS_H
  9. #define CRYINCLUDE_EDITOR_UTIL_PREDEFINEDASPECTRATIOS_H
  10. #pragma once
  11. #include <vector>
  12. class CPredefinedAspectRatios
  13. {
  14. public:
  15. CPredefinedAspectRatios();
  16. virtual ~CPredefinedAspectRatios();
  17. void AddAspectRatio(float x, int y);
  18. void AddAspectRatio(int x, int y);
  19. float GetCurrentValue() const;
  20. bool IsEmpty() const;
  21. size_t GetCount() const;
  22. const QString& GetName(size_t aspectRatioId) const;
  23. float GetValue(size_t aspectRatioId) const;
  24. bool IsCurrent(size_t aspectRatioId) const;
  25. private:
  26. struct SAspectRatio
  27. {
  28. QString name;
  29. float value;
  30. };
  31. std::vector< SAspectRatio > m_aspectRatios;
  32. };
  33. #endif // CRYINCLUDE_EDITOR_UTIL_PREDEFINEDASPECTRATIOS_H