ModelModule.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * author: Patrick-Christopher Mattulat
  3. * dev-tools: JetBrains CLion
  4. * created: 29.08.2018
  5. * last updated: 12.09.2018
  6. */
  7. #ifndef MODULEMODEL_H
  8. #define MODULEMODEL_H
  9. #include <LynarMathStructs.h>
  10. #include "../../Interface/IdentifiedObject.h"
  11. #include "../../Zindex/ZindexInfo.h"
  12. #include "../../Renderer/ModelRendererInfo.h"
  13. #include "../../Transformation/Direction.h"
  14. class ModelModule : IdentifiedObject
  15. {
  16. private:
  17. SmartList<Direction> directionList;
  18. std::atomic<uint32_t> id;
  19. std::atomic<uint8_t> module;
  20. std::shared_ptr<SDL_Renderer> renderer;
  21. ModelRendererInfo rendererInfo;
  22. std::atomic<double> sizeFactor;
  23. SmartList<Texture> textureList;
  24. std::atomic<uint32_t> texturePartialAreaFocus;
  25. ZindexInfo zindexInfo;
  26. int buildTexture();
  27. int combineSurfaces(uint32_t);
  28. int updateMainTexture();
  29. public:
  30. explicit ModelModule(uint32_t, std::shared_ptr<SDL_Renderer>& renderer);
  31. ~ModelModule();
  32. int addClone(uint32_t);
  33. int addDirection(uint32_t, LynarMath::_Vec2_d);
  34. int addTexture(uint32_t, const std::string&);
  35. int addTexture(uint32_t, SDL_Surface*);
  36. int addTexturePartialArea(uint32_t, uint32_t, LynarMath::_Rectangle_d);
  37. int changeDirection(uint32_t, LynarMath::_Vec2_d);
  38. int changeTexturePartialArea(uint32_t, uint32_t, LynarMath::_Rectangle_d);
  39. void clearDirections();
  40. void clearTextures();
  41. int colorOperation(uint32_t, sColorValue_d, uint8_t);
  42. int focusTexturePartialArea(uint32_t, uint32_t);
  43. uint32_t getAmountOfClones();
  44. uint32_t getAmountOfDirections();
  45. uint32_t getAmountOfTexturePartialAreas(uint32_t);
  46. uint32_t getAmountOfTextures();
  47. double getAngle();
  48. ModelCloneRendererInfo getCloneRendererInfo(uint32_t);
  49. ModelCloneRendererInfo getCloneRendererInfoAtIndex(uint32_t);
  50. LynarMath::_Vec2_d getDirection(uint32_t);
  51. uint32_t getId() override;
  52. uint8_t getModule();
  53. LynarMath::_Point_d getPosition();
  54. ModelRendererInfo getRendererInfo();
  55. LynarMath::_Point_d getSize();
  56. double getSizeFactor();
  57. LynarMath::_Rectangle_d getTexturePartialArea(uint32_t, uint32_t);
  58. uint32_t getTexturePartialAreaFocus();
  59. LynarMath::_Point_d getTexturePosition(uint32_t);
  60. uint32_t getTextureZindex(uint32_t);
  61. ZindexInfo getZindex();
  62. bool isTextureVisible(uint32_t);
  63. bool isVisible();
  64. int makeTextureVisible(uint32_t, bool);
  65. void makeVisible(bool);
  66. int removeClone(uint32_t);
  67. int removeDirection(uint32_t);
  68. int removeTexturePartialArea(uint32_t, uint32_t);
  69. int removeTexture(uint32_t);
  70. void setAngle(double);
  71. int setCloneRendererInfo(uint32_t, ModelCloneRendererInfo);
  72. void setPosition(LynarMath::_Point_d);
  73. void setSize(LynarMath::_Point_d);
  74. void setSizeFactor(double);
  75. int setTexturePosition(uint32_t, LynarMath::_Point_d);
  76. int setTextureZindex(uint32_t, uint32_t);
  77. void setZindex(uint32_t);
  78. };
  79. #endif