ModelModule.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * author: Patrick-Christopher Mattulat
  3. * dev-tools: JetBrains CLion
  4. * created: 29.08.2018
  5. * last updated: 19.10.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 moveInDirection(uint32_t, double);
  67. int removeClone(uint32_t);
  68. int removeDirection(uint32_t);
  69. int removeTexturePartialArea(uint32_t, uint32_t);
  70. int removeTexture(uint32_t);
  71. void setAngle(double);
  72. int setCloneRendererInfo(uint32_t, ModelCloneRendererInfo);
  73. void setPosition(LynarMath::_Point_d);
  74. void setSize(LynarMath::_Point_d);
  75. void setSizeFactor(double);
  76. int setTexturePosition(uint32_t, LynarMath::_Point_d);
  77. int setTextureZindex(uint32_t, uint32_t);
  78. void setZindex(uint32_t);
  79. };
  80. #endif