ModelsAndAnimationsDb.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright (C) 2022 The V-Gears Team
  3. *
  4. * This file is part of V-Gears
  5. *
  6. * V-Gears is free software: you can redistribute it and/or modify it under
  7. * terms of the GNU General Public License as published by the Free Software
  8. * Foundation, version 3.0 (GPLv3) of the License.
  9. *
  10. * V-Gears is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #pragma once
  16. #include "common/VGearsStringUtil.h"
  17. typedef std::map<std::string, std::set<std::string>> ModelAnimationMap;
  18. /**
  19. * Database of model animations.
  20. */
  21. class ModelsAndAnimationsDb{
  22. public:
  23. /**
  24. * Normalizes an animation name.
  25. *
  26. * Generates a normalized file name, without path, lowercase, and an
  27. * '.a' extension.
  28. *
  29. * @param[in] name Current name.
  30. * @return The normalized name.
  31. */
  32. std::string NormalizeAnimationName(const std::string& name);
  33. /**
  34. * @todo Understand and document.
  35. *
  36. * @param[in] model @todo Understand and document.
  37. * @return @todo Understand and document.
  38. */
  39. std::set<std::string>& ModelAnimations(const std::string model);
  40. /**
  41. * Retrieves the metadata file name associated to a model.
  42. *
  43. * @param[in] model_name The model name.
  44. * @return Name of the metadata file.
  45. */
  46. std::string ModelMetaDataName(const std::string& model_name);
  47. /**
  48. * Map of models and animations.
  49. */
  50. ModelAnimationMap map;
  51. };